diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-08-19 10:55:07 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-08-19 10:55:07 +0300 |
commit | 8c075563040f45bcf0efd6a4d164b73bd7c7c661 (patch) | |
tree | 1edb88ce605368190b24dac11983b59bc719e0d9 /tests | |
parent | c3133f84931e11b10db65e539303915e2ad5bc1d (diff) |
Fix controller tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Controller/WizardControllerTest.php | 16 |
1 files changed, 12 insertions, 4 deletions
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 { |