aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php17
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()