mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Avoid error when a bad order
parameter is given
Only allowed parameter are asc & desc
This commit is contained in:
parent
a5e9a98aa3
commit
78e3fafa3f
3 changed files with 32 additions and 14 deletions
|
@ -242,6 +242,15 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
|||
$this->assertSame(2, $content['limit']);
|
||||
}
|
||||
|
||||
public function testGetStarredEntriesWithBadSort()
|
||||
{
|
||||
$this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated', 'order' => 'unknown']);
|
||||
|
||||
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type'));
|
||||
}
|
||||
|
||||
public function testGetStarredEntries()
|
||||
{
|
||||
$this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue