From 8c075563040f45bcf0efd6a4d164b73bd7c7c661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 19 Aug 2020 09:55:07 +0200 Subject: Fix controller tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- tests/Controller/WizardControllerTest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tests/Controller/WizardControllerTest.php') diff --git a/tests/Controller/WizardControllerTest.php b/tests/Controller/WizardControllerTest.php index 9400280a..d53fa1d5 100644 --- a/tests/Controller/WizardControllerTest.php +++ b/tests/Controller/WizardControllerTest.php @@ -93,8 +93,10 @@ class WizardControllerTest extends TestCase { public function testShowUser() { + $this->config->expects($this->at(0)) + ->method('getAppValue') + ->willReturn('video,values,apps,clients,final'); $controller = $this->getController(); - $this->config->expects($this->exactly(4)) ->method('getSystemValue') ->willReturnMap([ @@ -108,7 +110,9 @@ class WizardControllerTest extends TestCase { $this->assertInstanceOf(JSONResponse::class, $response); $this->assertSame(Http::STATUS_OK, $response->getStatus()); - $this->assertCount(3, $response->getData()); + $response = $response->getData(); + $this->assertCount(3, $response['slides']); + $this->assertEquals(true, $response['hasVideo']); } /** @@ -117,8 +121,10 @@ class WizardControllerTest extends TestCase { * @param int $expectedSlidesCount */ public function testShowAdmin(bool $appstoreEnabled, int $expectedSlidesCount): void { + $this->config->expects($this->at(0)) + ->method('getAppValue') + ->willReturn('video,values,apps,clients,final'); $controller = $this->getController(); - if ($appstoreEnabled) { $this->groupManager->expects($this->once()) ->method('isAdmin') @@ -141,7 +147,9 @@ class WizardControllerTest extends TestCase { $this->assertInstanceOf(JSONResponse::class, $response); $this->assertSame(Http::STATUS_OK, $response->getStatus()); - $this->assertCount($expectedSlidesCount, $response->getData()); + $response = $response->getData(); + $this->assertCount($expectedSlidesCount, $response['slides']); + $this->assertEquals(true, $response['hasVideo']); } public function dataShowAdmin(): array { -- cgit v1.2.3