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/ForumCategoryDeleteTest.php | |
| parent | 8edcc69d26d73736b1bab92df28a00cd97ab8cf3 (diff) | |
Update der JSONAPI-Bibliotheken, fixes #80
Diffstat (limited to 'tests/jsonapi/ForumCategoryDeleteTest.php')
| -rw-r--r-- | tests/jsonapi/ForumCategoryDeleteTest.php | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/jsonapi/ForumCategoryDeleteTest.php b/tests/jsonapi/ForumCategoryDeleteTest.php index 2805f53..8d144f2 100644 --- a/tests/jsonapi/ForumCategoryDeleteTest.php +++ b/tests/jsonapi/ForumCategoryDeleteTest.php @@ -44,19 +44,17 @@ class ForumCategoryDeleteTest extends \Codeception\Test\Unit public function testShouldNotDeleteEntry() { - $this->tester->expectThrowable(RecordNotFoundException::class, function () { - $credentials = $this->tester->getCredentialsForTestDozent(); - $cat = $this->createCategory($credentials); - $entry = $this->createEntry($credentials, $cat->id); - $app = $this->tester->createApp($credentials, 'delete', '/forum-categories/{id}', ForumCategoriesDelete::class); - - $requestBuilder = $this->tester->createRequestBuilder($credentials); - $requestBuilder - ->setUri('/forum-categories/badId') - ->delete(); - - $response = $this->tester->sendMockRequest($app, $requestBuilder->getRequest()); - $this->tester->assertIsEmpty(ForumCat::find($cat->id)); - }); + $credentials = $this->tester->getCredentialsForTestDozent(); + $cat = $this->createCategory($credentials); + $entry = $this->createEntry($credentials, $cat->id); + $app = $this->tester->createApp($credentials, 'delete', '/forum-categories/{id}', ForumCategoriesDelete::class); + + $requestBuilder = $this->tester->createRequestBuilder($credentials); + $requestBuilder + ->setUri('/forum-categories/badId') + ->delete(); + + $response = $this->tester->sendMockRequest($app, $requestBuilder->getRequest()); + $this->tester->assertSame(404, $response->getStatusCode()); } } |
