diff --git a/lib/private/appframework/core/api.php b/lib/private/appframework/core/api.php index c5991237ed1299a064b28216951f3cfdad6e27da..31da0706a15e80b676318d7ac0458ec4e5c1e03a 100644 --- a/lib/private/appframework/core/api.php +++ b/lib/private/appframework/core/api.php @@ -99,16 +99,6 @@ class API implements IApi{ } - /** - * Returns the translation object - * @return \OC_L10N the translation object - */ - public function getTrans(){ - # TODO: use public api - return \OC_L10N::get($this->appName); - } - - /** * Returns the URL for a route * @param string $routeName the name of the route diff --git a/lib/public/appframework/iapi.php b/lib/public/appframework/iapi.php index fa6af5f596593c6ba1d6b3e42c20f89a063c9d92..818647c19fd505d40b9ff1e37ab878a03c6b7fca 100644 --- a/lib/public/appframework/iapi.php +++ b/lib/public/appframework/iapi.php @@ -67,14 +67,6 @@ interface IApi { */ function add3rdPartyStyle($name); - /** - * Returns the translation object - * @return \OC_L10N the translation object - * - * FIXME: returns private object / should be retrieved from teh ServerContainer - */ - function getTrans(); - /** * Returns the URL for a route diff --git a/tests/lib/appframework/dependencyinjection/DIContainerTest.php b/tests/lib/appframework/dependencyinjection/DIContainerTest.php index 25fdd202839340ad233dff21caff16b8bb01e3b8..f3ebff0207f38a9fda87495debed6ba3cba444de 100644 --- a/tests/lib/appframework/dependencyinjection/DIContainerTest.php +++ b/tests/lib/appframework/dependencyinjection/DIContainerTest.php @@ -29,23 +29,14 @@ namespace OC\AppFramework\DependencyInjection; use \OC\AppFramework\Http\Request; -//require_once(__DIR__ . "/../classloader.php"); - - class DIContainerTest extends \PHPUnit_Framework_TestCase { private $container; + private $api; protected function setUp(){ $this->container = new DIContainer('name'); - $this->api = $this->getMock('OC\AppFramework\Core\API', array('getTrans'), array('hi')); - } - - private function exchangeAPI(){ - $this->api->expects($this->any()) - ->method('getTrans') - ->will($this->returnValue('yo')); - $this->container['API'] = $this->api; + $this->api = $this->getMock('OC\AppFramework\Core\API', array(), array('hi')); } public function testProvidesAPI(){ @@ -87,12 +78,4 @@ class DIContainerTest extends \PHPUnit_Framework_TestCase { } - public function testMiddlewareDispatcherDoesNotIncludeTwigWhenTplDirectoryNotSet(){ - $this->container['Request'] = new Request(); - $this->exchangeAPI(); - $dispatcher = $this->container['MiddlewareDispatcher']; - - $this->assertEquals(1, count($dispatcher->getMiddlewares())); - } - }