From 19cdd31c40b4d729754991e3d045c435c78350d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 15 Sep 2020 08:54:03 +0200 Subject: [PATCH] Fix PageController tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/unit/controller/PageControllerTest.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php index d84724e4a..4cc9e0c8b 100644 --- a/tests/unit/controller/PageControllerTest.php +++ b/tests/unit/controller/PageControllerTest.php @@ -24,40 +24,33 @@ namespace OCA\Deck\Controller; +use OCA\Deck\Service\ConfigService; use OCA\Deck\Service\PermissionService; use OCP\IInitialStateService; use OCP\IL10N; use OCP\IRequest; -use OCA\Deck\Db\Board; -use OCP\IConfig; class PageControllerTest extends \Test\TestCase { private $controller; private $request; private $l10n; - private $userId = 'john'; private $permissionService; private $initialState; - private $config; + private $configService; public function setUp(): void { $this->l10n = $this->createMock(IL10N::class); $this->request = $this->createMock(IRequest::class); $this->permissionService = $this->createMock(PermissionService::class); - $this->config = $this->createMock(IConfig::class); + $this->configService = $this->createMock(ConfigService::class); $this->initialState = $this->createMock(IInitialStateService::class); $this->controller = new PageController( - 'deck', $this->request, $this->permissionService, $this->initialState, $this->l10n, $this->userId + 'deck', $this->request, $this->permissionService, $this->initialState, $this->configService ); } public function testIndex() { - $board = new Board(); - $board->setTitle('Personal'); - $board->setOwner($this->userId); - $board->setColor('317CCC'); - $this->permissionService->expects($this->any()) ->method('canCreate') ->willReturn(true);