diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2019-02-17 18:19:51 +0100 |
---|---|---|
committer | Kevin Decherf <kevin@kdecherf.com> | 2019-02-20 15:57:56 +0100 |
commit | 12a97c352275d81e9252ca4179de51180403eb6f (patch) | |
tree | 7495caff11c8183fb1aeed9abebf38c6a4a2207f | |
parent | 508302042f96ce771a36f0114acb0b3a89c18880 (diff) | |
download | wallabag-12a97c352275d81e9252ca4179de51180403eb6f.tar.gz wallabag-12a97c352275d81e9252ca4179de51180403eb6f.tar.zst wallabag-12a97c352275d81e9252ca4179de51180403eb6f.zip |
tests: fix broken session clients for rest entry deletion tests
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 1489a472..46b5f460 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php | |||
@@ -426,9 +426,10 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
426 | $this->assertSame($e['id'], $content['id']); | 426 | $this->assertSame($e['id'], $content['id']); |
427 | 427 | ||
428 | // We'll try to delete this entry again | 428 | // We'll try to delete this entry again |
429 | $this->client->request('DELETE', '/api/entries/' . $e['id'] . '.json'); | 429 | $client = $this->createAuthorizedClient(); |
430 | $client->request('DELETE', '/api/entries/' . $e['id'] . '.json'); | ||
430 | 431 | ||
431 | $this->assertSame(404, $this->client->getResponse()->getStatusCode()); | 432 | $this->assertSame(404, $client->getResponse()->getStatusCode()); |
432 | } | 433 | } |
433 | 434 | ||
434 | public function testDeleteEntryExpectId() | 435 | public function testDeleteEntryExpectId() |
@@ -453,9 +454,17 @@ class EntryRestControllerTest extends WallabagApiTestCase | |||
453 | $this->assertArrayNotHasKey('url', $content); | 454 | $this->assertArrayNotHasKey('url', $content); |
454 | 455 | ||
455 | // We'll try to delete this entry again | 456 | // We'll try to delete this entry again |
456 | $this->client->request('DELETE', '/api/entries/' . $id . '.json'); | 457 | $client = $this->createAuthorizedClient(); |
458 | $client->request('DELETE', '/api/entries/' . $id . '.json'); | ||
459 | |||
460 | $this->assertSame(404, $client->getResponse()->getStatusCode()); | ||
461 | } | ||
462 | |||
463 | public function testDeleteEntryExpectBadRequest() | ||
464 | { | ||
465 | $this->client->request('DELETE', '/api/entries/1.json?expect=badrequest'); | ||
457 | 466 | ||
458 | $this->assertSame(404, $this->client->getResponse()->getStatusCode()); | 467 | $this->assertSame(400, $this->client->getResponse()->getStatusCode()); |
459 | } | 468 | } |
460 | 469 | ||
461 | public function testPostEntry() | 470 | public function testPostEntry() |