Release 2.12 (#4609)

This commit is contained in:
Kevin Papst
2024-02-07 23:47:25 +01:00
committed by GitHub
parent 7abe787778
commit 85a16a9363
394 changed files with 1189 additions and 6735 deletions

View File

@@ -35,7 +35,7 @@ trait RateControllerTestTrait
*/
abstract protected function importTestRates($id): array;
public function testAddRateMissingEntityAction()
public function testAddRateMissingEntityAction(): void
{
$data = [
'user' => 1,
@@ -47,7 +47,7 @@ trait RateControllerTestTrait
$this->assertEntityNotFoundForPost($client, $this->getRateUrl(99), $data);
}
public function testAddRateMissingUserAction()
public function testAddRateMissingUserAction(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$data = [
@@ -63,7 +63,7 @@ trait RateControllerTestTrait
$this->assertApiCallValidationError($response, ['user']);
}
public function testAddRateActionWithInvalidUser()
public function testAddRateActionWithInvalidUser(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$data = [
@@ -77,7 +77,7 @@ trait RateControllerTestTrait
$this->assertApiResponseAccessDenied($response, 'Access denied.');
}
public function testAddRateAction()
public function testAddRateAction(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$data = [
@@ -98,7 +98,7 @@ trait RateControllerTestTrait
$this->assertFalse($result['isFixed']);
}
public function testAddFixedRateAction()
public function testAddFixedRateAction(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$data = [
@@ -119,7 +119,7 @@ trait RateControllerTestTrait
$this->assertTrue($result['isFixed']);
}
public function testGetRatesEmptyResult()
public function testGetRatesEmptyResult(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->request($client, $this->getRateUrl(1));
@@ -130,7 +130,7 @@ trait RateControllerTestTrait
$this->assertEmpty($result);
}
public function testGetRates()
public function testGetRates(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$expectedRates = $this->importTestRates(1);
@@ -148,17 +148,17 @@ trait RateControllerTestTrait
}
}
public function testGetRatesEntityNotFound()
public function testGetRatesEntityNotFound(): void
{
$this->assertEntityNotFound(User::ROLE_ADMIN, $this->getRateUrl(99));
}
public function testGetRatesIsSecured()
public function testGetRatesIsSecured(): void
{
$this->assertUrlIsSecuredForRole(User::ROLE_USER, $this->getRateUrl(1));
}
public function testDeleteRate()
public function testDeleteRate(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$expectedRates = $this->importTestRates(1);
@@ -176,19 +176,19 @@ trait RateControllerTestTrait
$this->assertEquals(\count($expectedRates) - 1, \count($result));
}
public function testDeleteRateEntityNotFound()
public function testDeleteRateEntityNotFound(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->assertNotFoundForDelete($client, $this->getRateUrl(99, 1));
}
public function testDeleteRateRateNotFound()
public function testDeleteRateRateNotFound(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->assertNotFoundForDelete($client, $this->getRateUrl(1, 99));
}
public function testDeleteRateWithInvalidAssignment()
public function testDeleteRateWithInvalidAssignment(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->importTestRates(1);
@@ -197,7 +197,7 @@ trait RateControllerTestTrait
$this->assertNotFoundForDelete($client, $this->getRateUrl(2, 1));
}
public function testDeleteNotAllowed()
public function testDeleteNotAllowed(): void
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$rates = $this->importTestRates(1);
@@ -209,7 +209,7 @@ trait RateControllerTestTrait
$this->assertApiResponseAccessDenied($client->getResponse(), 'Access denied.');
}
protected function assertRateStructure(array $result, $user = null)
public function assertRateStructure(array $result, $user = null): void
{
$expectedKeys = [
'id', 'rate', 'internalRate', 'isFixed', 'user'