diff options
| author | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2021-08-20 06:11:05 +0000 |
|---|---|---|
| committer | Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de> | 2021-08-20 06:11:05 +0000 |
| commit | 9b6bd7e747bd5ed44d169a8e1baee0e519d209d6 (patch) | |
| tree | 104c177e3c0d40d7471d7c081d61dec15cb1bab9 /tests/jsonapi/ForumCategoriesShowTest.php | |
| parent | 8edcc69d26d73736b1bab92df28a00cd97ab8cf3 (diff) | |
Update der JSONAPI-Bibliotheken, fixes #80
Diffstat (limited to 'tests/jsonapi/ForumCategoriesShowTest.php')
| -rw-r--r-- | tests/jsonapi/ForumCategoriesShowTest.php | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/tests/jsonapi/ForumCategoriesShowTest.php b/tests/jsonapi/ForumCategoriesShowTest.php index 710a7b1..4e8df26 100644 --- a/tests/jsonapi/ForumCategoriesShowTest.php +++ b/tests/jsonapi/ForumCategoriesShowTest.php @@ -47,24 +47,16 @@ class ForumCategoriesShowTest extends \Codeception\Test\Unit public function testShouldNotShowCategories() { - $this->tester->expectThrowable(RecordNotFoundException::class, function () { - $credentials = $this->tester->getCredentialsForTestDozent(); + $credentials = $this->tester->getCredentialsForTestDozent(); - $app = $this->tester->createApp($credentials, 'get', '/forum-categories/{id}', ForumCategoriesShow::class); - - $requestBuilder = $this->tester->createRequestBuilder($credentials); - $requestBuilder - ->setUri('/forum-categories/'.'badId') - ->fetch(); - - $response = $this->tester->sendMockRequest($app, $requestBuilder->getRequest()); + $app = $this->tester->createApp($credentials, 'get', '/forum-categories/{id}', ForumCategoriesShow::class); - $this->tester->assertTrue($response->isSuccessfulDocument([200])); - $document = $response->document(); - $resourceObject = $document->primaryResource(); + $requestBuilder = $this->tester->createRequestBuilder($credentials); + $requestBuilder + ->setUri('/forum-categories/'.'badId') + ->fetch(); - $this->tester->assertSame($cat->entry_name, $resourceObject->attribute('title')); - $this->tester->assertSame((int) $cat->pos, $resourceObject->attribute('position')); - }); + $response = $this->tester->sendMockRequest($app, $requestBuilder->getRequest()); + $this->tester->assertSame(404, $response->getStatusCode()); } } |
