Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-05-10 10:41:33 +0300
committerJoas Schilling <coding@schilljs.com>2017-05-10 10:42:15 +0300
commit9c8fe8200019c0e6345cd8e73bb2d81742781839 (patch)
treee119c8dc2f608485c8bf831852da1cb3dc5aa2ef /tests/Core
parent209b05489d442652fa4d7ce3a7b37568444b5ae4 (diff)
Automatic injection for JsController
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Controller/JsControllerTest.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/Core/Controller/JsControllerTest.php b/tests/Core/Controller/JsControllerTest.php
index 8456ba8b6e3..571318c89d0 100644
--- a/tests/Core/Controller/JsControllerTest.php
+++ b/tests/Core/Controller/JsControllerTest.php
@@ -23,6 +23,7 @@
namespace Tests\Core\Controller;
use OC\Core\Controller\JsController;
+use OC\Files\AppData\Factory;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\NotFoundResponse;
@@ -48,8 +49,15 @@ class JsControllerTest 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('js')
+ ->willReturn($this->appData);
+ /** @var ITimeFactory|\PHPUnit_Framework_MockObject_MockObject $timeFactory */
$timeFactory = $this->createMock(ITimeFactory::class);
$timeFactory->method('getTime')
->willReturn(1337);
@@ -59,7 +67,7 @@ class JsControllerTest extends TestCase {
$this->controller = new JsController(
'core',
$this->request,
- $this->appData,
+ $factory,
$timeFactory
);
}