mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 20:04:34 +02:00
Added tests for the remaining API endpoints
This commit is contained in:
parent
3d67ad870a
commit
af98842090
10 changed files with 503 additions and 1 deletions
|
@ -44,6 +44,16 @@ abstract class CrudEndpointTestCase extends AuthenticatedApiTestCase
|
|||
return $basePath . $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the id of the created element from the response.
|
||||
* @param ResponseInterface $response
|
||||
* @return int
|
||||
*/
|
||||
protected function getIdOfCreatedElement(ResponseInterface $response): int
|
||||
{
|
||||
return $response->toArray(true)['id'];
|
||||
}
|
||||
|
||||
protected function _testGetCollection(): ResponseInterface
|
||||
{
|
||||
$response = self::createAuthenticatedClient()->request('GET', $this->getBasePath());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue