mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Added API test covering invalid tagsMode
This commit is contained in:
parent
0447aa07fa
commit
9dec05f62d
1 changed files with 17 additions and 0 deletions
|
@ -241,4 +241,21 @@ class ListShortUrlsTest extends ApiTestCase
|
|||
'totalItems' => $itemsCount,
|
||||
];
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function errorIsReturnedWhenProvidingInvalidValues(): void
|
||||
{
|
||||
$query = ['tagsMode' => 'invalid'];
|
||||
$resp = $this->callApiWithKey(self::METHOD_GET, '/short-urls', [RequestOptions::QUERY => $query]);
|
||||
$respPayload = $this->getJsonResponsePayload($resp);
|
||||
|
||||
self::assertEquals(400, $resp->getStatusCode());
|
||||
self::assertEquals([
|
||||
'invalidElements' => ['tagsMode'],
|
||||
'title' => 'Invalid data',
|
||||
'type' => 'INVALID_ARGUMENT',
|
||||
'status' => 400,
|
||||
'detail' => 'Provided data is not valid',
|
||||
], $respPayload);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue