diff options
author | Joas Schilling <coding@schilljs.com> | 2017-05-10 10:42:40 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-05-10 10:42:40 +0300 |
commit | d418ea550ba3e15b4ce1dbe1d0491c158f988b38 (patch) | |
tree | 449edc68b369a15f5c455eb5108235631feb8fce /tests/Core | |
parent | 9c8fe8200019c0e6345cd8e73bb2d81742781839 (diff) |
Automatic injection for CssController
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Core')
-rw-r--r-- | tests/Core/Controller/CssControllerTest.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/Core/Controller/CssControllerTest.php b/tests/Core/Controller/CssControllerTest.php index 30bbc12809e..c78233d8917 100644 --- a/tests/Core/Controller/CssControllerTest.php +++ b/tests/Core/Controller/CssControllerTest.php @@ -23,7 +23,7 @@ namespace Tests\Core\Controller; use OC\Core\Controller\CssController; -use OC\HintException; +use OC\Files\AppData\Factory; use OCP\AppFramework\Http; use OCP\AppFramework\Http\FileDisplayResponse; use OCP\AppFramework\Http\NotFoundResponse; @@ -40,7 +40,7 @@ class CssControllerTest extends TestCase { /** @var IAppData|\PHPUnit_Framework_MockObject_MockObject */ private $appData; - /** @var IRequests|\PHPUnit_Framework_MockObject_MockObject */ + /** @var IRequest|\PHPUnit_Framework_MockObject_MockObject */ private $request; /** @var CssController */ @@ -49,8 +49,15 @@ class CssControllerTest extends TestCase { public function setUp() { parent::setUp(); + /** @var Factory|\PHPUnit_Framework_MockObject_MockObject $factory */ + $factory = $this->createMock(Factory::class); $this->appData = $this->createMock(IAppData::class); + $factory->expects($this->once()) + ->method('get') + ->with('css') + ->willReturn($this->appData); + /** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject $timeFactory */ $timeFactory = $this->createMock(ITimeFactory::class); $timeFactory->method('getTime') ->willReturn(1337); @@ -60,7 +67,7 @@ class CssControllerTest extends TestCase { $this->controller = new CssController( 'core', $this->request, - $this->appData, + $factory, $timeFactory ); } |