Skip to content

Commit

Permalink
tests: fix broken session clients for rest entry deletion tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Decherf <[email protected]>
  • Loading branch information
Kdecherf committed Feb 20, 2019
1 parent 5083020 commit 12a97c3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,10 @@ public function testDeleteEntry()
$this->assertSame($e['id'], $content['id']);

// We'll try to delete this entry again
$this->client->request('DELETE', '/api/entries/' . $e['id'] . '.json');
$client = $this->createAuthorizedClient();
$client->request('DELETE', '/api/entries/' . $e['id'] . '.json');

$this->assertSame(404, $this->client->getResponse()->getStatusCode());
$this->assertSame(404, $client->getResponse()->getStatusCode());
}

public function testDeleteEntryExpectId()
Expand All @@ -453,9 +454,17 @@ public function testDeleteEntryExpectId()
$this->assertArrayNotHasKey('url', $content);

// We'll try to delete this entry again
$this->client->request('DELETE', '/api/entries/' . $id . '.json');
$client = $this->createAuthorizedClient();
$client->request('DELETE', '/api/entries/' . $id . '.json');

$this->assertSame(404, $client->getResponse()->getStatusCode());
}

public function testDeleteEntryExpectBadRequest()
{
$this->client->request('DELETE', '/api/entries/1.json?expect=badrequest');

$this->assertSame(404, $this->client->getResponse()->getStatusCode());
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
}

public function testPostEntry()
Expand Down

0 comments on commit 12a97c3

Please sign in to comment.