remove getTrans() from API class

This commit is contained in:
Thomas Müller 2013-10-07 11:36:38 +02:00
parent 1e5012fc1d
commit 3ea2dfa5f9
3 changed files with 2 additions and 37 deletions

View File

@ -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

View File

@ -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

View File

@ -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()));
}
}