Added tests for the remaining API endpoints

This commit is contained in:
Jan Böhmer 2024-03-03 23:07:55 +01:00
parent 3d67ad870a
commit af98842090
10 changed files with 503 additions and 1 deletions

View file

@ -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());