diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 35de3bb0..487180a5 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,17 +1,5 @@ name-template: '$RESOLVED_VERSION' tag-template: '$RESOLVED_VERSION' -categories: - - title: 'Enhancements' - labels: - - 'feature request' - - 'technical debt' - - 'translation' - - title: 'Fixed bugs' - labels: - - 'bug' - - title: 'Infrastructure' - labels: - - 'infrastructure' exclude-labels: - 'duplicate' - 'invalid' diff --git a/migrations/Version20230126002049.php b/migrations/Version20230126002049.php index 1ec77e58..62c2fc6b 100644 --- a/migrations/Version20230126002049.php +++ b/migrations/Version20230126002049.php @@ -42,7 +42,7 @@ final class Version20230126002049 extends AbstractMigration $users = $schema->getTable('kimai2_users'); if (!$users->hasColumn('totp_secret')) { - $users->addColumn('totp_secret', 'string', ['notnull' => false, 'default' => null]); + $users->addColumn('totp_secret', 'string', ['length' => 255, 'notnull' => false, 'default' => null]); $users->addColumn('totp_enabled', 'boolean', ['notnull' => true, 'default' => false]); } if (!$users->hasColumn('system_account')) { diff --git a/src/Configuration/LocaleService.php b/src/Configuration/LocaleService.php index a3a2133f..1f67272c 100644 --- a/src/Configuration/LocaleService.php +++ b/src/Configuration/LocaleService.php @@ -51,7 +51,7 @@ final class LocaleService public function isKnownLocale(string $language): bool { - return \in_array($language, $this->getAllLocales()); + return \in_array($language, $this->getAllLocales(), true); } /** diff --git a/src/Constants.php b/src/Constants.php index eaed5396..bbeab3a5 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -17,11 +17,11 @@ class Constants /** * The current release version */ - public const VERSION = '2.11.0'; + public const VERSION = '2.12.0'; /** * The current release: major * 10000 + minor * 100 + patch */ - public const VERSION_ID = 21100; + public const VERSION_ID = 21200; /** * The software name */ diff --git a/src/Controller/Auth/SamlController.php b/src/Controller/Auth/SamlController.php index 6a7be289..8e1c902c 100644 --- a/src/Controller/Auth/SamlController.php +++ b/src/Controller/Auth/SamlController.php @@ -15,12 +15,16 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Http\SecurityRequestAttributes; #[Route(path: '/saml')] final class SamlController extends AbstractController { - public function __construct(private SamlAuthFactory $authFactory, private SamlConfigurationInterface $samlConfiguration) + public function __construct( + private readonly SamlAuthFactory $authFactory, + private readonly SamlConfigurationInterface $samlConfiguration + ) { } @@ -51,7 +55,12 @@ final class SamlController extends AbstractController } // this does set headers and exit as $stay is not set to true - $url = $this->authFactory->create()->login($session->get('_security.main.target_path')); + $redirectTarget = $session->get('_security.main.target_path'); + if ($redirectTarget === null || $redirectTarget === '') { + $redirectTarget = $this->generateUrl('homepage', [], UrlGeneratorInterface::ABSOLUTE_URL); + } + + $url = $this->authFactory->create()->login($redirectTarget); if ($url === null) { throw new \RuntimeException('SAML login failed'); diff --git a/src/Entity/User.php b/src/Entity/User.php index d35b3f23..303ba752 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -209,8 +209,9 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas private array $roles = []; /** * If not empty two-factor authentication is enabled. + * TODO reduce the length, which was initially forgotten and set to 255, as this is the default for MySQL with Doctrine (see migration Version20230126002049) */ - #[ORM\Column(name: 'totp_secret', type: 'string', nullable: true)] + #[ORM\Column(name: 'totp_secret', type: 'string', length: 255, nullable: true)] private ?string $totpSecret = null; #[ORM\Column(name: 'totp_enabled', type: 'boolean', nullable: false, options: ['default' => false])] private bool $totpEnabled = false; @@ -1287,9 +1288,11 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas return $group === null ? $group : (string) $group; } - public function getHolidaysPerYear(): int + public function getHolidaysPerYear(): float { - return (int) $this->getPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, 0); + $holidays = $this->getPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, 0.0); + + return $this->getFormattedHoliday(is_numeric($holidays) ? $holidays : 0.0); } public function setWorkHoursMonday(int $seconds): void @@ -1332,14 +1335,28 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas $this->setPreferenceValue(UserPreference::PUBLIC_HOLIDAY_GROUP, $group); } - public function setHolidaysPerYear(?int $holidays): void + public function setHolidaysPerYear(?float $holidays): void { - $this->setPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, $holidays ?? 0); + if ($holidays !== null) { + // makes sure that the number is a multiple of 0.5 + $holidays = $this->getFormattedHoliday($holidays); + } + + $this->setPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, $holidays ?? 0.0); + } + + private function getFormattedHoliday(int|float|string|null $holidays): float + { + if (!is_numeric($holidays)) { + $holidays = 0.0; + } + + return (float) number_format((round($holidays * 2) / 2), 1); } public function hasContractSettings(): bool { - return $this->hasWorkHourConfiguration() || $this->getHolidaysPerYear() !== 0; + return $this->hasWorkHourConfiguration() || $this->getHolidaysPerYear() !== 0.0; } public function hasWorkHourConfiguration(): bool diff --git a/templates/reporting/report_by_user_data.html.twig b/templates/reporting/report_by_user_data.html.twig index 1da8516c..7a7cd1b9 100644 --- a/templates/reporting/report_by_user_data.html.twig +++ b/templates/reporting/report_by_user_data.html.twig @@ -72,7 +72,7 @@ {% for column in project.data.data %} {% set dateKey = column.date|report_date %}
A beautiful and short comment with some markdown formatting
', $node->html()); } - public function testDeleteCommentAction() + public function testDeleteCommentAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/customer/1/details'); @@ -221,7 +221,7 @@ class CustomerControllerTest extends ControllerBaseTest self::assertStringContainsString('There were no comments posted yet', $node->html()); } - public function testDeleteCommentActionWithoutToken() + public function testDeleteCommentActionWithoutToken(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/customer/1/details'); @@ -242,7 +242,7 @@ class CustomerControllerTest extends ControllerBaseTest $this->assertRouteNotFound($client); } - public function testPinCommentAction() + public function testPinCommentAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/customer/1/details'); @@ -269,7 +269,7 @@ class CustomerControllerTest extends ControllerBaseTest self::assertStringContainsString('/comment_pin/', $node->attr('href')); } - public function testCreateDefaultTeamAction() + public function testCreateDefaultTeamAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/customer/1/details'); @@ -285,7 +285,7 @@ class CustomerControllerTest extends ControllerBaseTest self::assertEquals(1, $node->count()); } - public function testProjectsAction() + public function testProjectsAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/customer/1/projects/1'); @@ -310,7 +310,7 @@ class CustomerControllerTest extends ControllerBaseTest self::assertEquals(5, $node->count()); } - public function testCreateAction() + public function testCreateAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/customer/create'); @@ -332,7 +332,7 @@ class CustomerControllerTest extends ControllerBaseTest $this->assertHasFlashSuccess($client); } - public function testCreateActionShowsMetaFields() + public function testCreateActionShowsMetaFields(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); self::getContainer()->get('event_dispatcher')->addSubscriber(new CustomerTestMetaFieldSubscriberMock()); @@ -345,7 +345,7 @@ class CustomerControllerTest extends ControllerBaseTest $this->assertFalse($form->has('customer_edit_form[metaFields][0][value]')); } - public function testEditAction() + public function testEditAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/customer/1/edit'); @@ -363,7 +363,7 @@ class CustomerControllerTest extends ControllerBaseTest $this->assertEquals('Test Customer 2', $editForm->get('customer_edit_form[name]')->getValue()); } - public function testTeamPermissionAction() + public function testTeamPermissionAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $em = $this->getEntityManager(); @@ -394,7 +394,7 @@ class CustomerControllerTest extends ControllerBaseTest self::assertEquals(2, $customer->getTeams()->count()); } - public function testDeleteAction() + public function testDeleteAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -421,7 +421,7 @@ class CustomerControllerTest extends ControllerBaseTest $this->assertFalse($client->getResponse()->isSuccessful()); } - public function testDeleteActionWithTimesheetEntries() + public function testDeleteActionWithTimesheetEntries(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -459,7 +459,7 @@ class CustomerControllerTest extends ControllerBaseTest $this->assertFalse($client->getResponse()->isSuccessful()); } - public function testDeleteActionWithTimesheetEntriesAndReplacement() + public function testDeleteActionWithTimesheetEntriesAndReplacement(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -513,7 +513,7 @@ class CustomerControllerTest extends ControllerBaseTest /** * @dataProvider getValidationTestData */ - public function testValidationForCreateAction(array $formData, array $validationFields) + public function testValidationForCreateAction(array $formData, array $validationFields): void { $this->assertFormHasValidationError( User::ROLE_ADMIN, diff --git a/tests/Controller/DashboardControllerTest.php b/tests/Controller/DashboardControllerTest.php index f7135c4b..320ceaa8 100644 --- a/tests/Controller/DashboardControllerTest.php +++ b/tests/Controller/DashboardControllerTest.php @@ -14,12 +14,12 @@ namespace App\Tests\Controller; */ class DashboardControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/dashboard/'); } - public function testIndexAction() + public function testIndexAction(): void { $client = $this->getClientForAuthenticatedUser(); $this->request($client, '/dashboard/'); diff --git a/tests/Controller/DoctorControllerTest.php b/tests/Controller/DoctorControllerTest.php index 20fa2f80..a42951c0 100644 --- a/tests/Controller/DoctorControllerTest.php +++ b/tests/Controller/DoctorControllerTest.php @@ -16,17 +16,17 @@ use App\Entity\User; */ class DoctorControllerTest extends ControllerBaseTest { - public function testDoctorIsSecure() + public function testDoctorIsSecure(): void { $this->assertUrlIsSecured('/doctor'); } - public function testDoctorIsSecureForRole() + public function testDoctorIsSecureForRole(): void { $this->assertUrlIsSecuredForRole(User::ROLE_ADMIN, '/doctor'); } - public function testIndexAction() + public function testIndexAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/doctor'); @@ -37,7 +37,7 @@ class DoctorControllerTest extends ControllerBaseTest self::assertTrue($counter === 6 || $counter === 5); } - public function testFlushLogWithInvalidCsrf() + public function testFlushLogWithInvalidCsrf(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); diff --git a/tests/Controller/ExportControllerTest.php b/tests/Controller/ExportControllerTest.php index 6bd96765..1bb5445c 100644 --- a/tests/Controller/ExportControllerTest.php +++ b/tests/Controller/ExportControllerTest.php @@ -20,17 +20,17 @@ use Doctrine\ORM\EntityManager; */ class ExportControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/export/'); } - public function testIsSecureForrole() + public function testIsSecureForrole(): void { $this->assertUrlIsSecuredForRole(User::ROLE_USER, '/export/'); } - public function testIndexActionHasErrorMessageOnEmptyQuery() + public function testIndexActionHasErrorMessageOnEmptyQuery(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); @@ -40,7 +40,7 @@ class ExportControllerTest extends ControllerBaseTest $this->assertHasNoEntriesWithFilter($client); } - public function testIndexActionWithEntriesAndTeams() + public function testIndexActionWithEntriesAndTeams(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $em = $this->getEntityManager(); @@ -109,7 +109,7 @@ class ExportControllerTest extends ControllerBaseTest $this->assertEmpty($expected); } - public function testIndexActionWithEntriesForTeamleadDoesNotShowUserWithoutTeam() + public function testIndexActionWithEntriesForTeamleadDoesNotShowUserWithoutTeam(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); @@ -168,7 +168,7 @@ class ExportControllerTest extends ControllerBaseTest $this->assertEmpty($expected); } - public function testExportActionWithMissingRenderer() + public function testExportActionWithMissingRenderer(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $this->request($client, '/export/data', 'POST'); @@ -177,7 +177,7 @@ class ExportControllerTest extends ControllerBaseTest $this->assert404($response, 'Missing export renderer'); } - public function testExportActionWithInvalidRenderer() + public function testExportActionWithInvalidRenderer(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); @@ -197,7 +197,7 @@ class ExportControllerTest extends ControllerBaseTest $this->assert404($response, 'Unknown export renderer'); } - public function testExportAction() + public function testExportAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); /** @var EntityManager $em */ diff --git a/tests/Controller/HomepageControllerTest.php b/tests/Controller/HomepageControllerTest.php index 70782ae1..3959bc59 100644 --- a/tests/Controller/HomepageControllerTest.php +++ b/tests/Controller/HomepageControllerTest.php @@ -18,19 +18,19 @@ use App\Form\Type\InitialViewType; */ class HomepageControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/homepage'); } - public function testIndexAction() + public function testIndexAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->request($client, '/homepage'); $this->assertIsRedirect($client, '/en/timesheet/'); } - public function testIndexActionWithChangedPreferences() + public function testIndexActionWithChangedPreferences(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); diff --git a/tests/Controller/ProjectControllerTest.php b/tests/Controller/ProjectControllerTest.php index fc8fa1dc..872aa4ff 100644 --- a/tests/Controller/ProjectControllerTest.php +++ b/tests/Controller/ProjectControllerTest.php @@ -32,17 +32,17 @@ use Symfony\Component\HttpKernel\HttpKernelBrowser; */ class ProjectControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/admin/project/'); } - public function testIsSecureForRole() + public function testIsSecureForRole(): void { $this->assertUrlIsSecuredForRole(User::ROLE_USER, '/admin/project/'); } - public function testIndexAction() + public function testIndexAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $this->assertAccessIsGranted($client, '/admin/project/'); @@ -53,7 +53,7 @@ class ProjectControllerTest extends ControllerBaseTest ]); } - public function testIndexActionAsSuperAdmin() + public function testIndexActionAsSuperAdmin(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/'); @@ -65,7 +65,7 @@ class ProjectControllerTest extends ControllerBaseTest ]); } - public function testIndexActionWithSearchTermQuery() + public function testIndexActionWithSearchTermQuery(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -100,19 +100,19 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertDataTableRowCount($client, 'datatable_project_admin', 5); } - public function testExportIsSecureForRole() + public function testExportIsSecureForRole(): void { $this->assertUrlIsSecuredForRole(User::ROLE_USER, '/admin/project/export'); } - public function testExportAction() + public function testExportAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $this->assertAccessIsGranted($client, '/admin/project/export'); $this->assertExcelExportResponse($client, 'kimai-projects_'); } - public function testExportActionWithSearchTermQuery() + public function testExportActionWithSearchTermQuery(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -141,7 +141,7 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertExcelExportResponse($client, 'kimai-projects_'); } - public function testDetailsAction() + public function testDetailsAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); /** @var EntityManager $em */ @@ -187,13 +187,13 @@ class ProjectControllerTest extends ControllerBaseTest self::assertEquals(1, $node->count()); } - public function testAddRateAction() + public function testAddRateAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAddRate($client, 123.45, 1); } - protected function assertAddRate(HttpKernelBrowser $client, $rate, $projectId) + public function assertAddRate(HttpKernelBrowser $client, $rate, $projectId): void { $this->assertAccessIsGranted($client, '/admin/project/' . $projectId . '/rate'); $form = $client->getCrawler()->filter('form[name=project_rate_form]')->form(); @@ -211,7 +211,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertStringContainsString($rate, $node->text(null, true)); } - public function testDuplicateAction() + public function testDuplicateAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); /** @var EntityManager $em */ @@ -251,7 +251,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertStringContainsString('123.45', $node->text(null, true)); } - public function testDuplicateActionWithInvalidCsrf() + public function testDuplicateActionWithInvalidCsrf(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); /** @var EntityManager $em */ @@ -270,7 +270,7 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertInvalidCsrfToken($client, '/admin/project/1/duplicate/rsetdzfukgli78t6r5uedtjfzkugl', $this->createUrl('/admin/project/1/details')); } - public function testAddCommentAction() + public function testAddCommentAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/details'); @@ -291,7 +291,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertStringContainsString('A beautiful and long comment with some markdown formatting
', $node->html()); } - public function testDeleteCommentAction() + public function testDeleteCommentAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/details'); @@ -314,7 +314,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertStringContainsString('There were no comments posted yet', $node->html()); } - public function testPinCommentAction() + public function testPinCommentAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/details'); @@ -342,7 +342,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertStringContainsString('/comment_pin/', $node->attr('href')); } - public function testCreateDefaultTeamAction() + public function testCreateDefaultTeamAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/details'); @@ -358,7 +358,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertEquals(1, $node->count()); } - public function testActivitiesAction() + public function testActivitiesAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/activities/1'); @@ -384,7 +384,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertEquals(5, $node->count()); } - public function testCreateAction() + public function testCreateAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/create'); @@ -403,7 +403,7 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertHasFlashSuccess($client); } - public function testCreateActionShowsMetaFields() + public function testCreateActionShowsMetaFields(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); self::getContainer()->get('event_dispatcher')->addSubscriber(new ProjectTestMetaFieldSubscriberMock()); @@ -416,7 +416,7 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertFalse($form->has('project_edit_form[metaFields][0][value]')); } - public function testEditAction() + public function testEditAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/edit'); @@ -432,7 +432,7 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertEquals('Test 2', $editForm->get('project_edit_form[name]')->getValue()); } - public function testTeamPermissionAction() + public function testTeamPermissionAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $em = $this->getEntityManager(); @@ -463,7 +463,7 @@ class ProjectControllerTest extends ControllerBaseTest self::assertEquals(2, $project->getTeams()->count()); } - public function testDeleteAction() + public function testDeleteAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -490,7 +490,7 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertFalse($client->getResponse()->isSuccessful()); } - public function testDeleteActionWithTimesheetEntries() + public function testDeleteActionWithTimesheetEntries(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -528,7 +528,7 @@ class ProjectControllerTest extends ControllerBaseTest $this->assertFalse($client->getResponse()->isSuccessful()); } - public function testDeleteActionWithTimesheetEntriesAndReplacement() + public function testDeleteActionWithTimesheetEntriesAndReplacement(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); @@ -581,7 +581,7 @@ class ProjectControllerTest extends ControllerBaseTest /** * @dataProvider getValidationTestData */ - public function testValidationForCreateAction(array $formData, array $validationFields) + public function testValidationForCreateAction(array $formData, array $validationFields): void { $this->assertFormHasValidationError( User::ROLE_ADMIN, diff --git a/tests/Controller/QuickEntryControllerTest.php b/tests/Controller/QuickEntryControllerTest.php index 68c2c09c..d0c58612 100644 --- a/tests/Controller/QuickEntryControllerTest.php +++ b/tests/Controller/QuickEntryControllerTest.php @@ -16,12 +16,12 @@ use App\Tests\DataFixtures\TimesheetFixtures; */ class QuickEntryControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/quick_entry'); } - public function testIndexAction() + public function testIndexAction(): void { $client = $this->getClientForAuthenticatedUser(); $this->request($client, '/quick_entry'); @@ -52,7 +52,7 @@ class QuickEntryControllerTest extends ControllerBaseTest self::assertCount(10, $columns); } - public function testIndexActionWith() + public function testIndexActionWith(): void { $client = $this->getClientForAuthenticatedUser(); diff --git a/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php b/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php index 12d7e428..07714b2e 100644 --- a/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php +++ b/tests/Controller/Reporting/AbstractUserPeriodControllerTest.php @@ -32,7 +32,7 @@ abstract class AbstractUserPeriodControllerTest extends ControllerBaseTest abstract protected function getBoxId(): string; - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured($this->getReportUrl()); } @@ -49,7 +49,7 @@ abstract class AbstractUserPeriodControllerTest extends ControllerBaseTest /** * @dataProvider getTestData */ - public function testUserPeriodReport(int $user, string $dataType, string $title) + public function testUserPeriodReport(int $user, string $dataType, string $title): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->importReportingFixture(User::ROLE_SUPER_ADMIN); @@ -61,7 +61,7 @@ abstract class AbstractUserPeriodControllerTest extends ControllerBaseTest self::assertEquals($title, $cell->text()); } - public function testUserPeriodReportAsTeamlead() + public function testUserPeriodReportAsTeamlead(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->importReportingFixture(User::ROLE_USER); diff --git a/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php b/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php index 3be7ac4d..800997b5 100644 --- a/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php +++ b/tests/Controller/Reporting/AbstractUsersPeriodControllerTest.php @@ -35,7 +35,7 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest abstract protected function getBoxId(): string; - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured($this->getReportUrl()); } @@ -52,7 +52,7 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest /** * @dataProvider getTestData */ - public function testUsersPeriodReport(string $dataType, string $title) + public function testUsersPeriodReport(string $dataType, string $title): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->importReportingFixture(User::ROLE_SUPER_ADMIN); @@ -65,7 +65,7 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest /** * @dataProvider getTestData */ - public function testUsersPeriodReportAsTeamlead(string $dataType, string $title) + public function testUsersPeriodReportAsTeamlead(string $dataType, string $title): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD); $this->importReportingFixture(User::ROLE_TEAMLEAD); @@ -80,7 +80,7 @@ abstract class AbstractUsersPeriodControllerTest extends ControllerBaseTest /** * @dataProvider getTestData */ - public function testUsersPeriodReportExport(string $dataType, string $title) + public function testUsersPeriodReportExport(string $dataType, string $title): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->importReportingFixture(User::ROLE_SUPER_ADMIN); diff --git a/tests/Controller/Reporting/CustomerMonthlyProjectsControllerTest.php b/tests/Controller/Reporting/CustomerMonthlyProjectsControllerTest.php index a62bf06b..8d70282a 100644 --- a/tests/Controller/Reporting/CustomerMonthlyProjectsControllerTest.php +++ b/tests/Controller/Reporting/CustomerMonthlyProjectsControllerTest.php @@ -24,12 +24,12 @@ use Symfony\Component\HttpKernel\HttpKernelBrowser; */ class CustomerMonthlyProjectsControllerTest extends ControllerBaseTest { - public function testReportIsSecure() + public function testReportIsSecure(): void { $this->assertUrlIsSecured('/reporting/customer/monthly_projects/view'); } - public function testExportReportIsSecure() + public function testExportReportIsSecure(): void { $this->assertUrlIsSecured('/reporting/customer/monthly_projects/export'); } @@ -73,7 +73,7 @@ class CustomerMonthlyProjectsControllerTest extends ControllerBaseTest return $client; } - public function testReport() + public function testReport(): void { $client = $this->prepareReport(); @@ -83,7 +83,7 @@ class CustomerMonthlyProjectsControllerTest extends ControllerBaseTest self::assertGreaterThan(0, $rows->count()); } - public function testExport() + public function testExport(): void { $client = $this->prepareReport(); diff --git a/tests/Controller/Reporting/ProjectDateRangeControllerTest.php b/tests/Controller/Reporting/ProjectDateRangeControllerTest.php index 1d7e9b6c..8fb5ca92 100644 --- a/tests/Controller/Reporting/ProjectDateRangeControllerTest.php +++ b/tests/Controller/Reporting/ProjectDateRangeControllerTest.php @@ -23,12 +23,12 @@ use App\Timesheet\DateTimeFactory; */ class ProjectDateRangeControllerTest extends ControllerBaseTest { - public function testReportIsSecure() + public function testReportIsSecure(): void { $this->assertUrlIsSecured('/reporting/project_daterange'); } - public function testReport() + public function testReport(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); diff --git a/tests/Controller/Reporting/ProjectDetailsControllerTest.php b/tests/Controller/Reporting/ProjectDetailsControllerTest.php index dd776e1f..bb3f1858 100644 --- a/tests/Controller/Reporting/ProjectDetailsControllerTest.php +++ b/tests/Controller/Reporting/ProjectDetailsControllerTest.php @@ -21,12 +21,12 @@ use App\Tests\DataFixtures\TimesheetFixtures; */ class ProjectDetailsControllerTest extends ControllerBaseTest { - public function testReportIsSecure() + public function testReportIsSecure(): void { $this->assertUrlIsSecured('/reporting/project_details'); } - public function testReport() + public function testReport(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); diff --git a/tests/Controller/Reporting/ProjectInactiveControllerTest.php b/tests/Controller/Reporting/ProjectInactiveControllerTest.php index 430ea2ae..c3cafa8e 100644 --- a/tests/Controller/Reporting/ProjectInactiveControllerTest.php +++ b/tests/Controller/Reporting/ProjectInactiveControllerTest.php @@ -21,12 +21,12 @@ use App\Tests\DataFixtures\TimesheetFixtures; */ class ProjectInactiveControllerTest extends ControllerBaseTest { - public function testReportIsSecure() + public function testReportIsSecure(): void { $this->assertUrlIsSecured('/reporting/project_inactive'); } - public function testReport() + public function testReport(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); diff --git a/tests/Controller/Reporting/ProjectViewControllerTest.php b/tests/Controller/Reporting/ProjectViewControllerTest.php index 01595fdf..786ca888 100644 --- a/tests/Controller/Reporting/ProjectViewControllerTest.php +++ b/tests/Controller/Reporting/ProjectViewControllerTest.php @@ -21,12 +21,12 @@ use App\Tests\DataFixtures\TimesheetFixtures; */ class ProjectViewControllerTest extends ControllerBaseTest { - public function testReportIsSecure() + public function testReportIsSecure(): void { $this->assertUrlIsSecured('/reporting/project_view'); } - public function testReport() + public function testReport(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); diff --git a/tests/Controller/ReportingControllerTest.php b/tests/Controller/ReportingControllerTest.php index b8471623..508168a5 100644 --- a/tests/Controller/ReportingControllerTest.php +++ b/tests/Controller/ReportingControllerTest.php @@ -16,12 +16,12 @@ use App\Entity\User; */ class ReportingControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/reporting'); } - public function testOverviewPage() + public function testOverviewPage(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->request($client, '/reporting/'); @@ -29,7 +29,7 @@ class ReportingControllerTest extends ControllerBaseTest $this->assertCount(11, $nodes); } - public function testOverviewPageAsUser() + public function testOverviewPageAsUser(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->request($client, '/reporting/'); diff --git a/tests/Controller/Security/PasswordResetControllerTest.php b/tests/Controller/Security/PasswordResetControllerTest.php index 9e0f862d..dbdd1c9b 100644 --- a/tests/Controller/Security/PasswordResetControllerTest.php +++ b/tests/Controller/Security/PasswordResetControllerTest.php @@ -24,27 +24,27 @@ class PasswordResetControllerTest extends ControllerBaseTest $this->assertRouteNotFound($client); } - public function testResetRequestWithDeactivatedFeature() + public function testResetRequestWithDeactivatedFeature(): void { $this->testResetActionWithDeactivatedFeature('/resetting/request'); } - public function testSendEmailRequestWithDeactivatedFeature() + public function testSendEmailRequestWithDeactivatedFeature(): void { $this->testResetActionWithDeactivatedFeature('/resetting/send-email', 'POST'); } - public function testCheckEmailWithDeactivatedFeature() + public function testCheckEmailWithDeactivatedFeature(): void { $this->testResetActionWithDeactivatedFeature('/resetting/check-email'); } - public function testResetWithDeactivatedFeature() + public function testResetWithDeactivatedFeature(): void { $this->testResetActionWithDeactivatedFeature('/resetting/reset/1234567890'); } - public function testResetRequestPageIsRendered() + public function testResetRequestPageIsRendered(): void { $client = self::createClient(); diff --git a/tests/Controller/Security/SelfRegistrationControllerTest.php b/tests/Controller/Security/SelfRegistrationControllerTest.php index 06cc49dd..7685ab39 100644 --- a/tests/Controller/Security/SelfRegistrationControllerTest.php +++ b/tests/Controller/Security/SelfRegistrationControllerTest.php @@ -18,7 +18,7 @@ use Symfony\Bundle\FrameworkBundle\KernelBrowser; */ class SelfRegistrationControllerTest extends ControllerBaseTest { - private function testRegisterActionWithDeactivatedFeature(string $route) + private function assertRegisterActionWithDeactivatedFeature(string $route): void { $client = self::createClient(); $this->setSystemConfiguration('user.registration', false); @@ -26,27 +26,27 @@ class SelfRegistrationControllerTest extends ControllerBaseTest $this->assertRouteNotFound($client); } - public function testRegisterWithDeactivatedFeature() + public function testRegisterWithDeactivatedFeature(): void { - $this->testRegisterActionWithDeactivatedFeature('/register/'); + $this->assertRegisterActionWithDeactivatedFeature('/register/'); } - public function testCheckEmailWithDeactivatedFeature() + public function testCheckEmailWithDeactivatedFeature(): void { - $this->testRegisterActionWithDeactivatedFeature('/register/check-email'); + $this->assertRegisterActionWithDeactivatedFeature('/register/check-email'); } - public function testConfirmWithDeactivatedFeature() + public function testConfirmWithDeactivatedFeature(): void { - $this->testRegisterActionWithDeactivatedFeature('/register/confirm/123123'); + $this->assertRegisterActionWithDeactivatedFeature('/register/confirm/123123'); } - public function testConfirmedWithDeactivatedFeature() + public function testConfirmedWithDeactivatedFeature(): void { - $this->testRegisterActionWithDeactivatedFeature('/register/confirmed'); + $this->assertRegisterActionWithDeactivatedFeature('/register/confirmed'); } - public function testRegisterAccountPageIsRendered() + public function testRegisterAccountPageIsRendered(): void { $client = self::createClient(); $this->setSystemConfiguration('user.registration', true); @@ -98,7 +98,7 @@ class SelfRegistrationControllerTest extends ControllerBaseTest return $this->loadUserFromDatabase($username); } - public function testCheckEmailWithoutEmail() + public function testCheckEmailWithoutEmail(): void { $client = self::createClient(); $this->setSystemConfiguration('user.registration', true); @@ -109,7 +109,7 @@ class SelfRegistrationControllerTest extends ControllerBaseTest $this->assertTrue($client->getResponse()->isSuccessful()); } - public function testRegisterAccount() + public function testRegisterAccount(): void { $client = self::createClient(); $this->createUser($client, 'example', 'register@example.com', 'test1234'); @@ -120,7 +120,7 @@ class SelfRegistrationControllerTest extends ControllerBaseTest $this->assertStringContainsString('', $content); } - public function testConfirmWithInvalidToken() + public function testConfirmWithInvalidToken(): void { $client = self::createClient(); $this->setSystemConfiguration('user.registration', true); @@ -131,7 +131,7 @@ class SelfRegistrationControllerTest extends ControllerBaseTest $this->assertTrue($client->getResponse()->isSuccessful()); } - public function testConfirmAccount() + public function testConfirmAccount(): void { $client = self::createClient(); $user = $this->createUser($client, 'example', 'register@example.com', 'test1234'); @@ -151,7 +151,7 @@ class SelfRegistrationControllerTest extends ControllerBaseTest self::assertTrue($user->isEnabled()); } - public function testConfirmedAnonymousRedirectsToLogin() + public function testConfirmedAnonymousRedirectsToLogin(): void { $client = self::createClient(); $this->setSystemConfiguration('user.registration', true); @@ -166,7 +166,7 @@ class SelfRegistrationControllerTest extends ControllerBaseTest /** * @dataProvider getValidationTestData */ - public function testRegisterActionWithValidationProblems(array $formData, array $validationFields) + public function testRegisterActionWithValidationProblems(array $formData, array $validationFields): void { $client = self::createClient(); $this->setSystemConfiguration('user.registration', true); @@ -174,7 +174,7 @@ class SelfRegistrationControllerTest extends ControllerBaseTest $this->assertHasValidationError($client, '/register/', 'form[name=user_registration_form]', $formData, $validationFields); } - public function getValidationTestData() + public function getValidationTestData(): array // @phpstan-ignore-line { return [ [ diff --git a/tests/Controller/SystemConfigurationControllerTest.php b/tests/Controller/SystemConfigurationControllerTest.php index 1184fad1..78c63629 100644 --- a/tests/Controller/SystemConfigurationControllerTest.php +++ b/tests/Controller/SystemConfigurationControllerTest.php @@ -17,12 +17,12 @@ use App\Entity\User; */ class SystemConfigurationControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/admin/system-config/'); } - public function testIsSecureForRole() + public function testIsSecureForRole(): void { $this->assertUrlIsSecuredForRole(User::ROLE_ADMIN, '/admin/system-config/'); } @@ -32,7 +32,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest return static::getContainer()->get(SystemConfiguration::class); } - public function testIndexAction() + public function testIndexAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/'); @@ -55,7 +55,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest } } - public function testSectionAction() + public function testSectionAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/edit/timesheet'); @@ -91,7 +91,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest ]; } - public function testUpdateTimesheetConfig() + public function testUpdateTimesheetConfig(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/'); @@ -129,7 +129,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest $this->assertEquals(99, $configService->find('timesheet.active_entries.hard_limit')); } - public function testUpdateLockdownPeriodConfig() + public function testUpdateLockdownPeriodConfig(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/'); @@ -164,7 +164,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest $this->assertEquals('+ 12 hours', $configService->find('timesheet.rules.lockdown_grace_period')); } - public function testUpdateTimesheetConfigValidation() + public function testUpdateTimesheetConfigValidation(): void { $this->assertFormHasValidationError( User::ROLE_SUPER_ADMIN, @@ -190,7 +190,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest ); } - public function testUpdateCustomerConfig() + public function testUpdateCustomerConfig(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/'); @@ -222,7 +222,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest $this->assertEquals('GBP', $configService->find('defaults.customer.currency')); } - public function testUpdateCustomerConfigWithSingleParam() + public function testUpdateCustomerConfigWithSingleParam(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/edit/customer'); @@ -245,7 +245,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest $this->assertHasFlashSaveSuccess($client); } - public function testUpdateUserConfig() + public function testUpdateUserConfig(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/edit/user'); @@ -277,7 +277,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest $this->assertEquals('ru', $configService->find('defaults.user.language')); } - public function testUpdateCustomerConfigValidation() + public function testUpdateCustomerConfigValidation(): void { $this->assertFormHasValidationError( User::ROLE_SUPER_ADMIN, @@ -300,7 +300,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest ); } - public function testUpdateThemeConfig() + public function testUpdateThemeConfig(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/'); @@ -326,7 +326,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest $this->assertTrue($configService->find('timesheet.markdown_content')); } - public function testUpdateThemeConfigValidation() + public function testUpdateThemeConfigValidation(): void { $this->assertFormHasValidationError( User::ROLE_SUPER_ADMIN, @@ -346,7 +346,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest ); } - public function testUpdateCalendarConfig() + public function testUpdateCalendarConfig(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/system-config/'); @@ -387,7 +387,7 @@ class SystemConfigurationControllerTest extends ControllerBaseTest $this->assertEquals('21:43', $configService->find('calendar.visibleHours.end')); } - public function testUpdateCalendarConfigValidation() + public function testUpdateCalendarConfigValidation(): void { $this->assertFormHasValidationError( User::ROLE_SUPER_ADMIN, diff --git a/tests/Controller/UserControllerTest.php b/tests/Controller/UserControllerTest.php index 75189fd2..902ea9e8 100644 --- a/tests/Controller/UserControllerTest.php +++ b/tests/Controller/UserControllerTest.php @@ -18,17 +18,17 @@ use App\Tests\DataFixtures\TimesheetFixtures; */ class UserControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/admin/user/'); } - public function testIsSecureForRole() + public function testIsSecureForRole(): void { $this->assertUrlIsSecuredForRole(User::ROLE_ADMIN, '/admin/user/'); } - public function testIndexAction() + public function testIndexAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/user/'); @@ -43,7 +43,7 @@ class UserControllerTest extends ControllerBaseTest ]); } - public function testIndexActionWithSearchTermQuery() + public function testIndexActionWithSearchTermQuery(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); @@ -64,19 +64,19 @@ class UserControllerTest extends ControllerBaseTest $this->assertDataTableRowCount($client, 'datatable_user_admin', 1); } - public function testExportIsSecureForRole() + public function testExportIsSecureForRole(): void { $this->assertUrlIsSecuredForRole(User::ROLE_ADMIN, '/admin/user/export'); } - public function testExportAction() + public function testExportAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); $this->assertAccessIsGranted($client, '/admin/user/export'); $this->assertExcelExportResponse($client, 'kimai-users_'); } - public function testExportActionWithSearchTermQuery() + public function testExportActionWithSearchTermQuery(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); @@ -96,7 +96,7 @@ class UserControllerTest extends ControllerBaseTest $this->assertExcelExportResponse($client, 'kimai-users_'); } - public function testCreateAction() + public function testCreateAction(): void { $username = '亚历山德拉' . uniqid(); $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); @@ -119,7 +119,7 @@ class UserControllerTest extends ControllerBaseTest $this->assertEquals($username, $form->get('user_edit[alias]')->getValue()); } - public function testDeleteAction() + public function testDeleteAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); @@ -138,7 +138,7 @@ class UserControllerTest extends ControllerBaseTest $this->assertFalse($client->getResponse()->isSuccessful()); } - public function testDeleteActionWithTimesheetEntries() + public function testDeleteActionWithTimesheetEntries(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); @@ -172,7 +172,7 @@ class UserControllerTest extends ControllerBaseTest $this->assertFalse($client->getResponse()->isSuccessful()); } - public function testDeleteActionWithUserReplacementAndTimesheetEntries() + public function testDeleteActionWithUserReplacementAndTimesheetEntries(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN); @@ -222,7 +222,7 @@ class UserControllerTest extends ControllerBaseTest /** * @dataProvider getValidationTestData */ - public function testValidationForCreateAction(array $formData, array $validationFields) + public function testValidationForCreateAction(array $formData, array $validationFields): void { $this->assertFormHasValidationError( User::ROLE_SUPER_ADMIN, diff --git a/tests/Controller/WidgetControllerTest.php b/tests/Controller/WidgetControllerTest.php index 47a80718..f2c6b37f 100644 --- a/tests/Controller/WidgetControllerTest.php +++ b/tests/Controller/WidgetControllerTest.php @@ -16,12 +16,12 @@ use App\Entity\User; */ class WidgetControllerTest extends ControllerBaseTest { - public function testIsSecure() + public function testIsSecure(): void { $this->assertUrlIsSecured('/widgets/working-time/2020/1'); } - public function testWorkingtimechartAction() + public function testWorkingtimechartAction(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->assertAccessIsGranted($client, '/widgets/working-time/2020/1'); diff --git a/tests/Controller/WizardControllerTest.php b/tests/Controller/WizardControllerTest.php index 8551014a..dba3d790 100644 --- a/tests/Controller/WizardControllerTest.php +++ b/tests/Controller/WizardControllerTest.php @@ -16,7 +16,7 @@ use App\Entity\User; */ class WizardControllerTest extends ControllerBaseTest { - public function testUnknownWizard() + public function testUnknownWizard(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); @@ -24,21 +24,21 @@ class WizardControllerTest extends ControllerBaseTest $this->assertRouteNotFound($client); } - public function testIntroWizard() + public function testIntroWizard(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->assertAccessIsGranted($client, '/wizard/intro'); } - public function testProfileWizard() + public function testProfileWizard(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); $this->assertAccessIsGranted($client, '/wizard/profile'); } - public function testDoneWizard() + public function testDoneWizard(): void { $client = $this->getClientForAuthenticatedUser(User::ROLE_USER); diff --git a/tests/Customer/CustomerServiceTest.php b/tests/Customer/CustomerServiceTest.php index 871e1f1e..730702c2 100644 --- a/tests/Customer/CustomerServiceTest.php +++ b/tests/Customer/CustomerServiceTest.php @@ -69,7 +69,7 @@ class CustomerServiceTest extends TestCase return new CustomerService($repository, $configuration, $validator, $dispatcher); } - public function testCannotSavePersistedCustomerAsNew() + public function testCannotSavePersistedCustomerAsNew(): void { $Customer = $this->createMock(Customer::class); $Customer->expects($this->once())->method('getId')->willReturn(1); @@ -82,7 +82,7 @@ class CustomerServiceTest extends TestCase $sut->saveNewCustomer($Customer); } - public function testSaveNewCustomerHasValidationError() + public function testSaveNewCustomerHasValidationError(): void { $constraints = new ConstraintViolationList(); $constraints->add(new ConstraintViolation('toooo many tests', 'abc.def', [], '$root', 'begin', 4, null, null, null, '$cause')); @@ -98,7 +98,7 @@ class CustomerServiceTest extends TestCase $sut->saveNewCustomer(new Customer('foo')); } - public function testUpdateDispatchesEvents() + public function testUpdateDispatchesEvents(): void { $Customer = $this->createMock(Customer::class); $Customer->method('getId')->willReturn(1); @@ -121,7 +121,7 @@ class CustomerServiceTest extends TestCase $sut->updateCustomer($Customer); } - public function testCreateNewCustomerDispatchesEvents() + public function testCreateNewCustomerDispatchesEvents(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $dispatcher->expects($this->exactly(2))->method('dispatch')->willReturnCallback(function ($event) { @@ -146,7 +146,7 @@ class CustomerServiceTest extends TestCase self::assertEquals('RUB', $customer->getCurrency()); } - public function testSaveNewCustomerDispatchesEvents() + public function testSaveNewCustomerDispatchesEvents(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $dispatcher->expects($this->exactly(2))->method('dispatch')->willReturnCallback(function ($event) { diff --git a/tests/DependencyInjection/ConfigurationTest.php b/tests/DependencyInjection/ConfigurationTest.php index 9d0614d1..19093a89 100644 --- a/tests/DependencyInjection/ConfigurationTest.php +++ b/tests/DependencyInjection/ConfigurationTest.php @@ -26,7 +26,7 @@ class ConfigurationTest extends TestCase ]; } - protected function assertConfig($inputConfig, $expectedConfig) + public function assertConfig($inputConfig, $expectedConfig): void { $finalizedConfig = $this->getCompiledConfig($inputConfig); @@ -43,7 +43,7 @@ class ConfigurationTest extends TestCase return $node->finalize($normalizedConfig); } - public function testValidateDataDir() + public function testValidateDataDir(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.data_dir": Data directory does not exist'); @@ -51,7 +51,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($this->getMinConfig('sdfsdfsdfds'), []); } - public function testValidateLdapConfigUserBaseDn() + public function testValidateLdapConfigUserBaseDn(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap": The "ldap.user.baseDn" config must be set if LDAP is activated.'); @@ -67,7 +67,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateLdapConfig() + public function testValidateLdapConfig(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap.connection": The ldap.connection.useSsl and ldap.connection.useStartTls options are mutually exclusive.'); @@ -83,7 +83,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateLdapFilterIncludingReplacer() + public function testValidateLdapFilterIncludingReplacer(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap.user.filter": The ldap.user.filter must be enclosed by a matching number of parentheses "()" and must NOT contain a "%s" replacer'); @@ -98,7 +98,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateLdapFilterMissingStartingParenthesis() + public function testValidateLdapFilterMissingStartingParenthesis(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap.user.filter": The ldap.user.filter must be enclosed by a matching number of parentheses "()" and must NOT contain a "%s" replacer'); @@ -113,7 +113,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateCalendarDragDropMaxEntries() + public function testValidateCalendarDragDropMaxEntries(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.calendar.dragdrop_amount": The dragdrop_amount must be between 0 and 20'); @@ -126,7 +126,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateLdapFilterInvalidParenthesisCounter() + public function testValidateLdapFilterInvalidParenthesisCounter(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap.user.filter": The ldap.user.filter must be enclosed by a matching number of parentheses "()" and must NOT contain a "%s" replacer'); @@ -141,7 +141,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateLdapAccountFilterFormatMissingUserAttributeReplacer() + public function testValidateLdapAccountFilterFormatMissingUserAttributeReplacer(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap.connection.accountFilterFormat": The accountFilterFormat must be enclosed by a matching number of parentheses "()" and contain one "%s" replacer for the username'); @@ -156,7 +156,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateLdapAccountFilterFormatMissingStartingParenthesis() + public function testValidateLdapAccountFilterFormatMissingStartingParenthesis(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap.connection.accountFilterFormat": The accountFilterFormat must be enclosed by a matching number of parentheses "()" and contain one "%s" replacer for the username'); @@ -171,7 +171,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateLdapAccountFilterFormatInvalidParenthesisCounter() + public function testValidateLdapAccountFilterFormatInvalidParenthesisCounter(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.ldap.connection.accountFilterFormat": The accountFilterFormat must be enclosed by a matching number of parentheses "()" and contain one "%s" replacer for the username'); @@ -186,7 +186,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateSamlIsMissingMappingForEmail() + public function testValidateSamlIsMissingMappingForEmail(): void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "kimai.saml": You need to configure a SAML mapping for the email attribute.'); @@ -200,7 +200,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, []); } - public function testValidateSamlDoesNotTriggerOnDeactivatedSaml() + public function testValidateSamlDoesNotTriggerOnDeactivatedSaml(): void { $finalizedConfig = $this->getCompiledConfig($this->getMinConfig()); $config = $this->getMinConfig(); @@ -212,7 +212,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, $finalizedConfig); } - public function testValidateSamlDoesNotTriggerWhenEmailMappingExists() + public function testValidateSamlDoesNotTriggerWhenEmailMappingExists(): void { $config = $this->getMinConfig(); $config['saml'] = [ @@ -226,7 +226,7 @@ class ConfigurationTest extends TestCase $this->assertConfig($config, $finalizedConfig); } - public function testDefaultLdapSettings() + public function testDefaultLdapSettings(): void { $finalizedConfig = $this->getCompiledConfig($this->getMinConfig()); $expected = [ @@ -257,7 +257,7 @@ class ConfigurationTest extends TestCase self::assertEquals($expected, $finalizedConfig['ldap']); } - public function testFullDefaultConfig() + public function testFullDefaultConfig(): void { $fullDefaultConfig = [ 'data_dir' => '/tmp/', diff --git a/tests/Doctrine/TimesheetSubscriberTest.php b/tests/Doctrine/TimesheetSubscriberTest.php index 0bd50ee4..ea641028 100644 --- a/tests/Doctrine/TimesheetSubscriberTest.php +++ b/tests/Doctrine/TimesheetSubscriberTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $sut = new TimesheetSubscriber([]); $events = $sut->getSubscribedEvents(); diff --git a/tests/Entity/AbstractCommentEntityTest.php b/tests/Entity/AbstractCommentEntityTest.php index 3cc7d0f5..62dca412 100644 --- a/tests/Entity/AbstractCommentEntityTest.php +++ b/tests/Entity/AbstractCommentEntityTest.php @@ -17,7 +17,7 @@ abstract class AbstractCommentEntityTest extends TestCase { abstract protected function getEntity(): CommentInterface; - public function testDefaultValues() + public function testDefaultValues(): void { $sut = $this->getEntity(); @@ -29,7 +29,7 @@ abstract class AbstractCommentEntityTest extends TestCase self::assertFalse($sut->isPinned()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = $this->getEntity(); diff --git a/tests/Entity/AbstractEntityTest.php b/tests/Entity/AbstractEntityTest.php index f53f243f..f07760d4 100644 --- a/tests/Entity/AbstractEntityTest.php +++ b/tests/Entity/AbstractEntityTest.php @@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase; abstract class AbstractEntityTest extends TestCase { - protected function assertBudget(EntityWithBudget $entityWithBudget) + public function assertBudget(EntityWithBudget $entityWithBudget): void { $this->assertEquals(0.0, $entityWithBudget->getBudget()); $this->assertEquals(0, $entityWithBudget->getTimeBudget()); diff --git a/tests/Entity/AbstractMetaEntityTest.php b/tests/Entity/AbstractMetaEntityTest.php index c801ec3d..aafa1797 100644 --- a/tests/Entity/AbstractMetaEntityTest.php +++ b/tests/Entity/AbstractMetaEntityTest.php @@ -23,7 +23,7 @@ abstract class AbstractMetaEntityTest extends TestCase abstract protected function getMetaEntity(): MetaTableTypeInterface; - public function testDefaultValues() + public function testDefaultValues(): void { $sut = $this->getMetaEntity(); self::assertNull($sut->getLabel()); @@ -40,7 +40,7 @@ abstract class AbstractMetaEntityTest extends TestCase self::assertEquals(0, $sut->getOrder()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = $this->getMetaEntity(); self::assertInstanceOf(MetaTableTypeInterface::class, $sut->setName('foo-bar')); @@ -85,7 +85,7 @@ abstract class AbstractMetaEntityTest extends TestCase self::assertSame($entity, $sut->getEntity()); } - public function testMerge() + public function testMerge(): void { $entity1 = $this->getEntity(); $entity2 = $this->getEntity(); diff --git a/tests/Entity/ActivityMetaTest.php b/tests/Entity/ActivityMetaTest.php index 0c711bb1..d34cd7fc 100644 --- a/tests/Entity/ActivityMetaTest.php +++ b/tests/Entity/ActivityMetaTest.php @@ -30,7 +30,7 @@ class ActivityMetaTest extends AbstractMetaEntityTest return new ActivityMeta(); } - public function testSetEntityThrowsException() + public function testSetEntityThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Expected instanceof Activity, received "App\Entity\Timesheet"'); diff --git a/tests/Entity/ActivityRateTest.php b/tests/Entity/ActivityRateTest.php index 8023cebd..a74baafd 100644 --- a/tests/Entity/ActivityRateTest.php +++ b/tests/Entity/ActivityRateTest.php @@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase; */ class ActivityRateTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new ActivityRate(); self::assertNull($sut->getId()); @@ -32,7 +32,7 @@ class ActivityRateTest extends TestCase self::assertFalse($sut->isFixed()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new ActivityRate(); diff --git a/tests/Entity/ActivityTest.php b/tests/Entity/ActivityTest.php index 966c6410..3eb628fc 100644 --- a/tests/Entity/ActivityTest.php +++ b/tests/Entity/ActivityTest.php @@ -23,7 +23,7 @@ use Doctrine\Common\Collections\Collection; */ class ActivityTest extends AbstractEntityTest { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Activity(); $this->assertNull($sut->getId()); @@ -42,12 +42,12 @@ class ActivityTest extends AbstractEntityTest $this->assertInstanceOf(Collection::class, $sut->getTeams()); } - public function testBudgets() + public function testBudgets(): void { $this->assertBudget(new Activity()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new Activity(); $this->assertInstanceOf(Activity::class, $sut->setName('foo-bar')); @@ -82,7 +82,7 @@ class ActivityTest extends AbstractEntityTest $this->assertFalse($sut->isGlobal()); } - public function testMetaFields() + public function testMetaFields(): void { $sut = new Activity(); $meta = new ActivityMeta(); @@ -110,7 +110,7 @@ class ActivityTest extends AbstractEntityTest self::assertCount(2, $sut->getVisibleMetaFields()); } - public function testTeams() + public function testTeams(): void { $sut = new Activity(); $team = new Team('foo'); @@ -133,7 +133,7 @@ class ActivityTest extends AbstractEntityTest self::assertCount(0, $team->getActivities()); } - public function testExportAnnotations() + public function testExportAnnotations(): void { $sut = new AnnotationExtractor(); @@ -169,7 +169,7 @@ class ActivityTest extends AbstractEntityTest } } - public function testClone() + public function testClone(): void { $sut = new Activity(); $sut->setName('activity1111'); diff --git a/tests/Entity/BookmarkTest.php b/tests/Entity/BookmarkTest.php index 2012eaf3..ba2c70fd 100644 --- a/tests/Entity/BookmarkTest.php +++ b/tests/Entity/BookmarkTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class BookmarkTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Bookmark(); $this->assertNull($sut->getId()); @@ -29,7 +29,7 @@ class BookmarkTest extends TestCase $this->assertNull($sut->getUser()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new Bookmark(); $sut->setName('foo-bar'); diff --git a/tests/Entity/ConfigurationTest.php b/tests/Entity/ConfigurationTest.php index 8009279a..2721571f 100644 --- a/tests/Entity/ConfigurationTest.php +++ b/tests/Entity/ConfigurationTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class ConfigurationTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Configuration(); $this->assertNull($sut->getId()); @@ -25,7 +25,7 @@ class ConfigurationTest extends TestCase $this->assertNull($sut->getValue()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new Configuration(); $this->assertInstanceOf(Configuration::class, $sut->setName('foo-bar')); diff --git a/tests/Entity/CustomerCommentTest.php b/tests/Entity/CustomerCommentTest.php index 9dc82539..f799c73f 100644 --- a/tests/Entity/CustomerCommentTest.php +++ b/tests/Entity/CustomerCommentTest.php @@ -23,7 +23,7 @@ class CustomerCommentTest extends AbstractCommentEntityTest return new CustomerComment(new Customer('foo')); } - public function testEntitySpecificMethods() + public function testEntitySpecificMethods(): void { $sut = $this->getEntity(); self::assertNotNull($sut->getCustomer()); diff --git a/tests/Entity/CustomerMetaTest.php b/tests/Entity/CustomerMetaTest.php index fffa93e0..5e412606 100644 --- a/tests/Entity/CustomerMetaTest.php +++ b/tests/Entity/CustomerMetaTest.php @@ -30,7 +30,7 @@ class CustomerMetaTest extends AbstractMetaEntityTest return new CustomerMeta(); } - public function testSetEntityThrowsException() + public function testSetEntityThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Expected instanceof Customer, received "App\Entity\Activity"'); diff --git a/tests/Entity/CustomerRateTest.php b/tests/Entity/CustomerRateTest.php index b0600df5..3642ff58 100644 --- a/tests/Entity/CustomerRateTest.php +++ b/tests/Entity/CustomerRateTest.php @@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase; */ class CustomerRateTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new CustomerRate(); self::assertNull($sut->getId()); @@ -32,7 +32,7 @@ class CustomerRateTest extends TestCase self::assertFalse($sut->isFixed()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new CustomerRate(); diff --git a/tests/Entity/CustomerTest.php b/tests/Entity/CustomerTest.php index 8d836fbe..bc25ad9d 100644 --- a/tests/Entity/CustomerTest.php +++ b/tests/Entity/CustomerTest.php @@ -22,7 +22,7 @@ use Doctrine\Common\Collections\Collection; */ class CustomerTest extends AbstractEntityTest { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Customer('foo'); self::assertNull($sut->getId()); @@ -54,12 +54,12 @@ class CustomerTest extends AbstractEntityTest self::assertEquals(0, $sut->getTeams()->count()); } - public function testBudgets() + public function testBudgets(): void { $this->assertBudget(new Customer('foo')); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new Customer('foo-bar'); self::assertEquals('foo-bar', $sut->getName()); @@ -119,7 +119,7 @@ class CustomerTest extends AbstractEntityTest self::assertNull($sut->getCurrency()); } - public function testMetaFields() + public function testMetaFields(): void { $sut = new Customer('foo'); $meta = new CustomerMeta(); @@ -147,7 +147,7 @@ class CustomerTest extends AbstractEntityTest self::assertCount(2, $sut->getVisibleMetaFields()); } - public function testTeams() + public function testTeams(): void { $sut = new Customer('foo'); $team = new Team('foo'); @@ -171,7 +171,7 @@ class CustomerTest extends AbstractEntityTest self::assertCount(0, $team->getCustomers()); } - public function testExportAnnotations() + public function testExportAnnotations(): void { $sut = new AnnotationExtractor(); @@ -219,7 +219,7 @@ class CustomerTest extends AbstractEntityTest } } - public function testClone() + public function testClone(): void { $sut = new Customer('mycustomer'); $sut->setVatId('DE-0123456789'); diff --git a/tests/Entity/EntityValidationTestTrait.php b/tests/Entity/EntityValidationTestTrait.php index a31ccb7b..060c1f62 100644 --- a/tests/Entity/EntityValidationTestTrait.php +++ b/tests/Entity/EntityValidationTestTrait.php @@ -21,7 +21,7 @@ trait EntityValidationTestTrait * @param object $entity * @param array|string $fieldNames */ - protected function assertHasViolationForField(object $entity, $fieldNames, $groups = null) + public function assertHasViolationForField(object $entity, $fieldNames, $groups = null): void { self::bootKernel(); /** @var ValidatorInterface $validator */ @@ -56,7 +56,7 @@ trait EntityValidationTestTrait $this->assertEquals($expected, $countViolations, sprintf('Expected %s violations, found %s in %s.', $expected, $actual, implode(', ', array_keys($violatedFields)))); } - protected function assertHasNoViolations($entity, $groups = null) + public function assertHasNoViolations($entity, $groups = null): void { self::bootKernel(); /** @var ValidatorInterface $validator */ diff --git a/tests/Entity/InvoiceMetaTest.php b/tests/Entity/InvoiceMetaTest.php index 3dcdf75c..c9c4f5c4 100644 --- a/tests/Entity/InvoiceMetaTest.php +++ b/tests/Entity/InvoiceMetaTest.php @@ -30,7 +30,7 @@ class InvoiceMetaTest extends AbstractMetaEntityTest return new InvoiceMeta(); } - public function testSetEntityThrowsException() + public function testSetEntityThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Expected instanceof Invoice, received "App\Entity\Customer"'); diff --git a/tests/Entity/InvoiceTemplateTest.php b/tests/Entity/InvoiceTemplateTest.php index b59c1211..e714601e 100644 --- a/tests/Entity/InvoiceTemplateTest.php +++ b/tests/Entity/InvoiceTemplateTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class InvoiceTemplateTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new InvoiceTemplate(); @@ -38,7 +38,7 @@ class InvoiceTemplateTest extends TestCase self::assertTrue($sut->isDecimalDuration()); } - public function testSetNullForOptionalValues() + public function testSetNullForOptionalValues(): void { $sut = new InvoiceTemplate(); @@ -49,7 +49,7 @@ class InvoiceTemplateTest extends TestCase self::assertInstanceOf(InvoiceTemplate::class, $sut->setPaymentTerms(null)); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new InvoiceTemplate(); @@ -83,7 +83,7 @@ class InvoiceTemplateTest extends TestCase self::assertEquals($sut, clone $sut); } - public function testToString() + public function testToString(): void { $sut = new InvoiceTemplate(); diff --git a/tests/Entity/InvoiceTest.php b/tests/Entity/InvoiceTest.php index 012790af..a78040d8 100644 --- a/tests/Entity/InvoiceTest.php +++ b/tests/Entity/InvoiceTest.php @@ -35,7 +35,7 @@ use PHPUnit\Framework\TestCase; */ class InvoiceTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Invoice(); self::assertNull($sut->getCreatedAt()); @@ -58,7 +58,7 @@ class InvoiceTest extends TestCase self::assertNull($sut->getComment()); } - public function testSetInvalidStatus() + public function testSetInvalidStatus(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unknown invoice status'); @@ -67,7 +67,7 @@ class InvoiceTest extends TestCase $sut->setStatus('foo'); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $date = new \DateTime('-2 months'); $sut = new Invoice(); @@ -219,7 +219,7 @@ class InvoiceTest extends TestCase return new DateNumberGenerator($repository); } - public function testClone() + public function testClone(): void { $sut = new Invoice(); $sut->setComment('foo kajsdhgf aksjdhfg'); @@ -242,7 +242,7 @@ class InvoiceTest extends TestCase self::assertEquals('foo kajsdhgf aksjdhfg', $clone->getComment()); } - public function testMetaFields() + public function testMetaFields(): void { $sut = new Invoice(); diff --git a/tests/Entity/ProjectCommentTest.php b/tests/Entity/ProjectCommentTest.php index 56a4d7eb..a346c532 100644 --- a/tests/Entity/ProjectCommentTest.php +++ b/tests/Entity/ProjectCommentTest.php @@ -23,7 +23,7 @@ class ProjectCommentTest extends AbstractCommentEntityTest return new ProjectComment(new Project()); } - public function testEntitySpecificMethods() + public function testEntitySpecificMethods(): void { $sut = $this->getEntity(); self::assertNotNull($sut->getProject()); diff --git a/tests/Entity/ProjectMetaTest.php b/tests/Entity/ProjectMetaTest.php index 9af9c6b2..5a6c5ad5 100644 --- a/tests/Entity/ProjectMetaTest.php +++ b/tests/Entity/ProjectMetaTest.php @@ -30,7 +30,7 @@ class ProjectMetaTest extends AbstractMetaEntityTest return new ProjectMeta(); } - public function testSetEntityThrowsException() + public function testSetEntityThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Expected instanceof Project, received "App\Entity\Customer"'); diff --git a/tests/Entity/ProjectRateTest.php b/tests/Entity/ProjectRateTest.php index dba51288..6eb95424 100644 --- a/tests/Entity/ProjectRateTest.php +++ b/tests/Entity/ProjectRateTest.php @@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectRateTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new ProjectRate(); self::assertNull($sut->getId()); @@ -32,7 +32,7 @@ class ProjectRateTest extends TestCase self::assertFalse($sut->isFixed()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new ProjectRate(); diff --git a/tests/Entity/ProjectTest.php b/tests/Entity/ProjectTest.php index 404dbedc..91fe275e 100644 --- a/tests/Entity/ProjectTest.php +++ b/tests/Entity/ProjectTest.php @@ -23,7 +23,7 @@ use Doctrine\Common\Collections\Collection; */ class ProjectTest extends AbstractEntityTest { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Project(); self::assertNull($sut->getId()); @@ -48,12 +48,12 @@ class ProjectTest extends AbstractEntityTest self::assertTrue($sut->isVisibleAtDate(new \DateTime())); } - public function testBudgets() + public function testBudgets(): void { $this->assertBudget(new Project()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new Project(); @@ -110,7 +110,7 @@ class ProjectTest extends AbstractEntityTest self::assertFalse($sut->isGlobalActivities()); } - public function testMetaFields() + public function testMetaFields(): void { $sut = new Project(); $meta = new ProjectMeta(); @@ -138,7 +138,7 @@ class ProjectTest extends AbstractEntityTest self::assertCount(2, $sut->getVisibleMetaFields()); } - public function testTeams() + public function testTeams(): void { $sut = new Project(); $team = new Team('foo'); @@ -161,7 +161,7 @@ class ProjectTest extends AbstractEntityTest self::assertCount(0, $team->getProjects()); } - public function testExportAnnotations() + public function testExportAnnotations(): void { $sut = new AnnotationExtractor(); @@ -201,7 +201,7 @@ class ProjectTest extends AbstractEntityTest } } - public function testClone() + public function testClone(): void { $customer = new Customer('prj-customer'); $customer->setVatId('DE-0123456789'); @@ -241,7 +241,7 @@ class ProjectTest extends AbstractEntityTest self::assertEquals('prj-customer', $clone->getCustomer()->getName()); } - public function testIsVisibleAtDateTime() + public function testIsVisibleAtDateTime(): void { $now = new \DateTime(); diff --git a/tests/Entity/RolePermissionTest.php b/tests/Entity/RolePermissionTest.php index 1499c4a2..ff8466ab 100644 --- a/tests/Entity/RolePermissionTest.php +++ b/tests/Entity/RolePermissionTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class RolePermissionTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new RolePermission(); self::assertNull($sut->getId()); @@ -27,7 +27,7 @@ class RolePermissionTest extends TestCase self::assertFalse($sut->isAllowed()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new RolePermission(); diff --git a/tests/Entity/TagTest.php b/tests/Entity/TagTest.php index 504d10a0..9cd3c24a 100644 --- a/tests/Entity/TagTest.php +++ b/tests/Entity/TagTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class TagTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Tag(); $this->assertNull($sut->getId()); @@ -25,7 +25,7 @@ class TagTest extends TestCase $this->assertNull($sut->getColor()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new Tag(); diff --git a/tests/Entity/TeamTest.php b/tests/Entity/TeamTest.php index 8d5b67b6..c764b227 100644 --- a/tests/Entity/TeamTest.php +++ b/tests/Entity/TeamTest.php @@ -24,7 +24,7 @@ use PHPUnit\Framework\TestCase; */ class TeamTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Team('foo'); self::assertNull($sut->getId()); @@ -40,7 +40,7 @@ class TeamTest extends TestCase self::assertEquals(0, $sut->getActivities()->count()); } - public function testColor() + public function testColor(): void { $sut = new Team('foo'); self::assertNull($sut->getColor()); @@ -55,7 +55,7 @@ class TeamTest extends TestCase self::assertTrue($sut->hasColor()); } - public function testTeamMemberships() + public function testTeamMemberships(): void { $user = new User(); $user2 = new User(); @@ -115,7 +115,7 @@ class TeamTest extends TestCase self::assertCount(2, $sut->getMembers()); } - public function testTeamMembershipsException() + public function testTeamMembershipsException(): void { $this->expectException(\InvalidArgumentException::class); $sut = new Team('foo'); @@ -124,7 +124,7 @@ class TeamTest extends TestCase $sut->addMember($member); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new Team('foo-bar'); self::assertEquals('foo-bar', $sut->getName()); @@ -156,7 +156,7 @@ class TeamTest extends TestCase self::assertCount(2, $sut->getTeamleads()); } - public function testCustomer() + public function testCustomer(): void { $customer = new Customer('foo'); self::assertEmpty($customer->getTeams()); @@ -175,7 +175,7 @@ class TeamTest extends TestCase self::assertEquals(0, $sut->getCustomers()->count()); } - public function testProject() + public function testProject(): void { $project = new Project(); $project->setName('foo'); @@ -195,7 +195,7 @@ class TeamTest extends TestCase self::assertEquals(0, $sut->getProjects()->count()); } - public function testActivities() + public function testActivities(): void { $activity = new Activity(); $activity->setName('foo'); @@ -215,7 +215,7 @@ class TeamTest extends TestCase self::assertEquals(0, $sut->getActivities()->count()); } - public function testUsers() + public function testUsers(): void { $user = new User(); $user->setAlias('foo'); @@ -241,7 +241,7 @@ class TeamTest extends TestCase self::assertCount(1, $sut->getUsers()); } - public function testClone() + public function testClone(): void { $c = new Customer('Foo'); $p = new Project(); diff --git a/tests/Entity/TimesheetMetaTest.php b/tests/Entity/TimesheetMetaTest.php index 731beec2..f70125d1 100644 --- a/tests/Entity/TimesheetMetaTest.php +++ b/tests/Entity/TimesheetMetaTest.php @@ -30,7 +30,7 @@ class TimesheetMetaTest extends AbstractMetaEntityTest return new TimesheetMeta(); } - public function testSetEntityThrowsException() + public function testSetEntityThrowsException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Expected instanceof Timesheet, received "App\Entity\Project"'); diff --git a/tests/Entity/TimesheetValidationTest.php b/tests/Entity/TimesheetValidationTest.php index ef19d2e9..49d5f10d 100644 --- a/tests/Entity/TimesheetValidationTest.php +++ b/tests/Entity/TimesheetValidationTest.php @@ -44,7 +44,7 @@ class TimesheetValidationTest extends KernelTestCase return $entity; } - public function testValidationNeedsActivity() + public function testValidationNeedsActivity(): void { $project = new Project(); $project->setCustomer(new Customer('foo')); @@ -57,7 +57,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'activity'); } - public function testValidationNeedsProject() + public function testValidationNeedsProject(): void { $entity = new Timesheet(); $entity->setUser(new User()); @@ -67,7 +67,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'project'); } - public function testValidationProjectMismatch() + public function testValidationProjectMismatch(): void { $customer = new Customer('foo'); $project = (new Project())->setName('foo')->setCustomer($customer); @@ -83,7 +83,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'project'); } - public function testValidationCustomerInvisible() + public function testValidationCustomerInvisible(): void { $customer = new Customer('foo'); $customer->setVisible(false); @@ -124,7 +124,7 @@ class TimesheetValidationTest extends KernelTestCase return $entity; } - public function testValidationCustomerInvisibleDoesNotTriggerOnStoppedEntities() + public function testValidationCustomerInvisibleDoesNotTriggerOnStoppedEntities(): void { $customer = new Customer('foo'); $customer->setVisible(false); @@ -140,7 +140,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasNoViolations($entity); } - public function testValidationCustomerInvisibleDoesTriggerOnNewEntities() + public function testValidationCustomerInvisibleDoesTriggerOnNewEntities(): void { $customer = new Customer('foo'); $customer->setVisible(false); @@ -156,7 +156,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'customer'); } - public function testValidationProjectInvisible() + public function testValidationProjectInvisible(): void { $customer = new Customer('foo'); $project = (new Project())->setName('foo')->setCustomer($customer)->setVisible(false); @@ -172,7 +172,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'project'); } - public function testValidationProjectInvisibleDoesNotTriggerOnStoppedEntities() + public function testValidationProjectInvisibleDoesNotTriggerOnStoppedEntities(): void { $customer = new Customer('foo'); $project = (new Project())->setName('foo')->setCustomer($customer)->setVisible(false); @@ -183,7 +183,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasNoViolations($entity); } - public function testValidationProjectInvisibleDoesTriggerOnNewEntities() + public function testValidationProjectInvisibleDoesTriggerOnNewEntities(): void { $customer = new Customer('foo'); $project = (new Project())->setName('foo')->setCustomer($customer)->setVisible(false); @@ -194,7 +194,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'project'); } - public function testValidationActivityInvisible() + public function testValidationActivityInvisible(): void { $customer = new Customer('foo'); $project = (new Project())->setName('foo')->setCustomer($customer); @@ -210,7 +210,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'activity'); } - public function testValidationActivityInvisibleDoesNotTriggerOnStoppedEntities() + public function testValidationActivityInvisibleDoesNotTriggerOnStoppedEntities(): void { $customer = new Customer('foo'); $project = new Project(); @@ -226,7 +226,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasNoViolations($entity); } - public function testValidationActivityInvisibleDoesTriggerOnNewEntities() + public function testValidationActivityInvisibleDoesTriggerOnNewEntities(): void { $customer = new Customer('foo'); $project = new Project(); @@ -242,7 +242,7 @@ class TimesheetValidationTest extends KernelTestCase $this->assertHasViolationForField($entity, 'activity'); } - public function testValidationEndNotEarlierThanBegin() + public function testValidationEndNotEarlierThanBegin(): void { $entity = $this->getEntity(); $begin = new \DateTime(); diff --git a/tests/Entity/UserPreferenceTest.php b/tests/Entity/UserPreferenceTest.php index ae881b36..0a7e3a02 100644 --- a/tests/Entity/UserPreferenceTest.php +++ b/tests/Entity/UserPreferenceTest.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType; */ class UserPreferenceTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new UserPreference('foo'); self::assertTrue($sut->isEnabled()); @@ -38,7 +38,7 @@ class UserPreferenceTest extends TestCase self::assertNull($sut->getUser()); } - public function testGetValueChangesReturnTypeOnOtherType() + public function testGetValueChangesReturnTypeOnOtherType(): void { $sut = new UserPreference('foo'); $sut->setValue('1'); @@ -52,7 +52,7 @@ class UserPreferenceTest extends TestCase self::assertFalse($sut->getValue()); } - public function testGetLabelWithLabelOption() + public function testGetLabelWithLabelOption(): void { $sut = new UserPreference('foo'); self::assertEquals('foo', $sut->getLabel()); diff --git a/tests/Entity/UserTest.php b/tests/Entity/UserTest.php index 9a83d6f7..c55e93e6 100644 --- a/tests/Entity/UserTest.php +++ b/tests/Entity/UserTest.php @@ -116,7 +116,7 @@ class UserTest extends TestCase $user->setWorkHoursFriday(7600); $user->setWorkHoursSaturday(7700); $user->setWorkHoursSunday(7800); - $user->setHolidaysPerYear(10); + $user->setHolidaysPerYear(10.7); self::assertTrue($user->hasWorkHourConfiguration()); self::assertEquals(7200, $user->getWorkHoursMonday()); @@ -126,7 +126,7 @@ class UserTest extends TestCase self::assertEquals(7600, $user->getWorkHoursFriday()); self::assertEquals(7700, $user->getWorkHoursSaturday()); self::assertEquals(7800, $user->getWorkHoursSunday()); - self::assertEquals(10, $user->getHolidaysPerYear()); + self::assertEquals(10.5, $user->getHolidaysPerYear()); self::assertEquals(7200, $user->getWorkHoursForDay($monday)); self::assertEquals(7300, $user->getWorkHoursForDay($tuesday)); diff --git a/tests/Event/AbstractActivityEventTest.php b/tests/Event/AbstractActivityEventTest.php index 9af6fc56..75a36925 100644 --- a/tests/Event/AbstractActivityEventTest.php +++ b/tests/Event/AbstractActivityEventTest.php @@ -18,7 +18,7 @@ abstract class AbstractActivityEventTest extends TestCase { abstract protected function createActivityEvent(Activity $activity): AbstractActivityEvent; - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $activity = new Activity(); $sut = $this->createActivityEvent($activity); diff --git a/tests/Event/AbstractCustomerEventTest.php b/tests/Event/AbstractCustomerEventTest.php index e3ae9c9a..e025360c 100644 --- a/tests/Event/AbstractCustomerEventTest.php +++ b/tests/Event/AbstractCustomerEventTest.php @@ -18,7 +18,7 @@ abstract class AbstractCustomerEventTest extends TestCase { abstract protected function createCustomerEvent(Customer $customer): AbstractCustomerEvent; - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $customer = new Customer('foo'); $sut = $this->createCustomerEvent($customer); diff --git a/tests/Event/AbstractProjectEventTest.php b/tests/Event/AbstractProjectEventTest.php index f6982cc5..64bac9f4 100644 --- a/tests/Event/AbstractProjectEventTest.php +++ b/tests/Event/AbstractProjectEventTest.php @@ -18,7 +18,7 @@ abstract class AbstractProjectEventTest extends TestCase { abstract protected function createProjectEvent(Project $project): AbstractProjectEvent; - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $project = new Project(); $sut = $this->createProjectEvent($project); diff --git a/tests/Event/AbstractTimesheetEventTest.php b/tests/Event/AbstractTimesheetEventTest.php index cef65681..9f56d9cc 100644 --- a/tests/Event/AbstractTimesheetEventTest.php +++ b/tests/Event/AbstractTimesheetEventTest.php @@ -18,7 +18,7 @@ abstract class AbstractTimesheetEventTest extends TestCase { abstract protected function createTimesheetEvent(Timesheet $timesheet): AbstractTimesheetEvent; - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $timesheet = new Timesheet(); $sut = $this->createTimesheetEvent($timesheet); diff --git a/tests/Event/AbstractTimesheetMultipleEventTest.php b/tests/Event/AbstractTimesheetMultipleEventTest.php index 104a0782..c4c3b572 100644 --- a/tests/Event/AbstractTimesheetMultipleEventTest.php +++ b/tests/Event/AbstractTimesheetMultipleEventTest.php @@ -18,7 +18,7 @@ abstract class AbstractTimesheetMultipleEventTest extends TestCase { abstract protected function createTimesheetMultipleEvent(array $timesheets): AbstractTimesheetMultipleEvent; - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $timesheets = [new Timesheet(), new Timesheet()]; $sut = $this->createTimesheetMultipleEvent($timesheets); diff --git a/tests/Event/ActivityMetaDefinitionEventTest.php b/tests/Event/ActivityMetaDefinitionEventTest.php index 3033c192..cbc77a6a 100644 --- a/tests/Event/ActivityMetaDefinitionEventTest.php +++ b/tests/Event/ActivityMetaDefinitionEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class ActivityMetaDefinitionEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $activity = new Activity(); $sut = new ActivityMetaDefinitionEvent($activity); diff --git a/tests/Event/ActivityMetaDisplayEventTest.php b/tests/Event/ActivityMetaDisplayEventTest.php index d9c277bb..a572fb0e 100644 --- a/tests/Event/ActivityMetaDisplayEventTest.php +++ b/tests/Event/ActivityMetaDisplayEventTest.php @@ -21,7 +21,7 @@ use PHPUnit\Framework\TestCase; */ class ActivityMetaDisplayEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $query = new ActivityQuery(); $sut = new ActivityMetaDisplayEvent($query, ActivityMetaDisplayEvent::EXPORT); diff --git a/tests/Event/CalendarConfigurationEventTest.php b/tests/Event/CalendarConfigurationEventTest.php index 594716fa..cf13b910 100644 --- a/tests/Event/CalendarConfigurationEventTest.php +++ b/tests/Event/CalendarConfigurationEventTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class CalendarConfigurationEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $configuration = [ 'a' => 'b', diff --git a/tests/Event/CalendarDragAndDropSourceEventTest.php b/tests/Event/CalendarDragAndDropSourceEventTest.php index 1a9fb0f7..7a40e2b7 100644 --- a/tests/Event/CalendarDragAndDropSourceEventTest.php +++ b/tests/Event/CalendarDragAndDropSourceEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class CalendarDragAndDropSourceEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/CalendarGoogleSourceEventTest.php b/tests/Event/CalendarGoogleSourceEventTest.php index 27c08075..52e60200 100644 --- a/tests/Event/CalendarGoogleSourceEventTest.php +++ b/tests/Event/CalendarGoogleSourceEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class CalendarGoogleSourceEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/CustomerMetaDefinitionEventTest.php b/tests/Event/CustomerMetaDefinitionEventTest.php index abc104bd..07e961df 100644 --- a/tests/Event/CustomerMetaDefinitionEventTest.php +++ b/tests/Event/CustomerMetaDefinitionEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class CustomerMetaDefinitionEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $customer = new Customer('foo'); $sut = new CustomerMetaDefinitionEvent($customer); diff --git a/tests/Event/CustomerMetaDisplayEventTest.php b/tests/Event/CustomerMetaDisplayEventTest.php index 1362e3ff..a34e577e 100644 --- a/tests/Event/CustomerMetaDisplayEventTest.php +++ b/tests/Event/CustomerMetaDisplayEventTest.php @@ -21,7 +21,7 @@ use PHPUnit\Framework\TestCase; */ class CustomerMetaDisplayEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $query = new CustomerQuery(); $sut = new CustomerMetaDisplayEvent($query, CustomerMetaDisplayEvent::EXPORT); diff --git a/tests/Event/CustomerStatisticEventTest.php b/tests/Event/CustomerStatisticEventTest.php index fcdacf90..76dc778a 100644 --- a/tests/Event/CustomerStatisticEventTest.php +++ b/tests/Event/CustomerStatisticEventTest.php @@ -25,7 +25,7 @@ class CustomerStatisticEventTest extends AbstractCustomerEventTest return new CustomerStatisticEvent($customer, new CustomerStatistic()); } - public function testStatistic() + public function testStatistic(): void { $customer = new Customer('foo'); $statistic = new CustomerStatistic(); diff --git a/tests/Event/DashboardEventTest.php b/tests/Event/DashboardEventTest.php index 616a01a1..074932f3 100644 --- a/tests/Event/DashboardEventTest.php +++ b/tests/Event/DashboardEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class DashboardEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/EmailEventTest.php b/tests/Event/EmailEventTest.php index d4910751..407ff8a4 100644 --- a/tests/Event/EmailEventTest.php +++ b/tests/Event/EmailEventTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Mime\Email; */ class EmailEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $email = new Email(); $email->text('sdfsdfsdfsdf'); diff --git a/tests/Event/EmailPasswordResetEventTest.php b/tests/Event/EmailPasswordResetEventTest.php index f8fba9dd..53cc4c07 100644 --- a/tests/Event/EmailPasswordResetEventTest.php +++ b/tests/Event/EmailPasswordResetEventTest.php @@ -21,7 +21,7 @@ use Symfony\Component\Mime\Email; */ class EmailPasswordResetEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/EmailSelfRegistrationEventTest.php b/tests/Event/EmailSelfRegistrationEventTest.php index 450a21d9..1e9b7e8c 100644 --- a/tests/Event/EmailSelfRegistrationEventTest.php +++ b/tests/Event/EmailSelfRegistrationEventTest.php @@ -21,7 +21,7 @@ use Symfony\Component\Mime\Email; */ class EmailSelfRegistrationEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/InvoiceCreatedEventTest.php b/tests/Event/InvoiceCreatedEventTest.php index 6b19ad06..dd483328 100644 --- a/tests/Event/InvoiceCreatedEventTest.php +++ b/tests/Event/InvoiceCreatedEventTest.php @@ -23,7 +23,7 @@ use PHPUnit\Framework\TestCase; */ class InvoiceCreatedEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $invoice = new Invoice(); $model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery()); diff --git a/tests/Event/InvoiceDeleteEventTest.php b/tests/Event/InvoiceDeleteEventTest.php index 3847ec5b..84a85b42 100644 --- a/tests/Event/InvoiceDeleteEventTest.php +++ b/tests/Event/InvoiceDeleteEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class InvoiceDeleteEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $invoice = new Invoice(); diff --git a/tests/Event/InvoiceDocumentsEventTest.php b/tests/Event/InvoiceDocumentsEventTest.php index fc967434..02edae07 100644 --- a/tests/Event/InvoiceDocumentsEventTest.php +++ b/tests/Event/InvoiceDocumentsEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class InvoiceDocumentsEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new InvoiceDocumentsEvent([]); diff --git a/tests/Event/InvoicePostRenderEventTest.php b/tests/Event/InvoicePostRenderEventTest.php index e4c7f838..8ddfaa31 100644 --- a/tests/Event/InvoicePostRenderEventTest.php +++ b/tests/Event/InvoicePostRenderEventTest.php @@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Response; */ class InvoicePostRenderEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery()); $document = new InvoiceDocument(new \SplFileInfo(__FILE__)); diff --git a/tests/Event/InvoicePreRenderEventTest.php b/tests/Event/InvoicePreRenderEventTest.php index 82907226..b2c7bb36 100644 --- a/tests/Event/InvoicePreRenderEventTest.php +++ b/tests/Event/InvoicePreRenderEventTest.php @@ -24,7 +24,7 @@ use PHPUnit\Framework\TestCase; */ class InvoicePreRenderEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $model = (new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery()); $document = new InvoiceDocument(new \SplFileInfo(__FILE__)); diff --git a/tests/Event/PageActionsEventTest.php b/tests/Event/PageActionsEventTest.php index 7d041897..19e023b1 100644 --- a/tests/Event/PageActionsEventTest.php +++ b/tests/Event/PageActionsEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class PageActionsEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $user = new User(); $user->setAlias('foo'); @@ -41,7 +41,7 @@ class PageActionsEventTest extends TestCase $this->assertEquals(['hello' => 'world', 'actions' => [], 'view' => 'bar'], $sut->getPayload()); } - public function testSetActions() + public function testSetActions(): void { $sut = new PageActionsEvent(new User(), ['hello' => 'world'], 'foo', 'xxx'); $sut->addAction('foo', ['url' => 'bar']); @@ -75,7 +75,7 @@ class PageActionsEventTest extends TestCase $this->assertNull($sut->getLocale()); } - public function testSubmenu() + public function testSubmenu(): void { $sut = new PageActionsEvent(new User(), ['hello' => 'world'], 'foo', 'xxx'); $this->assertFalse($sut->hasSubmenu('test')); @@ -86,7 +86,7 @@ class PageActionsEventTest extends TestCase $this->assertEquals(2, $sut->countActions('test')); } - public function testAddHelper() + public function testAddHelper(): void { $sut = new PageActionsEvent(new User(), ['hello' => 'world'], 'foo', 'xxx'); @@ -111,7 +111,7 @@ class PageActionsEventTest extends TestCase $this->assertEquals($expected, $sut->getActions()); } - public function testAddOthers() + public function testAddOthers(): void { $sut = new PageActionsEvent(new User(), ['hello' => 'world'], 'foo', 'xxx'); diff --git a/tests/Event/PermissionsEventTest.php b/tests/Event/PermissionsEventTest.php index cf83f677..e6080538 100644 --- a/tests/Event/PermissionsEventTest.php +++ b/tests/Event/PermissionsEventTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class PermissionsEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $sut = new PermissionsEvent(); diff --git a/tests/Event/ProjectMetaDefinitionEventTest.php b/tests/Event/ProjectMetaDefinitionEventTest.php index 325cc1f4..6f173497 100644 --- a/tests/Event/ProjectMetaDefinitionEventTest.php +++ b/tests/Event/ProjectMetaDefinitionEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectMetaDefinitionEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $project = new Project(); $sut = new ProjectMetaDefinitionEvent($project); diff --git a/tests/Event/ProjectMetaDisplayEventTest.php b/tests/Event/ProjectMetaDisplayEventTest.php index 2033126e..8e6ee5c6 100644 --- a/tests/Event/ProjectMetaDisplayEventTest.php +++ b/tests/Event/ProjectMetaDisplayEventTest.php @@ -21,7 +21,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectMetaDisplayEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $query = new ProjectQuery(); $sut = new ProjectMetaDisplayEvent($query, ProjectMetaDisplayEvent::EXPORT); diff --git a/tests/Event/ProjectMetaQueryDisplayTest.php b/tests/Event/ProjectMetaQueryDisplayTest.php index 044518e2..eafa46bd 100644 --- a/tests/Event/ProjectMetaQueryDisplayTest.php +++ b/tests/Event/ProjectMetaQueryDisplayTest.php @@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectMetaQueryDisplayTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $query = new ProjectQuery(); $sut = new ProjectMetaDisplayEvent($query, ProjectMetaDisplayEvent::EXPORT); diff --git a/tests/Event/RecentActivityEventTest.php b/tests/Event/RecentActivityEventTest.php index a60fd518..3b6616bc 100644 --- a/tests/Event/RecentActivityEventTest.php +++ b/tests/Event/RecentActivityEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class RecentActivityEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/ReportingEventTest.php b/tests/Event/ReportingEventTest.php index e22b4cd3..b4810bc5 100644 --- a/tests/Event/ReportingEventTest.php +++ b/tests/Event/ReportingEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class ReportingEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $user = new User(); diff --git a/tests/Event/RevenueStatisticEventTest.php b/tests/Event/RevenueStatisticEventTest.php index e6996766..8c5fe570 100644 --- a/tests/Event/RevenueStatisticEventTest.php +++ b/tests/Event/RevenueStatisticEventTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class RevenueStatisticEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new RevenueStatisticEvent(null, null); diff --git a/tests/Event/SystemConfigurationEventTest.php b/tests/Event/SystemConfigurationEventTest.php index b68e52f9..eb0c8e87 100644 --- a/tests/Event/SystemConfigurationEventTest.php +++ b/tests/Event/SystemConfigurationEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class SystemConfigurationEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new SystemConfigurationEvent([]); self::assertIsArray($sut->getConfigurations()); diff --git a/tests/Event/ThemeJavascriptTranslationsEventTest.php b/tests/Event/ThemeJavascriptTranslationsEventTest.php index fbf78eec..4d79b64b 100644 --- a/tests/Event/ThemeJavascriptTranslationsEventTest.php +++ b/tests/Event/ThemeJavascriptTranslationsEventTest.php @@ -19,14 +19,14 @@ class ThemeJavascriptTranslationsEventTest extends TestCase { public const COUNTER = 17; - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new ThemeJavascriptTranslationsEvent(); $this->assertCount(self::COUNTER, $sut->getTranslations()); } - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $sut = new ThemeJavascriptTranslationsEvent(); $sut->setTranslation('foo', 'bar'); diff --git a/tests/Event/TimesheetDuplicatePostEventTest.php b/tests/Event/TimesheetDuplicatePostEventTest.php index 900bd5fc..cf206f30 100644 --- a/tests/Event/TimesheetDuplicatePostEventTest.php +++ b/tests/Event/TimesheetDuplicatePostEventTest.php @@ -23,7 +23,7 @@ class TimesheetDuplicatePostEventTest extends AbstractTimesheetEventTest return new TimesheetDuplicatePostEvent($timesheet, new Timesheet()); } - public function testGetOriginalTimesheet() + public function testGetOriginalTimesheet(): void { $newTimesheet = new Timesheet(); $originalTimesheet = new Timesheet(); diff --git a/tests/Event/TimesheetDuplicatePreEventTest.php b/tests/Event/TimesheetDuplicatePreEventTest.php index d98f1a5f..5d37e434 100644 --- a/tests/Event/TimesheetDuplicatePreEventTest.php +++ b/tests/Event/TimesheetDuplicatePreEventTest.php @@ -23,7 +23,7 @@ class TimesheetDuplicatePreEventTest extends AbstractTimesheetEventTest return new TimesheetDuplicatePreEvent($timesheet, new Timesheet()); } - public function testGetOriginalTimesheet() + public function testGetOriginalTimesheet(): void { $newTimesheet = new Timesheet(); $originalTimesheet = new Timesheet(); diff --git a/tests/Event/TimesheetMetaDefinitionEventTest.php b/tests/Event/TimesheetMetaDefinitionEventTest.php index 2e2c3641..4e197126 100644 --- a/tests/Event/TimesheetMetaDefinitionEventTest.php +++ b/tests/Event/TimesheetMetaDefinitionEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetMetaDefinitionEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $timesheet = new Timesheet(); $sut = new TimesheetMetaDefinitionEvent($timesheet); diff --git a/tests/Event/TimesheetMetaDisplayEventTest.php b/tests/Event/TimesheetMetaDisplayEventTest.php index 508dc7ed..cb533b38 100644 --- a/tests/Event/TimesheetMetaDisplayEventTest.php +++ b/tests/Event/TimesheetMetaDisplayEventTest.php @@ -21,7 +21,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetMetaDisplayEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $query = new TimesheetQuery(); $sut = new TimesheetMetaDisplayEvent($query, TimesheetMetaDisplayEvent::EXPORT); diff --git a/tests/Event/TimesheetRestartPostEventTest.php b/tests/Event/TimesheetRestartPostEventTest.php index 0f4db70c..3843e36b 100644 --- a/tests/Event/TimesheetRestartPostEventTest.php +++ b/tests/Event/TimesheetRestartPostEventTest.php @@ -23,7 +23,7 @@ class TimesheetRestartPostEventTest extends AbstractTimesheetEventTest return new TimesheetRestartPostEvent($timesheet, new Timesheet()); } - public function testGetOriginalTimesheet() + public function testGetOriginalTimesheet(): void { $newTimesheet = new Timesheet(); $originalTimesheet = new Timesheet(); diff --git a/tests/Event/TimesheetRestartPreEventTest.php b/tests/Event/TimesheetRestartPreEventTest.php index 71960e57..80e76035 100644 --- a/tests/Event/TimesheetRestartPreEventTest.php +++ b/tests/Event/TimesheetRestartPreEventTest.php @@ -23,7 +23,7 @@ class TimesheetRestartPreEventTest extends AbstractTimesheetEventTest return new TimesheetRestartPreEvent($timesheet, new Timesheet()); } - public function testGetOriginalTimesheet() + public function testGetOriginalTimesheet(): void { $newTimesheet = new Timesheet(); $originalTimesheet = new Timesheet(); diff --git a/tests/Event/UserCreateEventTest.php b/tests/Event/UserCreateEventTest.php index 745d7eda..0ab62802 100644 --- a/tests/Event/UserCreateEventTest.php +++ b/tests/Event/UserCreateEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class UserCreateEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/UserCreatePostEventTest.php b/tests/Event/UserCreatePostEventTest.php index 6efc4269..22f98bbb 100644 --- a/tests/Event/UserCreatePostEventTest.php +++ b/tests/Event/UserCreatePostEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class UserCreatePostEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/UserCreatePreEventTest.php b/tests/Event/UserCreatePreEventTest.php index 50cf30f9..e2b02c9e 100644 --- a/tests/Event/UserCreatePreEventTest.php +++ b/tests/Event/UserCreatePreEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class UserCreatePreEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/UserInteractiveLoginEventTest.php b/tests/Event/UserInteractiveLoginEventTest.php index f7825f38..493ec9d3 100644 --- a/tests/Event/UserInteractiveLoginEventTest.php +++ b/tests/Event/UserInteractiveLoginEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class UserInteractiveLoginEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/UserPreferenceDisplayEventTest.php b/tests/Event/UserPreferenceDisplayEventTest.php index 07728b5c..80929494 100644 --- a/tests/Event/UserPreferenceDisplayEventTest.php +++ b/tests/Event/UserPreferenceDisplayEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class UserPreferenceDisplayEventTest extends TestCase { - public function testGetterAndSetter() + public function testGetterAndSetter(): void { $sut = new UserPreferenceDisplayEvent('blub'); self::assertEquals('blub', $sut->getLocation()); diff --git a/tests/Event/UserRevenueStatisticEventTest.php b/tests/Event/UserRevenueStatisticEventTest.php index 6dcd9e0a..89f1d538 100644 --- a/tests/Event/UserRevenueStatisticEventTest.php +++ b/tests/Event/UserRevenueStatisticEventTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class UserRevenueStatisticEventTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $user = new User(); $sut = new UserRevenueStatisticEvent($user, null, null); diff --git a/tests/Event/UserUpdatePostEventTest.php b/tests/Event/UserUpdatePostEventTest.php index 790928bc..ef6d606e 100644 --- a/tests/Event/UserUpdatePostEventTest.php +++ b/tests/Event/UserUpdatePostEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class UserUpdatePostEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Event/UserUpdatePreEventTest.php b/tests/Event/UserUpdatePreEventTest.php index 15c8fbbc..dd9057c6 100644 --- a/tests/Event/UserUpdatePreEventTest.php +++ b/tests/Event/UserUpdatePreEventTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class UserUpdatePreEventTest extends TestCase { - public function testGetter() + public function testGetter(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/EventSubscriber/Actions/AbstractActionsSubscriberTest.php b/tests/EventSubscriber/Actions/AbstractActionsSubscriberTest.php index 032aec44..f466e810 100644 --- a/tests/EventSubscriber/Actions/AbstractActionsSubscriberTest.php +++ b/tests/EventSubscriber/Actions/AbstractActionsSubscriberTest.php @@ -29,7 +29,7 @@ abstract class AbstractActionsSubscriberTest extends TestCase return new $className($auth, $router); } - protected function assertGetSubscribedEvent(string $className, string $name) + public function assertGetSubscribedEvent(string $className, string $name): void { $this->assertTrue(method_exists($className, 'getSubscribedEvents')); $events = $className::getSubscribedEvents(); diff --git a/tests/EventSubscriber/Actions/ActivitiesSubscriberTest.php b/tests/EventSubscriber/Actions/ActivitiesSubscriberTest.php index 3483d9e1..418a9aae 100644 --- a/tests/EventSubscriber/Actions/ActivitiesSubscriberTest.php +++ b/tests/EventSubscriber/Actions/ActivitiesSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\ActivitiesSubscriber; */ class ActivitiesSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(ActivitiesSubscriber::class, 'activities'); } diff --git a/tests/EventSubscriber/Actions/ActivitySubscriberTest.php b/tests/EventSubscriber/Actions/ActivitySubscriberTest.php index 57044c59..d101f3de 100644 --- a/tests/EventSubscriber/Actions/ActivitySubscriberTest.php +++ b/tests/EventSubscriber/Actions/ActivitySubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\ActivitySubscriber; */ class ActivitySubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(ActivitySubscriber::class, 'activity'); } diff --git a/tests/EventSubscriber/Actions/CustomerSubscriberTest.php b/tests/EventSubscriber/Actions/CustomerSubscriberTest.php index d52e0d4c..c39a6ffd 100644 --- a/tests/EventSubscriber/Actions/CustomerSubscriberTest.php +++ b/tests/EventSubscriber/Actions/CustomerSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\CustomerSubscriber; */ class CustomerSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(CustomerSubscriber::class, 'customer'); } diff --git a/tests/EventSubscriber/Actions/CustomersSubscriberTest.php b/tests/EventSubscriber/Actions/CustomersSubscriberTest.php index 5f5c06e0..c766e465 100644 --- a/tests/EventSubscriber/Actions/CustomersSubscriberTest.php +++ b/tests/EventSubscriber/Actions/CustomersSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\CustomersSubscriber; */ class CustomersSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(CustomersSubscriber::class, 'customers'); } diff --git a/tests/EventSubscriber/Actions/InvoiceArchiveSubscriberTest.php b/tests/EventSubscriber/Actions/InvoiceArchiveSubscriberTest.php index 6ba7a0c1..cf771b5b 100644 --- a/tests/EventSubscriber/Actions/InvoiceArchiveSubscriberTest.php +++ b/tests/EventSubscriber/Actions/InvoiceArchiveSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\InvoiceArchiveSubscriber; */ class InvoiceArchiveSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(InvoiceArchiveSubscriber::class, 'invoice_archive'); } diff --git a/tests/EventSubscriber/Actions/InvoiceDocumentSubscriberTest.php b/tests/EventSubscriber/Actions/InvoiceDocumentSubscriberTest.php index 9c88094b..1c90b3bb 100644 --- a/tests/EventSubscriber/Actions/InvoiceDocumentSubscriberTest.php +++ b/tests/EventSubscriber/Actions/InvoiceDocumentSubscriberTest.php @@ -19,12 +19,12 @@ use App\Model\InvoiceDocument; */ class InvoiceDocumentSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(InvoiceDocumentSubscriber::class, 'invoice_document'); } - public function testActions() + public function testActions(): void { $sut = $this->createSubscriber(InvoiceDocumentSubscriber::class, true); diff --git a/tests/EventSubscriber/Actions/InvoiceSubscriberTest.php b/tests/EventSubscriber/Actions/InvoiceSubscriberTest.php index b13e8ae2..40c52c43 100644 --- a/tests/EventSubscriber/Actions/InvoiceSubscriberTest.php +++ b/tests/EventSubscriber/Actions/InvoiceSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\InvoiceSubscriber; */ class InvoiceSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(InvoiceSubscriber::class, 'invoice'); } diff --git a/tests/EventSubscriber/Actions/InvoiceTemplateSubscriberTest.php b/tests/EventSubscriber/Actions/InvoiceTemplateSubscriberTest.php index 0bc80712..0063439b 100644 --- a/tests/EventSubscriber/Actions/InvoiceTemplateSubscriberTest.php +++ b/tests/EventSubscriber/Actions/InvoiceTemplateSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\InvoiceTemplateSubscriber; */ class InvoiceTemplateSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(InvoiceTemplateSubscriber::class, 'invoice_template'); } diff --git a/tests/EventSubscriber/Actions/InvoiceTemplatesSubscriberTest.php b/tests/EventSubscriber/Actions/InvoiceTemplatesSubscriberTest.php index 3a80c714..5b1457c0 100644 --- a/tests/EventSubscriber/Actions/InvoiceTemplatesSubscriberTest.php +++ b/tests/EventSubscriber/Actions/InvoiceTemplatesSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\InvoiceTemplatesSubscriber; */ class InvoiceTemplatesSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(InvoiceTemplatesSubscriber::class, 'invoice_templates'); } diff --git a/tests/EventSubscriber/Actions/PermissionsSubscriberTest.php b/tests/EventSubscriber/Actions/PermissionsSubscriberTest.php index 5041ead3..16f86c96 100644 --- a/tests/EventSubscriber/Actions/PermissionsSubscriberTest.php +++ b/tests/EventSubscriber/Actions/PermissionsSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\PermissionsSubscriber; */ class PermissionsSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(PermissionsSubscriber::class, 'user_permissions'); } diff --git a/tests/EventSubscriber/Actions/PluginSubscriberTest.php b/tests/EventSubscriber/Actions/PluginSubscriberTest.php index bc23e03b..c1a8e864 100644 --- a/tests/EventSubscriber/Actions/PluginSubscriberTest.php +++ b/tests/EventSubscriber/Actions/PluginSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\PluginSubscriber; */ class PluginSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(PluginSubscriber::class, 'plugin'); } diff --git a/tests/EventSubscriber/Actions/ProjectSubscriberTest.php b/tests/EventSubscriber/Actions/ProjectSubscriberTest.php index ec5da405..b1fa8881 100644 --- a/tests/EventSubscriber/Actions/ProjectSubscriberTest.php +++ b/tests/EventSubscriber/Actions/ProjectSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\ProjectSubscriber; */ class ProjectSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(ProjectSubscriber::class, 'project'); } diff --git a/tests/EventSubscriber/Actions/ProjectsSubscriberTest.php b/tests/EventSubscriber/Actions/ProjectsSubscriberTest.php index e7ca12e7..7ce8e72e 100644 --- a/tests/EventSubscriber/Actions/ProjectsSubscriberTest.php +++ b/tests/EventSubscriber/Actions/ProjectsSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\ProjectsSubscriber; */ class ProjectsSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(ProjectsSubscriber::class, 'projects'); } diff --git a/tests/EventSubscriber/Actions/TagSubscriberTest.php b/tests/EventSubscriber/Actions/TagSubscriberTest.php index 75207b60..112241bb 100644 --- a/tests/EventSubscriber/Actions/TagSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TagSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\TagSubscriber; */ class TagSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TagSubscriber::class, 'tag'); } diff --git a/tests/EventSubscriber/Actions/TagsSubscriberTest.php b/tests/EventSubscriber/Actions/TagsSubscriberTest.php index 8bd7f12f..64dd8add 100644 --- a/tests/EventSubscriber/Actions/TagsSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TagsSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\TagsSubscriber; */ class TagsSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TagsSubscriber::class, 'tags'); } diff --git a/tests/EventSubscriber/Actions/TeamSubscriberTest.php b/tests/EventSubscriber/Actions/TeamSubscriberTest.php index 3dad007e..c5c43a4d 100644 --- a/tests/EventSubscriber/Actions/TeamSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TeamSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\TeamSubscriber; */ class TeamSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TeamSubscriber::class, 'team'); } diff --git a/tests/EventSubscriber/Actions/TeamsSubscriberTest.php b/tests/EventSubscriber/Actions/TeamsSubscriberTest.php index e71cbc03..e5133b0b 100644 --- a/tests/EventSubscriber/Actions/TeamsSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TeamsSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\TeamsSubscriber; */ class TeamsSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TeamsSubscriber::class, 'teams'); } diff --git a/tests/EventSubscriber/Actions/TimesheetSubscriberTest.php b/tests/EventSubscriber/Actions/TimesheetSubscriberTest.php index 085a9b00..a602d644 100644 --- a/tests/EventSubscriber/Actions/TimesheetSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TimesheetSubscriberTest.php @@ -18,7 +18,7 @@ use App\EventSubscriber\Actions\TimesheetSubscriber; */ class TimesheetSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TimesheetSubscriber::class, 'timesheet'); } diff --git a/tests/EventSubscriber/Actions/TimesheetTeamSubscriberTest.php b/tests/EventSubscriber/Actions/TimesheetTeamSubscriberTest.php index 6ddad4c3..5ae2cbdf 100644 --- a/tests/EventSubscriber/Actions/TimesheetTeamSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TimesheetTeamSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\TimesheetTeamSubscriber; */ class TimesheetTeamSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TimesheetTeamSubscriber::class, 'timesheet_team'); } diff --git a/tests/EventSubscriber/Actions/TimesheetsSubscriberTest.php b/tests/EventSubscriber/Actions/TimesheetsSubscriberTest.php index 649123ad..ca5bcd76 100644 --- a/tests/EventSubscriber/Actions/TimesheetsSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TimesheetsSubscriberTest.php @@ -17,7 +17,7 @@ use App\EventSubscriber\Actions\TimesheetsSubscriber; */ class TimesheetsSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TimesheetsSubscriber::class, 'timesheets'); } diff --git a/tests/EventSubscriber/Actions/TimesheetsTeamSubscriberTest.php b/tests/EventSubscriber/Actions/TimesheetsTeamSubscriberTest.php index edefef56..415d0cec 100644 --- a/tests/EventSubscriber/Actions/TimesheetsTeamSubscriberTest.php +++ b/tests/EventSubscriber/Actions/TimesheetsTeamSubscriberTest.php @@ -17,7 +17,7 @@ use App\EventSubscriber\Actions\TimesheetsTeamSubscriber; */ class TimesheetsTeamSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(TimesheetsTeamSubscriber::class, 'timesheets_team'); } diff --git a/tests/EventSubscriber/Actions/UserSubscriberTest.php b/tests/EventSubscriber/Actions/UserSubscriberTest.php index 39e2c9bf..65fd83f3 100644 --- a/tests/EventSubscriber/Actions/UserSubscriberTest.php +++ b/tests/EventSubscriber/Actions/UserSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\UserSubscriber; */ class UserSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(UserSubscriber::class, 'user'); } diff --git a/tests/EventSubscriber/Actions/UsersSubscriberTest.php b/tests/EventSubscriber/Actions/UsersSubscriberTest.php index 7ac8b252..041f6bbc 100644 --- a/tests/EventSubscriber/Actions/UsersSubscriberTest.php +++ b/tests/EventSubscriber/Actions/UsersSubscriberTest.php @@ -16,7 +16,7 @@ use App\EventSubscriber\Actions\UsersSubscriber; */ class UsersSubscriberTest extends AbstractActionsSubscriberTest { - public function testEventName() + public function testEventName(): void { $this->assertGetSubscribedEvent(UsersSubscriber::class, 'users'); } diff --git a/tests/EventSubscriber/EmailSubscriberTest.php b/tests/EventSubscriber/EmailSubscriberTest.php index ffccf117..452cabb7 100644 --- a/tests/EventSubscriber/EmailSubscriberTest.php +++ b/tests/EventSubscriber/EmailSubscriberTest.php @@ -22,7 +22,7 @@ use Symfony\Component\Mime\Email; */ class EmailSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $events = EmailSubscriber::getSubscribedEvents(); $this->assertArrayHasKey(EmailEvent::class, $events); @@ -30,7 +30,7 @@ class EmailSubscriberTest extends TestCase $this->assertTrue(method_exists(EmailSubscriber::class, $methodName)); } - public function testSendIsTriggered() + public function testSendIsTriggered(): void { $mailer = $this->createMock(MailerInterface::class); $mailer->expects($this->once())->method('send'); diff --git a/tests/EventSubscriber/LastLoginSubscriberTest.php b/tests/EventSubscriber/LastLoginSubscriberTest.php index 3999a8fa..a20f5d7b 100644 --- a/tests/EventSubscriber/LastLoginSubscriberTest.php +++ b/tests/EventSubscriber/LastLoginSubscriberTest.php @@ -25,7 +25,7 @@ use Symfony\Component\Security\Http\Event\LoginSuccessEvent; */ class LastLoginSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $events = LastLoginSubscriber::getSubscribedEvents(); @@ -38,7 +38,7 @@ class LastLoginSubscriberTest extends TestCase $this->assertTrue(method_exists(LastLoginSubscriber::class, $methodName)); } - public function testOnImplicitLogin() + public function testOnImplicitLogin(): void { $repository = $this->createMock(UserRepository::class); $repository->expects($this->once())->method('saveUser'); @@ -53,7 +53,7 @@ class LastLoginSubscriberTest extends TestCase self::assertNotNull($user->getLastLogin()); } - public function testOnLoginSuccessWithUser() + public function testOnLoginSuccessWithUser(): void { $repository = $this->createMock(UserRepository::class); $repository->expects($this->once())->method('saveUser'); diff --git a/tests/EventSubscriber/MenuSubscriberTest.php b/tests/EventSubscriber/MenuSubscriberTest.php index e1f4f4d0..e3ccbea9 100644 --- a/tests/EventSubscriber/MenuSubscriberTest.php +++ b/tests/EventSubscriber/MenuSubscriberTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class MenuSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $events = MenuSubscriber::getSubscribedEvents(); $this->assertArrayHasKey(ConfigureMainMenuEvent::class, $events); diff --git a/tests/EventSubscriber/PagerfantaExceptionSubscriberTest.php b/tests/EventSubscriber/PagerfantaExceptionSubscriberTest.php index 0dcc59a3..34abf8bd 100644 --- a/tests/EventSubscriber/PagerfantaExceptionSubscriberTest.php +++ b/tests/EventSubscriber/PagerfantaExceptionSubscriberTest.php @@ -24,7 +24,7 @@ use Symfony\Component\HttpKernel\KernelEvents; */ class PagerfantaExceptionSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $events = PagerfantaExceptionSubscriber::getSubscribedEvents(); $this->assertArrayHasKey(KernelEvents::EXCEPTION, $events); @@ -32,7 +32,7 @@ class PagerfantaExceptionSubscriberTest extends TestCase $this->assertTrue(method_exists(PagerfantaExceptionSubscriber::class, $methodName)); } - public function testWithExceptions() + public function testWithExceptions(): void { $sut = new PagerfantaExceptionSubscriber(); diff --git a/tests/EventSubscriber/ProfileSubscriberTest.php b/tests/EventSubscriber/ProfileSubscriberTest.php index 3586d382..5fbc8d6e 100644 --- a/tests/EventSubscriber/ProfileSubscriberTest.php +++ b/tests/EventSubscriber/ProfileSubscriberTest.php @@ -27,7 +27,7 @@ use Symfony\Component\Security\Http\Event\LoginSuccessEvent; */ class ProfileSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $events = ProfileSubscriber::getSubscribedEvents(); @@ -36,7 +36,7 @@ class ProfileSubscriberTest extends TestCase $this->assertTrue(method_exists(LastLoginSubscriber::class, $methodName)); } - public function testOnLoginSuccessWithoutProfileSetsDesktop() + public function testOnLoginSuccessWithoutProfileSetsDesktop(): void { $manager = new ProfileManager(); $sut = new ProfileSubscriber($manager); @@ -58,7 +58,7 @@ class ProfileSubscriberTest extends TestCase self::assertEquals(ProfileManager::PROFILE_DESKTOP, $manager->getProfileFromSession($session)); } - public function testOnLoginSuccessWithProfile() + public function testOnLoginSuccessWithProfile(): void { $manager = new ProfileManager(); $sut = new ProfileSubscriber($manager); @@ -104,7 +104,7 @@ class ProfileSubscriberTest extends TestCase /** * @dataProvider getInvalidCookies */ - public function testOnLoginSuccessWithInvalidProfile(string $cookieValue) + public function testOnLoginSuccessWithInvalidProfile(string $cookieValue): void { $manager = new ProfileManager(); $sut = new ProfileSubscriber($manager); diff --git a/tests/EventSubscriber/UserDetailsSubscriberTest.php b/tests/EventSubscriber/UserDetailsSubscriberTest.php index 6d5d536c..63324eaa 100644 --- a/tests/EventSubscriber/UserDetailsSubscriberTest.php +++ b/tests/EventSubscriber/UserDetailsSubscriberTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class UserDetailsSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $events = UserDetailsSubscriber::getSubscribedEvents(); $this->assertArrayHasKey(UserDetailsEvent::class, $events); diff --git a/tests/EventSubscriber/WizardSubscriberTest.php b/tests/EventSubscriber/WizardSubscriberTest.php index 376c24d9..89624139 100644 --- a/tests/EventSubscriber/WizardSubscriberTest.php +++ b/tests/EventSubscriber/WizardSubscriberTest.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpKernel\KernelEvents; */ class WizardSubscriberTest extends TestCase { - public function testGetSubscribedEvents() + public function testGetSubscribedEvents(): void { $events = WizardSubscriber::getSubscribedEvents(); $this->assertArrayHasKey(KernelEvents::REQUEST, $events); diff --git a/tests/Export/ExportFilenameTest.php b/tests/Export/ExportFilenameTest.php index cccd5c91..640c9b5a 100644 --- a/tests/Export/ExportFilenameTest.php +++ b/tests/Export/ExportFilenameTest.php @@ -21,7 +21,7 @@ use PHPUnit\Framework\TestCase; */ class ExportFilenameTest extends TestCase { - public function testExportFilename() + public function testExportFilename(): void { $datePrefix = date('Ymd'); diff --git a/tests/Export/Renderer/CsvRendererTest.php b/tests/Export/Renderer/CsvRendererTest.php index 7f6d17ef..0918481d 100644 --- a/tests/Export/Renderer/CsvRendererTest.php +++ b/tests/Export/Renderer/CsvRendererTest.php @@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; */ class CsvRendererTest extends AbstractRendererTest { - public function testConfiguration() + public function testConfiguration(): void { $sut = $this->getAbstractRenderer(CsvRenderer::class); @@ -40,7 +40,7 @@ class CsvRendererTest extends AbstractRendererTest /** * @dataProvider getTestModel */ - public function testRender($totalDuration, $totalRate, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3) + public function testRender($totalDuration, $totalRate, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3): void { $sut = $this->getAbstractRenderer(CsvRenderer::class); diff --git a/tests/Export/Renderer/HtmlRendererFactoryTest.php b/tests/Export/Renderer/HtmlRendererFactoryTest.php index 60ae8f36..5a142d79 100644 --- a/tests/Export/Renderer/HtmlRendererFactoryTest.php +++ b/tests/Export/Renderer/HtmlRendererFactoryTest.php @@ -22,7 +22,7 @@ use Twig\Environment; */ class HtmlRendererFactoryTest extends TestCase { - public function testCreate() + public function testCreate(): void { $sut = new HtmlRendererFactory( $this->createMock(Environment::class), diff --git a/tests/Export/Renderer/HtmlRendererTest.php b/tests/Export/Renderer/HtmlRendererTest.php index 4dcd3349..83d453da 100644 --- a/tests/Export/Renderer/HtmlRendererTest.php +++ b/tests/Export/Renderer/HtmlRendererTest.php @@ -28,7 +28,7 @@ use Twig\Environment; */ class HtmlRendererTest extends AbstractRendererTest { - public function testConfiguration() + public function testConfiguration(): void { $sut = new HtmlRenderer( $this->createMock(Environment::class), @@ -42,7 +42,7 @@ class HtmlRendererTest extends AbstractRendererTest $this->assertEquals('print', $sut->getIcon()); } - public function testRender() + public function testRender(): void { /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); diff --git a/tests/Export/Renderer/PdfRendererFactoryTest.php b/tests/Export/Renderer/PdfRendererFactoryTest.php index e669b48c..3ee2faac 100644 --- a/tests/Export/Renderer/PdfRendererFactoryTest.php +++ b/tests/Export/Renderer/PdfRendererFactoryTest.php @@ -21,7 +21,7 @@ use Twig\Environment; */ class PdfRendererFactoryTest extends TestCase { - public function testCreate() + public function testCreate(): void { $sut = new PdfRendererFactory( $this->createMock(Environment::class), diff --git a/tests/Export/Renderer/XlsxRendererTest.php b/tests/Export/Renderer/XlsxRendererTest.php index 9ee38c46..e411ad6a 100644 --- a/tests/Export/Renderer/XlsxRendererTest.php +++ b/tests/Export/Renderer/XlsxRendererTest.php @@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; */ class XlsxRendererTest extends AbstractRendererTest { - public function testConfiguration() + public function testConfiguration(): void { $sut = $this->getAbstractRenderer(XlsxRenderer::class); @@ -30,7 +30,7 @@ class XlsxRendererTest extends AbstractRendererTest $this->assertEquals('xlsx', $sut->getIcon()); } - public function testRender() + public function testRender(): void { $sut = $this->getAbstractRenderer(XlsxRenderer::class); diff --git a/tests/Export/ServiceExportTest.php b/tests/Export/ServiceExportTest.php index bdd5ac07..9fb29f3e 100644 --- a/tests/Export/ServiceExportTest.php +++ b/tests/Export/ServiceExportTest.php @@ -37,7 +37,7 @@ class ServiceExportTest extends TestCase ); } - public function testEmptyObject() + public function testEmptyObject(): void { $sut = $this->createSut(); @@ -48,7 +48,7 @@ class ServiceExportTest extends TestCase self::assertNull($sut->getTimesheetExporterById('default')); } - public function testAddRenderer() + public function testAddRenderer(): void { $sut = $this->createSut(); @@ -64,7 +64,7 @@ class ServiceExportTest extends TestCase self::assertSame($renderer, $sut->getRendererById('html')); } - public function testAddTimesheetExporter() + public function testAddTimesheetExporter(): void { $sut = $this->createSut(); @@ -75,7 +75,7 @@ class ServiceExportTest extends TestCase self::assertSame($exporter, $sut->getTimesheetExporterById('print')); } - public function testAddExportRepository() + public function testAddExportRepository(): void { $sut = $this->createSut(); diff --git a/tests/Export/Spreadsheet/AnnotatedObjectExporterTest.php b/tests/Export/Spreadsheet/AnnotatedObjectExporterTest.php index 7da5659f..1c41d1ec 100644 --- a/tests/Export/Spreadsheet/AnnotatedObjectExporterTest.php +++ b/tests/Export/Spreadsheet/AnnotatedObjectExporterTest.php @@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class AnnotatedObjectExporterTest extends TestCase { - public function testExport() + public function testExport(): void { $spreadsheetExporter = new SpreadsheetExporter($this->createMock(TranslatorInterface::class)); $annotationExtractor = new AnnotationExtractor(); diff --git a/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php index 8a2c9728..974b425f 100644 --- a/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/AbstractFormatterTest.php @@ -23,16 +23,16 @@ abstract class AbstractFormatterTest extends TestCase abstract protected function getExpectedValue(); - protected function assertCellStyle(Style $style) + public function assertCellStyle(Style $style): void { } - protected function assertCellValue(Cell $cell) + public function assertCellValue(Cell $cell): void { self::assertEquals($this->getExpectedValue(), $cell->getValue()); } - public function testSetFormattedValue() + public function testSetFormattedValue(): void { $sut = $this->getFormatter(); @@ -45,7 +45,7 @@ abstract class AbstractFormatterTest extends TestCase $this->assertCellStyle($worksheet->getStyleByColumnAndRow(1, 1)); } - public function testSetNull() + public function testSetNull(): void { $sut = $this->getFormatter(); @@ -57,7 +57,7 @@ abstract class AbstractFormatterTest extends TestCase $this->assertNullValue($cell); } - protected function assertNullValue(Cell $cell) + public function assertNullValue(Cell $cell): void { self::assertEquals('', $cell->getValue()); } diff --git a/tests/Export/Spreadsheet/CellFormatter/ArrayFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/ArrayFormatterTest.php index 7e071930..3aeb2e38 100644 --- a/tests/Export/Spreadsheet/CellFormatter/ArrayFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/ArrayFormatterTest.php @@ -33,7 +33,7 @@ class ArrayFormatterTest extends AbstractFormatterTest return 'test;foo;bar'; } - public function testFormattedValueWithInvalidValue() + public function testFormattedValueWithInvalidValue(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unsupported value given, only array is supported'); diff --git a/tests/Export/Spreadsheet/CellFormatter/BooleanFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/BooleanFormatterTest.php index c93e0411..46e2ca2a 100644 --- a/tests/Export/Spreadsheet/CellFormatter/BooleanFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/BooleanFormatterTest.php @@ -33,7 +33,7 @@ class BooleanFormatterTest extends AbstractFormatterTest return false; } - public function testFormattedValueWithInvalidValue() + public function testFormattedValueWithInvalidValue(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unsupported value given, only boolean is supported'); diff --git a/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php index 63fdcc5d..e5cd754b 100644 --- a/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/DateFormatterTest.php @@ -38,7 +38,7 @@ class DateFormatterTest extends AbstractFormatterTest return Date::PHPToExcel($this->date); } - public function testFormattedValueWithInvalidValue() + public function testFormattedValueWithInvalidValue(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unsupported value given, only DateTimeInterface is supported'); @@ -50,7 +50,7 @@ class DateFormatterTest extends AbstractFormatterTest $sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf'); } - protected function assertCellStyle(Style $style) + public function assertCellStyle(Style $style): void { self::assertEquals(NumberFormat::FORMAT_DATE_YYYYMMDD2, $style->getNumberFormat()->getFormatCode()); } diff --git a/tests/Export/Spreadsheet/CellFormatter/DateTimeFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/DateTimeFormatterTest.php index 573b5bc4..c9fdff07 100644 --- a/tests/Export/Spreadsheet/CellFormatter/DateTimeFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/DateTimeFormatterTest.php @@ -37,7 +37,7 @@ class DateTimeFormatterTest extends AbstractFormatterTest return Date::PHPToExcel($this->date); } - public function testFormattedValueWithInvalidValue() + public function testFormattedValueWithInvalidValue(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unsupported value given, only DateTimeInterface is supported'); @@ -49,7 +49,7 @@ class DateTimeFormatterTest extends AbstractFormatterTest $sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf'); } - protected function assertCellStyle(Style $style) + public function assertCellStyle(Style $style): void { self::assertEquals(DateTimeFormatter::DATETIME_FORMAT, $style->getNumberFormat()->getFormatCode()); } diff --git a/tests/Export/Spreadsheet/CellFormatter/DurationFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/DurationFormatterTest.php index a68669cb..0839a9af 100644 --- a/tests/Export/Spreadsheet/CellFormatter/DurationFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/DurationFormatterTest.php @@ -35,7 +35,7 @@ class DurationFormatterTest extends AbstractFormatterTest return '=3600/86400'; } - public function testFormattedValueWithInvalidValue() + public function testFormattedValueWithInvalidValue(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unsupported value given, only int is supported'); @@ -47,12 +47,12 @@ class DurationFormatterTest extends AbstractFormatterTest $sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf'); } - protected function assertNullValue(Cell $cell) + public function assertNullValue(Cell $cell): void { self::assertEquals('=0/86400', $cell->getValue()); } - protected function assertCellStyle(Style $style) + public function assertCellStyle(Style $style): void { self::assertEquals(DurationFormatter::DURATION_FORMAT, $style->getNumberFormat()->getFormatCode()); } diff --git a/tests/Export/Spreadsheet/CellFormatter/TimeFormatterTest.php b/tests/Export/Spreadsheet/CellFormatter/TimeFormatterTest.php index 2cbc7979..88b36dec 100644 --- a/tests/Export/Spreadsheet/CellFormatter/TimeFormatterTest.php +++ b/tests/Export/Spreadsheet/CellFormatter/TimeFormatterTest.php @@ -37,7 +37,7 @@ class TimeFormatterTest extends AbstractFormatterTest return Date::PHPToExcel($this->date); } - public function testFormattedValueWithInvalidValue() + public function testFormattedValueWithInvalidValue(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unsupported value given, only DateTimeInterface is supported'); @@ -49,7 +49,7 @@ class TimeFormatterTest extends AbstractFormatterTest $sut->setFormattedValue($worksheet, 1, 1, 'sdfsdf'); } - protected function assertCellStyle(Style $style) + public function assertCellStyle(Style $style): void { self::assertEquals(TimeFormatter::TIME_FORMAT, $style->getNumberFormat()->getFormatCode()); } diff --git a/tests/Export/Spreadsheet/ColumnDefinitionTest.php b/tests/Export/Spreadsheet/ColumnDefinitionTest.php index 46c2b6ad..5600eeb0 100644 --- a/tests/Export/Spreadsheet/ColumnDefinitionTest.php +++ b/tests/Export/Spreadsheet/ColumnDefinitionTest.php @@ -16,7 +16,7 @@ use PHPUnit\Framework\TestCase; */ class ColumnDefinitionTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $sut = new \App\Export\Spreadsheet\ColumnDefinition('foo', 'bar', function () { return 'hello world'; diff --git a/tests/Export/Spreadsheet/EntityWithMetaFieldsExporterTest.php b/tests/Export/Spreadsheet/EntityWithMetaFieldsExporterTest.php index 548bd6aa..c67564e4 100644 --- a/tests/Export/Spreadsheet/EntityWithMetaFieldsExporterTest.php +++ b/tests/Export/Spreadsheet/EntityWithMetaFieldsExporterTest.php @@ -27,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class EntityWithMetaFieldsExporterTest extends TestCase { - public function testExport() + public function testExport(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $dispatcher->expects(self::once())->method('dispatch')->willReturnCallback(function (ProjectMetaDisplayEvent $event) { diff --git a/tests/Export/Spreadsheet/Extractor/AnnotationExtractorTest.php b/tests/Export/Spreadsheet/Extractor/AnnotationExtractorTest.php index ac6f698a..24c6ee89 100644 --- a/tests/Export/Spreadsheet/Extractor/AnnotationExtractorTest.php +++ b/tests/Export/Spreadsheet/Extractor/AnnotationExtractorTest.php @@ -28,7 +28,7 @@ use PHPUnit\Framework\TestCase; */ class AnnotationExtractorTest extends TestCase { - public function testExtract() + public function testExtract(): void { $sut = new AnnotationExtractor(); @@ -70,7 +70,7 @@ class AnnotationExtractorTest extends TestCase } } - public function testExceptionOnInvalidType() + public function testExceptionOnInvalidType(): void { $sut = new AnnotationExtractor(); @@ -81,7 +81,7 @@ class AnnotationExtractorTest extends TestCase $sut->extract(new \stdClass()); } - public function testExceptionOnEmptyString() + public function testExceptionOnEmptyString(): void { $sut = new AnnotationExtractor(); @@ -91,7 +91,7 @@ class AnnotationExtractorTest extends TestCase $sut->extract(''); } - public function testExceptionOnMissingExpression() + public function testExceptionOnMissingExpression(): void { $sut = new AnnotationExtractor(); @@ -101,7 +101,7 @@ class AnnotationExtractorTest extends TestCase $sut->extract(MissingExpressionOnClass::class); } - public function testExceptionOnMissingName() + public function testExceptionOnMissingName(): void { $sut = new AnnotationExtractor(); @@ -111,7 +111,7 @@ class AnnotationExtractorTest extends TestCase $sut->extract(MissingNameOnClass::class); } - public function testExceptionExpressionOnProperty() + public function testExceptionExpressionOnProperty(): void { $sut = new AnnotationExtractor(); @@ -121,7 +121,7 @@ class AnnotationExtractorTest extends TestCase $sut->extract(ExpressionOnProperty::class); } - public function testExceptionExpressionOnMethod() + public function testExceptionExpressionOnMethod(): void { $sut = new AnnotationExtractor(); @@ -131,7 +131,7 @@ class AnnotationExtractorTest extends TestCase $sut->extract(ExpressionOnMethod::class); } - public function testExceptionExpressionOnMethodWithRequiredParameters() + public function testExceptionExpressionOnMethodWithRequiredParameters(): void { $sut = new AnnotationExtractor(); diff --git a/tests/Export/Spreadsheet/Extractor/MetaFieldExtractorTest.php b/tests/Export/Spreadsheet/Extractor/MetaFieldExtractorTest.php index e505da9d..777f0e26 100644 --- a/tests/Export/Spreadsheet/Extractor/MetaFieldExtractorTest.php +++ b/tests/Export/Spreadsheet/Extractor/MetaFieldExtractorTest.php @@ -25,7 +25,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; */ class MetaFieldExtractorTest extends TestCase { - public function testExtract() + public function testExtract(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $dispatcher->expects(self::once())->method('dispatch')->willReturnCallback(function (ProjectMetaDisplayEvent $event) { @@ -55,7 +55,7 @@ class MetaFieldExtractorTest extends TestCase self::assertEquals('tralalalala', \call_user_func($definition->getAccessor(), (new Project())->setMetaField((new ProjectMeta())->setName('bar')->setValue('tralalalala')))); } - public function testCheckType() + public function testCheckType(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $sut = new MetaFieldExtractor($dispatcher); diff --git a/tests/Export/Spreadsheet/Extractor/UserPreferenceExtractorTest.php b/tests/Export/Spreadsheet/Extractor/UserPreferenceExtractorTest.php index 4870256d..0fc13a62 100644 --- a/tests/Export/Spreadsheet/Extractor/UserPreferenceExtractorTest.php +++ b/tests/Export/Spreadsheet/Extractor/UserPreferenceExtractorTest.php @@ -24,7 +24,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; */ class UserPreferenceExtractorTest extends TestCase { - public function testExtract() + public function testExtract(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $dispatcher->expects(self::once())->method('dispatch')->willReturnCallback(function (UserPreferenceDisplayEvent $event) { @@ -54,7 +54,7 @@ class UserPreferenceExtractorTest extends TestCase self::assertEquals('tralalalala', \call_user_func($definition->getAccessor(), (new User())->addPreference((new UserPreference('bar', 'tralalalala'))))); } - public function testCheckType() + public function testCheckType(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $sut = new UserPreferenceExtractor($dispatcher); diff --git a/tests/Export/Spreadsheet/SpreadsheetExporterTest.php b/tests/Export/Spreadsheet/SpreadsheetExporterTest.php index a08c226b..1418c5d6 100644 --- a/tests/Export/Spreadsheet/SpreadsheetExporterTest.php +++ b/tests/Export/Spreadsheet/SpreadsheetExporterTest.php @@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class SpreadsheetExporterTest extends TestCase { - public function testExport() + public function testExport(): void { $sut = new SpreadsheetExporter($this->createMock(TranslatorInterface::class)); $sut->registerCellFormatter('foo', new class() implements CellFormatterInterface { diff --git a/tests/Export/Spreadsheet/UserExporterTest.php b/tests/Export/Spreadsheet/UserExporterTest.php index f350e225..586cb60c 100644 --- a/tests/Export/Spreadsheet/UserExporterTest.php +++ b/tests/Export/Spreadsheet/UserExporterTest.php @@ -24,7 +24,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class UserExporterTest extends TestCase { - public function testExport() + public function testExport(): void { $spreadsheetExporter = new SpreadsheetExporter($this->createMock(TranslatorInterface::class)); $annotationExtractor = new AnnotationExtractor(); diff --git a/tests/Export/Spreadsheet/Writer/BinaryFileResponseWriterTest.php b/tests/Export/Spreadsheet/Writer/BinaryFileResponseWriterTest.php index 5cc33a81..9245b300 100644 --- a/tests/Export/Spreadsheet/Writer/BinaryFileResponseWriterTest.php +++ b/tests/Export/Spreadsheet/Writer/BinaryFileResponseWriterTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class BinaryFileResponseWriterTest extends TestCase { - public function testSave() + public function testSave(): void { $sut = new BinaryFileResponseWriter(new XlsxWriter(), 'foobar'); @@ -33,7 +33,7 @@ class BinaryFileResponseWriterTest extends TestCase self::assertTrue(file_exists($file->getRealPath())); } - public function testGetResponse() + public function testGetResponse(): void { $sut = new BinaryFileResponseWriter(new XlsxWriter(), 'foobar'); diff --git a/tests/Export/Spreadsheet/Writer/XlsxWriterTest.php b/tests/Export/Spreadsheet/Writer/XlsxWriterTest.php index 3a66fbf9..b20737e0 100644 --- a/tests/Export/Spreadsheet/Writer/XlsxWriterTest.php +++ b/tests/Export/Spreadsheet/Writer/XlsxWriterTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class XlsxWriterTest extends TestCase { - public function testWriter() + public function testWriter(): void { $sut = new XlsxWriter(); diff --git a/tests/Export/Timesheet/CsvRendererTest.php b/tests/Export/Timesheet/CsvRendererTest.php index af70a2a6..b803e8a3 100644 --- a/tests/Export/Timesheet/CsvRendererTest.php +++ b/tests/Export/Timesheet/CsvRendererTest.php @@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; */ class CsvRendererTest extends AbstractRendererTest { - public function testConfiguration() + public function testConfiguration(): void { $sut = $this->getAbstractRenderer(CsvRenderer::class); @@ -38,7 +38,7 @@ class CsvRendererTest extends AbstractRendererTest /** * @dataProvider getTestModel */ - public function testRender($totalDuration, $totalRate, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3) + public function testRender($totalDuration, $totalRate, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3): void { $sut = $this->getAbstractRenderer(CsvRenderer::class); diff --git a/tests/Export/Timesheet/XlsxRendererTest.php b/tests/Export/Timesheet/XlsxRendererTest.php index 16457924..786bac75 100644 --- a/tests/Export/Timesheet/XlsxRendererTest.php +++ b/tests/Export/Timesheet/XlsxRendererTest.php @@ -21,14 +21,14 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; */ class XlsxRendererTest extends AbstractRendererTest { - public function testConfiguration() + public function testConfiguration(): void { $sut = $this->getAbstractRenderer(XlsxRenderer::class); $this->assertEquals('xlsx', $sut->getId()); } - public function testRender() + public function testRender(): void { $sut = $this->getAbstractRenderer(XlsxRenderer::class); diff --git a/tests/Export/TimesheetExportRepositoryTest.php b/tests/Export/TimesheetExportRepositoryTest.php index b3088483..fc9cd224 100644 --- a/tests/Export/TimesheetExportRepositoryTest.php +++ b/tests/Export/TimesheetExportRepositoryTest.php @@ -22,7 +22,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetExportRepositoryTest extends TestCase { - public function testSetExported() + public function testSetExported(): void { $repository = $this->createMock(TimesheetRepository::class); $repository->expects($this->once())->method('setExported')->willReturnCallback(function (array $items) { @@ -37,7 +37,7 @@ class TimesheetExportRepositoryTest extends TestCase $sut->setExported([new Customer('foo'), new Project()]); } - public function testSetType() + public function testSetType(): void { $repository = $this->createMock(TimesheetRepository::class); $sut = new TimesheetExportRepository($repository); diff --git a/tests/Form/ActivityEditFormTest.php b/tests/Form/ActivityEditFormTest.php index 7c8ac208..5fa0f823 100644 --- a/tests/Form/ActivityEditFormTest.php +++ b/tests/Form/ActivityEditFormTest.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\Test\TypeTestCase; */ class ActivityEditFormTest extends TypeTestCase { - public function testWithGlobalNewActivity() + public function testWithGlobalNewActivity(): void { $model = new Activity(); $form = $this->factory->createBuilder(ActivityEditForm::class, $model); @@ -40,7 +40,7 @@ class ActivityEditFormTest extends TypeTestCase self::assertFalse($form->has('budgetType')); } - public function testWithGlobalNewActivityAndOptionsBudget() + public function testWithGlobalNewActivityAndOptionsBudget(): void { $model = new Activity(); $form = $this->factory->createBuilder(ActivityEditForm::class, $model, [ @@ -51,7 +51,7 @@ class ActivityEditFormTest extends TypeTestCase self::assertTrue($form->has('budgetType')); } - public function testWithGlobalNewActivityAndOptionsTimeBudget() + public function testWithGlobalNewActivityAndOptionsTimeBudget(): void { $model = new Activity(); $form = $this->factory->createBuilder(ActivityEditForm::class, $model, [ @@ -62,7 +62,7 @@ class ActivityEditFormTest extends TypeTestCase self::assertTrue($form->has('budgetType')); } - public function testWithGlobalNewActivityAndOptionsAllBudget() + public function testWithGlobalNewActivityAndOptionsAllBudget(): void { $model = new Activity(); $form = $this->factory->createBuilder(ActivityEditForm::class, $model, [ @@ -74,7 +74,7 @@ class ActivityEditFormTest extends TypeTestCase self::assertTrue($form->has('budgetType')); } - public function testWithGlobalExistingActivityAndOptions() + public function testWithGlobalExistingActivityAndOptions(): void { $model = $this->createMock(Activity::class); $model->expects($this->once())->method('getId')->willReturn(1); @@ -87,7 +87,7 @@ class ActivityEditFormTest extends TypeTestCase self::assertFalse($form->has('timeBudget')); } - public function testWithNonGlobalExistingActivityAndOptions() + public function testWithNonGlobalExistingActivityAndOptions(): void { $project = new Project(); $customer = new Customer('foo'); diff --git a/tests/Form/CustomerEditFormTest.php b/tests/Form/CustomerEditFormTest.php index 92bd05b1..0c705a57 100644 --- a/tests/Form/CustomerEditFormTest.php +++ b/tests/Form/CustomerEditFormTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Form\Test\TypeTestCase; */ class CustomerEditFormTest extends TypeTestCase { - public function testWithNewProject() + public function testWithNewProject(): void { $model = new Customer('foo'); $form = $this->factory->createBuilder(CustomerEditForm::class, $model); @@ -37,7 +37,7 @@ class CustomerEditFormTest extends TypeTestCase self::assertFalse($form->has('budgetType')); } - public function testWithBudget() + public function testWithBudget(): void { $model = new Customer('foo'); $form = $this->factory->createBuilder(CustomerEditForm::class, $model, [ @@ -48,7 +48,7 @@ class CustomerEditFormTest extends TypeTestCase self::assertTrue($form->has('budgetType')); } - public function testWithTimeBudget() + public function testWithTimeBudget(): void { $model = new Customer('foo'); $form = $this->factory->createBuilder(CustomerEditForm::class, $model, [ @@ -59,7 +59,7 @@ class CustomerEditFormTest extends TypeTestCase self::assertTrue($form->has('budgetType')); } - public function testWithBudgetAndTimeBudget() + public function testWithBudgetAndTimeBudget(): void { $model = new Customer('foo'); $form = $this->factory->createBuilder(CustomerEditForm::class, $model, [ diff --git a/tests/Form/DataTransformer/DurationStringToSecondsTransformerTest.php b/tests/Form/DataTransformer/DurationStringToSecondsTransformerTest.php index c81d5728..09486063 100644 --- a/tests/Form/DataTransformer/DurationStringToSecondsTransformerTest.php +++ b/tests/Form/DataTransformer/DurationStringToSecondsTransformerTest.php @@ -49,7 +49,7 @@ class DurationStringToSecondsTransformerTest extends TestCase /** * @dataProvider getValidTestDataTransform */ - public function testTransform($expected, $transform) + public function testTransform($expected, $transform): void { $this->assertEquals($expected, $this->sut->transform($transform)); } @@ -57,7 +57,7 @@ class DurationStringToSecondsTransformerTest extends TestCase /** * @dataProvider getInvalidTestDataTransform */ - public function testInvalidTransformThrowsException($transform) + public function testInvalidTransformThrowsException($transform): void { $this->expectException(TransformationFailedException::class); @@ -89,7 +89,7 @@ class DurationStringToSecondsTransformerTest extends TestCase /** * @dataProvider getValidTestDataReverseTransform */ - public function testReverseTransform($transform, $expected) + public function testReverseTransform($transform, $expected): void { $this->assertEquals($expected, $this->sut->reverseTransform($transform)); } @@ -97,7 +97,7 @@ class DurationStringToSecondsTransformerTest extends TestCase /** * @dataProvider getInvalidTestDataReverseTransform */ - public function testInvalidReverseTransformThrowsException($transform) + public function testInvalidReverseTransformThrowsException($transform): void { $this->expectException(TransformationFailedException::class); diff --git a/tests/Form/DataTransformer/SearchTermTransformerTest.php b/tests/Form/DataTransformer/SearchTermTransformerTest.php index e4475273..82ba60ae 100644 --- a/tests/Form/DataTransformer/SearchTermTransformerTest.php +++ b/tests/Form/DataTransformer/SearchTermTransformerTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class SearchTermTransformerTest extends TestCase { - public function testTransform() + public function testTransform(): void { $sut = new SearchTermTransformer(); @@ -34,7 +34,7 @@ class SearchTermTransformerTest extends TestCase ); } - public function testReverseTransform() + public function testReverseTransform(): void { $sut = new SearchTermTransformer(); diff --git a/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php b/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php index fe01ec06..324ad4b2 100644 --- a/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php +++ b/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class TagArrayToStringTransformerTest extends TestCase { - public function testTransform() + public function testTransform(): void { $results = [ (new Tag())->setName('foo'), @@ -38,7 +38,7 @@ class TagArrayToStringTransformerTest extends TestCase $this->assertEquals('foo, bar', $actual); } - public function testReverseTransform() + public function testReverseTransform(): void { $results = [ (new Tag())->setName('foo'), diff --git a/tests/Form/Extension/DocumentationLinkExtensionTest.php b/tests/Form/Extension/DocumentationLinkExtensionTest.php index 8c494bf9..eaa628ce 100644 --- a/tests/Form/Extension/DocumentationLinkExtensionTest.php +++ b/tests/Form/Extension/DocumentationLinkExtensionTest.php @@ -20,12 +20,12 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class DocumentationLinkExtensionTest extends TestCase { - public function testExtendedTypes() + public function testExtendedTypes(): void { self::assertEquals([FormType::class], DocumentationLinkExtension::getExtendedTypes()); } - public function testConfigureOptions() + public function testConfigureOptions(): void { $resolver = new OptionsResolver(); $sut = new DocumentationLinkExtension(); diff --git a/tests/Form/Extension/EnhancedChoiceTypeExtensionTest.php b/tests/Form/Extension/EnhancedChoiceTypeExtensionTest.php index 73158d8d..01b901b5 100644 --- a/tests/Form/Extension/EnhancedChoiceTypeExtensionTest.php +++ b/tests/Form/Extension/EnhancedChoiceTypeExtensionTest.php @@ -20,12 +20,12 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class EnhancedChoiceTypeExtensionTest extends TestCase { - public function testExtendedTypes() + public function testExtendedTypes(): void { self::assertEquals([EntityType::class, ChoiceType::class], EnhancedChoiceTypeExtension::getExtendedTypes()); } - public function testConfigureOptions() + public function testConfigureOptions(): void { $resolver = new OptionsResolver(); $sut = new EnhancedChoiceTypeExtension(); diff --git a/tests/Form/Extension/IconExtensionTest.php b/tests/Form/Extension/IconExtensionTest.php index 22cfb21f..da94eedf 100644 --- a/tests/Form/Extension/IconExtensionTest.php +++ b/tests/Form/Extension/IconExtensionTest.php @@ -20,12 +20,12 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class IconExtensionTest extends TestCase { - public function testExtendedTypes() + public function testExtendedTypes(): void { self::assertEquals([TextType::class], IconExtension::getExtendedTypes()); } - public function testConfigureOptions() + public function testConfigureOptions(): void { $resolver = new OptionsResolver(); $sut = new IconExtension(); diff --git a/tests/Form/Model/SystemConfigurationTest.php b/tests/Form/Model/SystemConfigurationTest.php index 36c76198..3d6acf9a 100644 --- a/tests/Form/Model/SystemConfigurationTest.php +++ b/tests/Form/Model/SystemConfigurationTest.php @@ -19,14 +19,14 @@ use PHPUnit\Framework\TestCase; */ class SystemConfigurationTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new SystemConfiguration(); self::assertNull($sut->getSection()); self::assertEquals([], $sut->getConfiguration()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new SystemConfiguration('foo'); diff --git a/tests/Form/MultiUpdate/MultiUpdateTableDTOTest.php b/tests/Form/MultiUpdate/MultiUpdateTableDTOTest.php index 1820feb9..e6be0c97 100644 --- a/tests/Form/MultiUpdate/MultiUpdateTableDTOTest.php +++ b/tests/Form/MultiUpdate/MultiUpdateTableDTOTest.php @@ -22,7 +22,7 @@ use PHPUnit\Framework\TestCase; */ class MultiUpdateTableDTOTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new MultiUpdateTableDTO(); self::assertEmpty($sut->getEntities()); @@ -31,7 +31,7 @@ class MultiUpdateTableDTOTest extends TestCase self::assertFalse($sut->hasAction()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new MultiUpdateTableDTO(); diff --git a/tests/Form/MultiUpdate/TimesheetMultiUpdateDTOTest.php b/tests/Form/MultiUpdate/TimesheetMultiUpdateDTOTest.php index d033b45d..35709a0d 100644 --- a/tests/Form/MultiUpdate/TimesheetMultiUpdateDTOTest.php +++ b/tests/Form/MultiUpdate/TimesheetMultiUpdateDTOTest.php @@ -24,7 +24,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetMultiUpdateDTOTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new TimesheetMultiUpdateDTO(); self::assertEmpty($sut->getEntities()); @@ -46,7 +46,7 @@ class TimesheetMultiUpdateDTOTest extends TestCase self::assertEquals([], $sut->getUpdateMeta()); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new TimesheetMultiUpdateDTO(); diff --git a/tests/Form/ProjectEditFormTest.php b/tests/Form/ProjectEditFormTest.php index 8a2f1865..df4a0ed6 100644 --- a/tests/Form/ProjectEditFormTest.php +++ b/tests/Form/ProjectEditFormTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Form\Test\TypeTestCase; */ class ProjectEditFormTest extends TypeTestCase { - public function testWithNewProject() + public function testWithNewProject(): void { $model = new Project(); $form = $this->factory->createBuilder(ProjectEditForm::class, $model); @@ -38,7 +38,7 @@ class ProjectEditFormTest extends TypeTestCase self::assertFalse($form->has('budgetType')); } - public function testWithBudget() + public function testWithBudget(): void { $model = new Project(); $form = $this->factory->createBuilder(ProjectEditForm::class, $model, [ @@ -49,7 +49,7 @@ class ProjectEditFormTest extends TypeTestCase self::assertTrue($form->has('budgetType')); } - public function testWithTimeBudget() + public function testWithTimeBudget(): void { $model = new Project(); $form = $this->factory->createBuilder(ProjectEditForm::class, $model, [ @@ -60,7 +60,7 @@ class ProjectEditFormTest extends TypeTestCase self::assertTrue($form->has('budgetType')); } - public function testWithBudgetAndTimeBudget() + public function testWithBudgetAndTimeBudget(): void { $model = new Project(); $form = $this->factory->createBuilder(ProjectEditForm::class, $model, [ diff --git a/tests/Form/Type/DurationTypeTest.php b/tests/Form/Type/DurationTypeTest.php index 90000f76..0fa9302f 100644 --- a/tests/Form/Type/DurationTypeTest.php +++ b/tests/Form/Type/DurationTypeTest.php @@ -29,7 +29,7 @@ class DurationTypeTest extends TypeTestCase /** * @dataProvider getTestData */ - public function testSubmitValidData($value, $expected) + public function testSubmitValidData($value, $expected): void { $data = ['duration' => $value]; $model = new TypeTestModel(['duration' => 3600]); @@ -48,7 +48,7 @@ class DurationTypeTest extends TypeTestCase $this->assertEquals($expected, $model); } - public function testPresetPopulatesView() + public function testPresetPopulatesView(): void { $view = $this->factory->create(DurationType::class, 3600, [ 'preset_minutes' => 15, @@ -61,7 +61,7 @@ class DurationTypeTest extends TypeTestCase self::assertEquals('4:45', $view->vars['duration_presets'][18]); } - public function testPresetsAreNotGeneratedOnMissingHours() + public function testPresetsAreNotGeneratedOnMissingHours(): void { $view = $this->factory->create(DurationType::class, 3600, [ 'preset_minutes' => 5, @@ -70,7 +70,7 @@ class DurationTypeTest extends TypeTestCase self::assertArrayNotHasKey('duration_presets', $view->vars); } - public function testPresetsAreNotGeneratedOnMissingMinutes() + public function testPresetsAreNotGeneratedOnMissingMinutes(): void { $view = $this->factory->create(DurationType::class, 3600, [ 'preset_hours' => 5, @@ -79,7 +79,7 @@ class DurationTypeTest extends TypeTestCase self::assertArrayNotHasKey('duration_presets', $view->vars); } - public function testPresetsAreNotGeneratedOnNegativeMinutes() + public function testPresetsAreNotGeneratedOnNegativeMinutes(): void { $view = $this->factory->create(DurationType::class, 3600, [ 'preset_minutes' => -1, @@ -89,7 +89,7 @@ class DurationTypeTest extends TypeTestCase self::assertArrayNotHasKey('duration_presets', $view->vars); } - public function testPresetsAreNotGeneratedOnNegativeHours() + public function testPresetsAreNotGeneratedOnNegativeHours(): void { $view = $this->factory->create(DurationType::class, 3600, [ 'preset_minutes' => 5, @@ -99,7 +99,7 @@ class DurationTypeTest extends TypeTestCase self::assertArrayNotHasKey('duration_presets', $view->vars); } - public function testHasDurationInputClass() + public function testHasDurationInputClass(): void { $view = $this->factory->create(DurationType::class, 3600, [ 'attr' => ['class' => 'testing'] diff --git a/tests/Form/Type/MinuteIncrementTypeTest.php b/tests/Form/Type/MinuteIncrementTypeTest.php index d64b6381..5affb415 100644 --- a/tests/Form/Type/MinuteIncrementTypeTest.php +++ b/tests/Form/Type/MinuteIncrementTypeTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Form\Test\TypeTestCase; */ class MinuteIncrementTypeTest extends TypeTestCase { - public function testSubmitValidData() + public function testSubmitValidData(): void { $data = ['increment' => 4]; $model = new TypeTestModel(['increment' => 5]); @@ -37,7 +37,7 @@ class MinuteIncrementTypeTest extends TypeTestCase $this->assertEquals($expected, $model); } - public function testPresetPopulatesView() + public function testPresetPopulatesView(): void { $view = $this->factory->create(MinuteIncrementType::class, 3600, [])->createView(); self::assertArrayHasKey('choices', $view->vars); diff --git a/tests/Form/Type/QuickEntryTimesheetTypeTest.php b/tests/Form/Type/QuickEntryTimesheetTypeTest.php index ebfb0448..416a9fc1 100644 --- a/tests/Form/Type/QuickEntryTimesheetTypeTest.php +++ b/tests/Form/Type/QuickEntryTimesheetTypeTest.php @@ -45,7 +45,7 @@ class QuickEntryTimesheetTypeTest extends TypeTestCase /** * @dataProvider getTestData */ - public function testSubmitValidData($value, $expectedDuration) + public function testSubmitValidData($value, $expectedDuration): void { $data = ['duration' => $value]; @@ -72,7 +72,7 @@ class QuickEntryTimesheetTypeTest extends TypeTestCase return $model; } - public function testPresetPopulatesView() + public function testPresetPopulatesView(): void { $view = $this->factory->create(QuickEntryTimesheetType::class, $this->createDefaultModel(), [ 'duration_minutes' => 15, @@ -87,7 +87,7 @@ class QuickEntryTimesheetTypeTest extends TypeTestCase self::assertEquals('4:45', $vars['duration_presets'][18]); } - public function testPresetsAreNotGeneratedOnMissingHours() + public function testPresetsAreNotGeneratedOnMissingHours(): void { $view = $this->factory->create(QuickEntryTimesheetType::class, $this->createDefaultModel())->createView(); @@ -96,7 +96,7 @@ class QuickEntryTimesheetTypeTest extends TypeTestCase self::assertArrayNotHasKey('duration_presets', $vars); } - public function testPresetsAreNotGeneratedOnMissingMinutes() + public function testPresetsAreNotGeneratedOnMissingMinutes(): void { $view = $this->factory->create(QuickEntryTimesheetType::class, $this->createDefaultModel(), [ 'duration_hours' => 5, @@ -107,7 +107,7 @@ class QuickEntryTimesheetTypeTest extends TypeTestCase self::assertArrayNotHasKey('duration_presets', $vars); } - public function testPresetsAreNotGeneratedOnNegativeMinutes() + public function testPresetsAreNotGeneratedOnNegativeMinutes(): void { $view = $this->factory->create(QuickEntryTimesheetType::class, $this->createDefaultModel(), [ 'duration_minutes' => -1, @@ -119,7 +119,7 @@ class QuickEntryTimesheetTypeTest extends TypeTestCase self::assertArrayNotHasKey('duration_presets', $vars); } - public function testPresetsAreNotGeneratedOnNegativeHours() + public function testPresetsAreNotGeneratedOnNegativeHours(): void { $view = $this->factory->create(QuickEntryTimesheetType::class, $this->createDefaultModel(), [ 'duration_minutes' => 5, diff --git a/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php b/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php index c076c399..bde73220 100644 --- a/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php +++ b/tests/Invoice/Hydrator/InvoiceItemDefaultHydratorTest.php @@ -20,7 +20,7 @@ class InvoiceItemDefaultHydratorTest extends TestCase { use RendererTestTrait; - public function testHydrate() + public function testHydrate(): void { $model = $this->getInvoiceModel(); @@ -36,7 +36,7 @@ class InvoiceItemDefaultHydratorTest extends TestCase $this->assertEntryStructure($result, $metaFields); } - protected function assertEntryStructure(array $model, array $metaFields) + public function assertEntryStructure(array $model, array $metaFields): void { $keys = [ 'entry.row', diff --git a/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php b/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php index 809995a8..f1b03dbd 100644 --- a/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php +++ b/tests/Invoice/Hydrator/InvoiceModelActivityHydratorTest.php @@ -21,7 +21,7 @@ class InvoiceModelActivityHydratorTest extends TestCase { use RendererTestTrait; - public function testHydrate() + public function testHydrate(): void { $model = $this->getInvoiceModel(); @@ -31,7 +31,7 @@ class InvoiceModelActivityHydratorTest extends TestCase $this->assertModelStructure($result); } - protected function assertModelStructure(array $model) + public function assertModelStructure(array $model): void { $keys = [ 'activity.id', diff --git a/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php b/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php index cf157b35..09c09329 100644 --- a/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php +++ b/tests/Invoice/Hydrator/InvoiceModelProjectHydratorTest.php @@ -21,7 +21,7 @@ class InvoiceModelProjectHydratorTest extends TestCase { use RendererTestTrait; - public function testHydrate() + public function testHydrate(): void { $model = $this->getInvoiceModel(); @@ -31,7 +31,7 @@ class InvoiceModelProjectHydratorTest extends TestCase $this->assertModelStructure($result); } - protected function assertModelStructure(array $model) + public function assertModelStructure(array $model): void { $keys = [ 'project.id', diff --git a/tests/Invoice/Hydrator/InvoiceModelUserHydratorTest.php b/tests/Invoice/Hydrator/InvoiceModelUserHydratorTest.php index b01d7ea1..50865210 100644 --- a/tests/Invoice/Hydrator/InvoiceModelUserHydratorTest.php +++ b/tests/Invoice/Hydrator/InvoiceModelUserHydratorTest.php @@ -20,7 +20,7 @@ class InvoiceModelUserHydratorTest extends TestCase { use RendererTestTrait; - public function testHydrate() + public function testHydrate(): void { $model = $this->getInvoiceModel(); @@ -30,7 +30,7 @@ class InvoiceModelUserHydratorTest extends TestCase $this->assertModelStructure($result); } - protected function assertModelStructure(array $model) + public function assertModelStructure(array $model): void { $keys = [ 'user.display', diff --git a/tests/Invoice/InvoiceItemTest.php b/tests/Invoice/InvoiceItemTest.php index 2fb1bcdd..e061e7d1 100644 --- a/tests/Invoice/InvoiceItemTest.php +++ b/tests/Invoice/InvoiceItemTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class InvoiceItemTest extends TestCase { - public function testEmptyObject() + public function testEmptyObject(): void { $sut = new InvoiceItem(); diff --git a/tests/Invoice/NumberGenerator/DateNumberGeneratorTest.php b/tests/Invoice/NumberGenerator/DateNumberGeneratorTest.php index 98045d4a..7389c645 100644 --- a/tests/Invoice/NumberGenerator/DateNumberGeneratorTest.php +++ b/tests/Invoice/NumberGenerator/DateNumberGeneratorTest.php @@ -40,7 +40,7 @@ class DateNumberGeneratorTest extends TestCase return new DateNumberGenerator($repository); } - public function testGetInvoiceNumber() + public function testGetInvoiceNumber(): void { $sut = $this->getSut(false, false); $sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery())); @@ -49,7 +49,7 @@ class DateNumberGeneratorTest extends TestCase $this->assertEquals('date', $sut->getId()); } - public function testGetInvoiceNumberWithExisting() + public function testGetInvoiceNumberWithExisting(): void { $sut = $this->getSut(true, false); $sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery())); @@ -58,7 +58,7 @@ class DateNumberGeneratorTest extends TestCase $this->assertEquals('date', $sut->getId()); } - public function testGetInvoiceNumberWithManyExisting() + public function testGetInvoiceNumberWithManyExisting(): void { $sut = $this->getSut(true, true); $sut->setModel((new InvoiceModelFactoryFactory($this))->create()->createModel(new DebugFormatter(), new Customer('foo'), new InvoiceTemplate(), new InvoiceQuery())); diff --git a/tests/Invoice/Renderer/OdsRendererTest.php b/tests/Invoice/Renderer/OdsRendererTest.php index d1184d03..a32afc52 100644 --- a/tests/Invoice/Renderer/OdsRendererTest.php +++ b/tests/Invoice/Renderer/OdsRendererTest.php @@ -24,7 +24,7 @@ class OdsRendererTest extends TestCase { use RendererTestTrait; - public function testSupports() + public function testSupports(): void { $sut = $this->getAbstractRenderer(OdsRenderer::class); @@ -45,7 +45,7 @@ class OdsRendererTest extends TestCase /** * @dataProvider getTestModel */ - public function testRender(InvoiceModel $model, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3) + public function testRender(InvoiceModel $model, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3): void { /** @var OdsRenderer $sut */ $sut = $this->getAbstractRenderer(OdsRenderer::class); diff --git a/tests/Invoice/Renderer/XlsxRendererTest.php b/tests/Invoice/Renderer/XlsxRendererTest.php index b5ce7636..923ecb9b 100644 --- a/tests/Invoice/Renderer/XlsxRendererTest.php +++ b/tests/Invoice/Renderer/XlsxRendererTest.php @@ -25,7 +25,7 @@ class XlsxRendererTest extends TestCase { use RendererTestTrait; - public function testSupports() + public function testSupports(): void { $sut = $this->getAbstractRenderer(XlsxRenderer::class); @@ -46,7 +46,7 @@ class XlsxRendererTest extends TestCase /** * @dataProvider getTestModel */ - public function testRender(InvoiceModel $model, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3) + public function testRender(InvoiceModel $model, $expectedRate, $expectedRows, $expectedDescriptions, $expectedUser1, $expectedUser2, $expectedUser3): void { /** @var XlsxRenderer $sut */ $sut = $this->getAbstractRenderer(XlsxRenderer::class); diff --git a/tests/KernelTest.php b/tests/KernelTest.php index 4462582a..91e052e7 100644 --- a/tests/KernelTest.php +++ b/tests/KernelTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class KernelTest extends TestCase { - public function testBuild() + public function testBuild(): void { $sut = new Kernel('test', false); self::assertStringEndsWith('var/cache/test', $sut->getCacheDir()); diff --git a/tests/Ldap/LdapDriverExceptionTest.php b/tests/Ldap/LdapDriverExceptionTest.php index 50e52367..82cd55f2 100644 --- a/tests/Ldap/LdapDriverExceptionTest.php +++ b/tests/Ldap/LdapDriverExceptionTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class LdapDriverExceptionTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $sut = new LdapDriverException('Whooops'); diff --git a/tests/Ldap/LdapDriverTest.php b/tests/Ldap/LdapDriverTest.php index d73786c6..3b59efe4 100644 --- a/tests/Ldap/LdapDriverTest.php +++ b/tests/Ldap/LdapDriverTest.php @@ -41,7 +41,7 @@ class LdapDriverTest extends TestCase return new TestLdapDriver(new LdapConfiguration($config), $ldap); } - public function testBindSuccess() + public function testBindSuccess(): void { $zendLdap = $this->getMockBuilder(Ldap::class)->disableOriginalConstructor()->onlyMethods(['bind'])->getMock(); $zendLdap->expects($this->once())->method('bind')->willReturnSelf(); @@ -53,7 +53,7 @@ class LdapDriverTest extends TestCase self::assertTrue($result); } - public function testBindException() + public function testBindException(): void { $zendLdap = $this->getMockBuilder(Ldap::class)->disableOriginalConstructor()->onlyMethods(['bind'])->getMock(); $zendLdap->expects($this->once())->method('bind')->willThrowException(new LdapException()); @@ -65,7 +65,7 @@ class LdapDriverTest extends TestCase self::assertFalse($result); } - public function testSearchSuccess() + public function testSearchSuccess(): void { $zendLdap = $this->getMockBuilder(Ldap::class)->disableOriginalConstructor()->onlyMethods(['bind', 'searchEntries'])->getMock(); $zendLdap->expects($this->once())->method('bind'); diff --git a/tests/Ldap/LdapManagerTest.php b/tests/Ldap/LdapManagerTest.php index d48045a6..6710ad9f 100644 --- a/tests/Ldap/LdapManagerTest.php +++ b/tests/Ldap/LdapManagerTest.php @@ -63,7 +63,7 @@ class LdapManagerTest extends TestCase return new LdapManager($driver, $config, (new RoleServiceFactory($this))->create($roles)); } - public function testFindUserByUsernameOnZeroResults() + public function testFindUserByUsernameOnZeroResults(): void { $expected = [ 'count' => 0 @@ -82,7 +82,7 @@ class LdapManagerTest extends TestCase self::assertNull($actual); } - public function testFindUserByUsernameOnMultiResults() + public function testFindUserByUsernameOnMultiResults(): void { $this->expectException(LdapDriverException::class); $this->expectExceptionMessage('This search must only return a single user'); @@ -103,7 +103,7 @@ class LdapManagerTest extends TestCase $sut->findUserByUsername('foo'); } - public function testFindUserByUsernameOnValidResult() + public function testFindUserByUsernameOnValidResult(): void { $expected = [ 0 => ['dn' => 'foo', 'uid' => ['foo']], @@ -123,7 +123,7 @@ class LdapManagerTest extends TestCase self::assertInstanceOf(User::class, $actual); } - public function testFindUserByOnZeroResults() + public function testFindUserByOnZeroResults(): void { $expected = [ 'count' => 0 @@ -142,7 +142,7 @@ class LdapManagerTest extends TestCase self::assertNull($actual); } - public function testFindUserByOnMultiResults() + public function testFindUserByOnMultiResults(): void { $this->expectException(LdapDriverException::class); $this->expectExceptionMessage('This search must only return a single user'); @@ -163,7 +163,7 @@ class LdapManagerTest extends TestCase $sut->findUserByUsername('foo'); } - public function testFindUserByOnValidResult() + public function testFindUserByOnValidResult(): void { $expected = [ 0 => ['dn' => 'foo', 'uid' => ['foo']], @@ -183,7 +183,7 @@ class LdapManagerTest extends TestCase self::assertInstanceOf(User::class, $actual); } - public function testBind() + public function testBind(): void { $user = new User(); $user->setUserIdentifier('foobar'); @@ -201,7 +201,7 @@ class LdapManagerTest extends TestCase self::assertTrue($actual); } - public function testUpdateUserOnZeroResults() + public function testUpdateUserOnZeroResults(): void { $user = new User(); $user->setUserIdentifier('foobar'); @@ -238,7 +238,7 @@ class LdapManagerTest extends TestCase self::assertEquals($userOrig, $user); } - public function testUpdateUserOnMultiResults() + public function testUpdateUserOnMultiResults(): void { $this->expectException(LdapDriverException::class); $this->expectExceptionMessage('This search must only return a single user'); @@ -276,7 +276,7 @@ class LdapManagerTest extends TestCase $sut->updateUser($user); } - public function testUpdateUserOnValidResultWithEmptyRoleBaseDn() + public function testUpdateUserOnValidResultWithEmptyRoleBaseDn(): void { $user = new User(); $user->setUserIdentifier('foobar'); @@ -391,7 +391,7 @@ class LdapManagerTest extends TestCase /** * @dataProvider getValidConfigsTestData */ - public function testUpdateUserOnValidResultWithRolesResult(array $expectedUsers, array $groupConfig, string $expectedGroupQuery) + public function testUpdateUserOnValidResultWithRolesResult(array $expectedUsers, array $groupConfig, string $expectedGroupQuery): void { $expected = [ 0 => ['dn' => 'blub', 'uid' => ['blub']], @@ -461,7 +461,7 @@ class LdapManagerTest extends TestCase self::assertEquals(['ROLE_TEAMLEAD', 'ROLE_ADMIN', 'ROLE_USER'], $user->getRoles()); } - public function testEmptyHydrate() + public function testEmptyHydrate(): void { $ldapConfig = [ 'activate' => true, @@ -486,7 +486,7 @@ class LdapManagerTest extends TestCase self::assertEquals('blub', $user->getEmail()); } - public function testEmptyHydrateThrowsException() + public function testEmptyHydrateThrowsException(): void { $this->expectException(LdapDriverException::class); $this->expectExceptionMessage('Missing username in LDAP hydration'); @@ -511,7 +511,7 @@ class LdapManagerTest extends TestCase self::assertInstanceOf(User::class, $user); } - public function testHydrate() + public function testHydrate(): void { $ldapConfig = [ 'connection' => [ @@ -586,7 +586,7 @@ class LdapManagerTest extends TestCase /** * @group legacy */ - public function testHydrateWithDepercatedSetter() + public function testHydrateWithDepercatedSetter(): void { $ldapConfig = [ 'connection' => [ @@ -631,7 +631,7 @@ class LdapManagerTest extends TestCase self::assertEquals('Karl-Heinz', $user->getEmail()); } - public function testHydrateUser() + public function testHydrateUser(): void { $ldapConfig = [ 'connection' => [ @@ -680,7 +680,7 @@ class LdapManagerTest extends TestCase self::assertEquals($pwdCheck, $user); } - public function testHydrateRoles() + public function testHydrateRoles(): void { $ldapConfig = [ 'user' => [ diff --git a/tests/Ldap/SanitizingExceptionTest.php b/tests/Ldap/SanitizingExceptionTest.php index 5c14caf9..2fe4752b 100644 --- a/tests/Ldap/SanitizingExceptionTest.php +++ b/tests/Ldap/SanitizingExceptionTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class SanitizingExceptionTest extends TestCase { - public function testMessagesAreSanitized() + public function testMessagesAreSanitized(): void { $ex = new \Exception('Could not find user foo with password bar in your LDAP'); $sut = new SanitizingException($ex, 'bar'); diff --git a/tests/Mail/KimaiMailerTest.php b/tests/Mail/KimaiMailerTest.php index d29bfaa8..d6b7412e 100644 --- a/tests/Mail/KimaiMailerTest.php +++ b/tests/Mail/KimaiMailerTest.php @@ -31,7 +31,7 @@ class KimaiMailerTest extends TestCase return new KimaiMailer($config, $mailer); } - public function testSendSetsFrom() + public function testSendSetsFrom(): void { $user = new User(); $user->setUserIdentifier('Testing'); diff --git a/tests/Model/AbstractTimesheetCountedStatisticTest.php b/tests/Model/AbstractTimesheetCountedStatisticTest.php index f17c1763..e6f646d7 100644 --- a/tests/Model/AbstractTimesheetCountedStatisticTest.php +++ b/tests/Model/AbstractTimesheetCountedStatisticTest.php @@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase; abstract class AbstractTimesheetCountedStatisticTest extends TestCase { - protected function assertDefaultValues(TimesheetCountedStatistic $sut) + public function assertDefaultValues(TimesheetCountedStatistic $sut): void { self::assertSame(0.0, $sut->getRate()); self::assertSame(0.0, $sut->getRate()); @@ -55,7 +55,7 @@ abstract class AbstractTimesheetCountedStatisticTest extends TestCase } } - protected function assertSetter(TimesheetCountedStatistic $sut) + public function assertSetter(TimesheetCountedStatistic $sut): void { $sut->setRate(23.97); $sut->setDuration(21); @@ -102,7 +102,7 @@ abstract class AbstractTimesheetCountedStatisticTest extends TestCase self::assertSame(987.12, $sut->getInternalRateBillable()); } - protected function assertJsonSerialize(TimesheetCountedStatistic $sut) + public function assertJsonSerialize(TimesheetCountedStatistic $sut): void { self::assertInstanceOf(\JsonSerializable::class, $sut); $sut->setRate(23.97); diff --git a/tests/Model/ActivityBudgetStatisticModelTest.php b/tests/Model/ActivityBudgetStatisticModelTest.php index d5e6bd53..f00ed897 100644 --- a/tests/Model/ActivityBudgetStatisticModelTest.php +++ b/tests/Model/ActivityBudgetStatisticModelTest.php @@ -36,7 +36,7 @@ class ActivityBudgetStatisticModelTest extends TestCase return new Activity(); } - public function testAdditionals() + public function testAdditionals(): void { $entity = $this->getEntity(); $sut = $this->getSut($entity); diff --git a/tests/Model/ActivityStatisticTest.php b/tests/Model/ActivityStatisticTest.php index 11936b60..ec1f61c9 100644 --- a/tests/Model/ActivityStatisticTest.php +++ b/tests/Model/ActivityStatisticTest.php @@ -17,22 +17,22 @@ use App\Model\ActivityStatistic; */ class ActivityStatisticTest extends AbstractTimesheetCountedStatisticTest { - public function testDefaultValues() + public function testDefaultValues(): void { $this->assertDefaultValues(new ActivityStatistic()); } - public function testSetter() + public function testSetter(): void { $this->assertSetter(new ActivityStatistic()); } - public function testJsonSerialize() + public function testJsonSerialize(): void { $this->assertJsonSerialize(new ActivityStatistic()); } - public function testAdditionalSetter() + public function testAdditionalSetter(): void { $sut = new ActivityStatistic(); self::assertNull($sut->getActivity()); diff --git a/tests/Model/BudgetStatisticModelTest.php b/tests/Model/BudgetStatisticModelTest.php index c2018a19..3ca52bf8 100644 --- a/tests/Model/BudgetStatisticModelTest.php +++ b/tests/Model/BudgetStatisticModelTest.php @@ -30,22 +30,22 @@ class BudgetStatisticModelTest extends TestCase return new Customer('foo'); } - public function testDefaults() + public function testDefaults(): void { $this->assertDefaults(); } - public function testSetter() + public function testSetter(): void { $this->assertSetter(); } - public function testCalculation() + public function testCalculation(): void { $this->assertCalculation(); } - protected function assertCalculation() + protected function assertCalculation(): void { $entity = $this->getEntity(); $entity->setBudget(100.0); @@ -112,7 +112,7 @@ class BudgetStatisticModelTest extends TestCase self::assertSame(213.00, $sut->getBudgetSpent()); } - protected function assertSetter() + protected function assertSetter(): void { $entity = $this->getEntity(); $entity->setBudget(10.0); @@ -143,7 +143,7 @@ class BudgetStatisticModelTest extends TestCase self::assertNull($sut->getStatistic()); } - protected function assertDefaults() + protected function assertDefaults(): void { $entity = $this->getEntity(); $sut = $this->getSut($entity); diff --git a/tests/Model/CustomerBudgetStatisticModelTest.php b/tests/Model/CustomerBudgetStatisticModelTest.php index b444cfd2..30c62b0c 100644 --- a/tests/Model/CustomerBudgetStatisticModelTest.php +++ b/tests/Model/CustomerBudgetStatisticModelTest.php @@ -36,7 +36,7 @@ class CustomerBudgetStatisticModelTest extends TestCase return new Customer('foo'); } - public function testAdditionals() + public function testAdditionals(): void { $entity = $this->getEntity(); $sut = $this->getSut($entity); diff --git a/tests/Model/CustomerStatisticTest.php b/tests/Model/CustomerStatisticTest.php index af388afc..72202416 100644 --- a/tests/Model/CustomerStatisticTest.php +++ b/tests/Model/CustomerStatisticTest.php @@ -16,17 +16,17 @@ use App\Model\CustomerStatistic; */ class CustomerStatisticTest extends AbstractTimesheetCountedStatisticTest { - public function testDefaultValues() + public function testDefaultValues(): void { $this->assertDefaultValues(new CustomerStatistic()); } - public function testSetter() + public function testSetter(): void { $this->assertSetter(new CustomerStatistic()); } - public function testJsonSerialize() + public function testJsonSerialize(): void { $this->assertJsonSerialize(new CustomerStatistic()); } diff --git a/tests/Model/DailyStatisticTest.php b/tests/Model/DailyStatisticTest.php index 4119c74b..47dc2bd7 100644 --- a/tests/Model/DailyStatisticTest.php +++ b/tests/Model/DailyStatisticTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class DailyStatisticTest extends TestCase { - public function testStatistic() + public function testStatistic(): void { $begin = new \DateTime('2018-04-07 12:00:00'); $end = new \DateTime('2018-04-13 18:00:00'); diff --git a/tests/Model/MonthlyStatisticTest.php b/tests/Model/MonthlyStatisticTest.php index 2da57d37..719a3bcc 100644 --- a/tests/Model/MonthlyStatisticTest.php +++ b/tests/Model/MonthlyStatisticTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class MonthlyStatisticTest extends TestCase { - public function testStatistic() + public function testStatistic(): void { $begin = new \DateTime('2017-04-07 12:00:00'); $end = new \DateTime('2019-11-13 18:00:00'); diff --git a/tests/Model/ProjectBudgetStatisticModelTest.php b/tests/Model/ProjectBudgetStatisticModelTest.php index 85077a5c..a5982b3a 100644 --- a/tests/Model/ProjectBudgetStatisticModelTest.php +++ b/tests/Model/ProjectBudgetStatisticModelTest.php @@ -36,7 +36,7 @@ class ProjectBudgetStatisticModelTest extends TestCase return new Project(); } - public function testAdditionals() + public function testAdditionals(): void { $entity = $this->getEntity(); $sut = $this->getSut($entity); diff --git a/tests/Model/ProjectStatisticTest.php b/tests/Model/ProjectStatisticTest.php index c6ae0122..920853cb 100644 --- a/tests/Model/ProjectStatisticTest.php +++ b/tests/Model/ProjectStatisticTest.php @@ -16,17 +16,17 @@ use App\Model\CustomerStatistic; */ class ProjectStatisticTest extends AbstractTimesheetCountedStatisticTest { - public function testDefaultValues() + public function testDefaultValues(): void { $this->assertDefaultValues(new CustomerStatistic()); } - public function testSetter() + public function testSetter(): void { $this->assertSetter(new CustomerStatistic()); } - public function testJsonSerialize() + public function testJsonSerialize(): void { $this->assertJsonSerialize(new CustomerStatistic()); } diff --git a/tests/Model/Statistic/AbstractTimesheetTest.php b/tests/Model/Statistic/AbstractTimesheetTest.php index 2ca6651f..623c524e 100644 --- a/tests/Model/Statistic/AbstractTimesheetTest.php +++ b/tests/Model/Statistic/AbstractTimesheetTest.php @@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase; abstract class AbstractTimesheetTest extends TestCase { - protected function assertDefaultValues(Timesheet $sut) + public function assertDefaultValues(Timesheet $sut): void { self::assertSame(0.0, $sut->getRate()); self::assertSame(0, $sut->getDuration()); @@ -25,7 +25,7 @@ abstract class AbstractTimesheetTest extends TestCase self::assertSame(0.0, $sut->getTotalInternalRate()); } - protected function assertSetter(Timesheet $sut) + public function assertSetter(Timesheet $sut): void { $sut->setTotalInternalRate(5485.84); $sut->setTotalRate(1234.23); diff --git a/tests/Model/Statistic/BudgetStatisticTest.php b/tests/Model/Statistic/BudgetStatisticTest.php index 134c20c9..f5f6b8a5 100644 --- a/tests/Model/Statistic/BudgetStatisticTest.php +++ b/tests/Model/Statistic/BudgetStatisticTest.php @@ -17,17 +17,17 @@ use App\Tests\Model\AbstractTimesheetCountedStatisticTest; */ class BudgetStatisticTest extends AbstractTimesheetCountedStatisticTest { - public function testDefaultValues() + public function testDefaultValues(): void { $this->assertDefaultValues(new BudgetStatistic()); } - public function testSetter() + public function testSetter(): void { $this->assertSetter(new BudgetStatistic()); } - public function testJsonSerialize() + public function testJsonSerialize(): void { $this->assertJsonSerialize(new BudgetStatistic()); } diff --git a/tests/Model/Statistic/DayTest.php b/tests/Model/Statistic/DayTest.php index 787c5416..51c61438 100644 --- a/tests/Model/Statistic/DayTest.php +++ b/tests/Model/Statistic/DayTest.php @@ -17,21 +17,21 @@ use DateTime; */ class DayTest extends AbstractTimesheetTest { - public function testDefaultValues() + public function testDefaultValues(): void { $date = new DateTime('-8 hours'); $sut = new Day($date, 0, 0.0); $this->assertDefaultValues($sut); } - public function testSetter() + public function testSetter(): void { $date = new DateTime('-8 hours'); $sut = new Day($date, 12340, 197.25956); $this->assertSetter($sut); } - public function testConstruct() + public function testConstruct(): void { $date = new DateTime('-8 hours'); $sut = new Day($date, 12340, 197.25956); @@ -43,7 +43,7 @@ class DayTest extends AbstractTimesheetTest self::assertSame(0, $sut->getTotalDurationBillable()); } - public function testAllowedMonths() + public function testAllowedMonths(): void { $date = new DateTime('-8 hours'); $sut = new Day($date, 12340, 197.25956); @@ -57,7 +57,7 @@ class DayTest extends AbstractTimesheetTest self::assertSame(12345, $sut->getTotalDurationBillable()); } - public function testSetDetails() + public function testSetDetails(): void { $sut = new Day(new DateTime(), 12340, 197.25956); diff --git a/tests/Model/Statistic/MonthTest.php b/tests/Model/Statistic/MonthTest.php index 07a42796..dbb22c03 100644 --- a/tests/Model/Statistic/MonthTest.php +++ b/tests/Model/Statistic/MonthTest.php @@ -17,7 +17,7 @@ use InvalidArgumentException; */ class MonthTest extends AbstractTimesheetTest { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Month('01'); $this->assertDefaultValues($sut); @@ -60,7 +60,7 @@ class MonthTest extends AbstractTimesheetTest /** * @dataProvider getTestData */ - public function testAllowedMonths($init, $month, $number) + public function testAllowedMonths($init, $month, $number): void { $sut = new Month($init); self::assertEquals($month, $sut->getMonth()); @@ -79,14 +79,14 @@ class MonthTest extends AbstractTimesheetTest /** * @dataProvider getInvalidTestData */ - public function testInvalidMonths($month) + public function testInvalidMonths($month): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Invalid month given. Expected 1-12, received "' . ((int) $month) . '".'); new Month($month); } - public function testSetter() + public function testSetter(): void { $sut = new Month('01'); $this->assertSetter($sut); diff --git a/tests/Model/Statistic/StatisticDateTest.php b/tests/Model/Statistic/StatisticDateTest.php index 20f7107a..4dc666c0 100644 --- a/tests/Model/Statistic/StatisticDateTest.php +++ b/tests/Model/Statistic/StatisticDateTest.php @@ -17,7 +17,7 @@ use DateTime; */ class StatisticDateTest extends AbstractTimesheetTest { - public function testDefaultValues() + public function testDefaultValues(): void { $dateTime = new \DateTime('-8 hours'); $sut = new StatisticDate($dateTime); @@ -28,14 +28,14 @@ class StatisticDateTest extends AbstractTimesheetTest self::assertEquals($dateTime->getTimestamp(), $sut->getDate()->getTimestamp()); } - public function testSetter() + public function testSetter(): void { $date = new DateTime('-8 hours'); $sut = new StatisticDate($date); $this->assertSetter($sut); } - public function testAdditionalMethods() + public function testAdditionalMethods(): void { $date = new DateTime('-8 hours'); $sut = new StatisticDate($date); diff --git a/tests/Model/Statistic/TimesheetTest.php b/tests/Model/Statistic/TimesheetTest.php index be2674f7..8ec3c2b3 100644 --- a/tests/Model/Statistic/TimesheetTest.php +++ b/tests/Model/Statistic/TimesheetTest.php @@ -16,13 +16,13 @@ use App\Model\Statistic\Timesheet; */ class TimesheetTest extends AbstractTimesheetTest { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new Timesheet(); $this->assertDefaultValues($sut); } - public function testSetter() + public function testSetter(): void { $sut = new Timesheet(); $this->assertSetter($sut); diff --git a/tests/Model/TimesheetCountedStatisticTest.php b/tests/Model/TimesheetCountedStatisticTest.php index 23be4438..d471aaf8 100644 --- a/tests/Model/TimesheetCountedStatisticTest.php +++ b/tests/Model/TimesheetCountedStatisticTest.php @@ -16,17 +16,17 @@ use App\Model\TimesheetCountedStatistic; */ class TimesheetCountedStatisticTest extends AbstractTimesheetCountedStatisticTest { - public function testDefaultValues() + public function testDefaultValues(): void { $this->assertDefaultValues(new TimesheetCountedStatistic()); } - public function testSetter() + public function testSetter(): void { $this->assertSetter(new TimesheetCountedStatistic()); } - public function testJsonSerialize() + public function testJsonSerialize(): void { $this->assertJsonSerialize(new TimesheetCountedStatistic()); } diff --git a/tests/Model/TimesheetStatisticTest.php b/tests/Model/TimesheetStatisticTest.php index de41a88a..5e64c2e2 100644 --- a/tests/Model/TimesheetStatisticTest.php +++ b/tests/Model/TimesheetStatisticTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetStatisticTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new TimesheetStatistic(); $this->assertEquals(0, $sut->getRecordsTotal()); @@ -27,7 +27,7 @@ class TimesheetStatisticTest extends TestCase $this->assertEquals(0, $sut->getDurationThisMonth()); } - public function testSetter() + public function testSetter(): void { $sut = new TimesheetStatistic(); $sut->setRecordsTotal(2); diff --git a/tests/Model/UserStatisticTest.php b/tests/Model/UserStatisticTest.php index dc517fc0..94528ffc 100644 --- a/tests/Model/UserStatisticTest.php +++ b/tests/Model/UserStatisticTest.php @@ -25,22 +25,22 @@ class UserStatisticTest extends AbstractTimesheetCountedStatisticTest return new UserStatistic($user); } - public function testDefaultValues() + public function testDefaultValues(): void { $this->assertDefaultValues($this->getSut()); } - public function testSetter() + public function testSetter(): void { $this->assertSetter($this->getSut()); } - public function testJsonSerialize() + public function testJsonSerialize(): void { $this->assertJsonSerialize($this->getSut()); } - public function testAdditionalValues() + public function testAdditionalValues(): void { $user = new User(); $sut = new UserStatistic($user); diff --git a/tests/Pdf/PdfContextTest.php b/tests/Pdf/PdfContextTest.php index e8d17bba..75ff22d6 100644 --- a/tests/Pdf/PdfContextTest.php +++ b/tests/Pdf/PdfContextTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class PdfContextTest extends TestCase { - public function testEmptyObject() + public function testEmptyObject(): void { $sut = new PdfContext(); @@ -26,7 +26,7 @@ class PdfContextTest extends TestCase self::assertNull($sut->getOption('unknown')); } - public function testSetterAndGetter() + public function testSetterAndGetter(): void { $sut = new PdfContext(); diff --git a/tests/Project/ProjectServiceTest.php b/tests/Project/ProjectServiceTest.php index c1bd1c73..aba1b53f 100644 --- a/tests/Project/ProjectServiceTest.php +++ b/tests/Project/ProjectServiceTest.php @@ -59,7 +59,7 @@ class ProjectServiceTest extends TestCase return new ProjectService($configuration, $repository, $dispatcher, $validator); } - public function testCannotSavePersistedProjectAsNew() + public function testCannotSavePersistedProjectAsNew(): void { $project = $this->createMock(Project::class); $project->expects($this->once())->method('getId')->willReturn(1); @@ -72,7 +72,7 @@ class ProjectServiceTest extends TestCase $sut->saveNewProject($project, new Context(new User())); } - public function testSaveNewProjectHasValidationError() + public function testSaveNewProjectHasValidationError(): void { $constraints = new ConstraintViolationList(); $constraints->add(new ConstraintViolation('toooo many tests', 'abc.def', [], '$root', 'begin', 4, null, null, null, '$cause')); @@ -88,7 +88,7 @@ class ProjectServiceTest extends TestCase $sut->saveNewProject(new Project(), new Context(new User())); } - public function testUpdateDispatchesEvents() + public function testUpdateDispatchesEvents(): void { $project = $this->createMock(Project::class); $project->method('getId')->willReturn(1); @@ -111,7 +111,7 @@ class ProjectServiceTest extends TestCase $sut->updateProject($project); } - public function testCreateNewProjectDispatchesEvents() + public function testCreateNewProjectDispatchesEvents(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $dispatcher->expects($this->exactly(2))->method('dispatch')->willReturnCallback(function ($event) { @@ -134,7 +134,7 @@ class ProjectServiceTest extends TestCase self::assertSame($customer, $project->getCustomer()); } - public function testSaveNewProjectDispatchesEvents() + public function testSaveNewProjectDispatchesEvents(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); $dispatcher->expects($this->exactly(2))->method('dispatch')->willReturnCallback(function ($event) { @@ -156,7 +156,7 @@ class ProjectServiceTest extends TestCase self::assertCount(0, $project->getTeams()); } - public function testCreateNewProjectCopiesTeam() + public function testCreateNewProjectCopiesTeam(): void { $dispatcher = $this->createMock(EventDispatcherInterface::class); @@ -174,7 +174,7 @@ class ProjectServiceTest extends TestCase self::assertCount(2, $project->getTeams()); } - public function testCreateNewProjectWithoutCustomer() + public function testCreateNewProjectWithoutCustomer(): void { $sut = $this->getSut(); diff --git a/tests/Reporting/AbstractDateByUserTest.php b/tests/Reporting/AbstractDateByUserTest.php index 406d6448..476b5b4e 100644 --- a/tests/Reporting/AbstractDateByUserTest.php +++ b/tests/Reporting/AbstractDateByUserTest.php @@ -21,7 +21,7 @@ abstract class AbstractDateByUserTest extends TestCase { abstract protected function createSut(): DateByUser; - public function testEmptyObject() + public function testEmptyObject(): void { $sut = $this->createSut(); self::assertNull($sut->getDate()); @@ -30,7 +30,7 @@ abstract class AbstractDateByUserTest extends TestCase self::assertFalse($sut->isDecimal()); } - public function testSetter() + public function testSetter(): void { $date = new \DateTime('2019-05-27'); $user = new User(); @@ -59,7 +59,7 @@ abstract class AbstractDateByUserTest extends TestCase self::assertFalse($sut->isDecimal()); } - public function testInvalidSumType() + public function testInvalidSumType(): void { $this->expectException(\InvalidArgumentException::class); $sut = $this->createSut(); diff --git a/tests/Reporting/AbstractUserListTest.php b/tests/Reporting/AbstractUserListTest.php index 631c5122..93aa693d 100644 --- a/tests/Reporting/AbstractUserListTest.php +++ b/tests/Reporting/AbstractUserListTest.php @@ -19,7 +19,7 @@ abstract class AbstractUserListTest extends TestCase { abstract protected function createSut(): AbstractUserList; - public function testEmptyObject() + public function testEmptyObject(): void { $sut = $this->createSut(); self::assertNull($sut->getDate()); @@ -27,7 +27,7 @@ abstract class AbstractUserListTest extends TestCase self::assertFalse($sut->isDecimal()); } - public function testSetter() + public function testSetter(): void { $date = new \DateTime('2019-05-27'); @@ -52,7 +52,7 @@ abstract class AbstractUserListTest extends TestCase self::assertFalse($sut->isDecimal()); } - public function testInvalidSumType() + public function testInvalidSumType(): void { $this->expectException(\InvalidArgumentException::class); $sut = $this->createSut(); diff --git a/tests/Reporting/ProjectDateRange/ProjectDateRangeQueryTest.php b/tests/Reporting/ProjectDateRange/ProjectDateRangeQueryTest.php index 973513ec..ec7d3087 100644 --- a/tests/Reporting/ProjectDateRange/ProjectDateRangeQueryTest.php +++ b/tests/Reporting/ProjectDateRange/ProjectDateRangeQueryTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectDateRangeQueryTest extends TestCase { - public function testDefaults() + public function testDefaults(): void { $user = new User(); $date = new \DateTime(); @@ -36,7 +36,7 @@ class ProjectDateRangeQueryTest extends TestCase self::assertTrue($sut->isBudgetIndependent()); } - public function testSetterGetter() + public function testSetterGetter(): void { $sut = new ProjectDateRangeQuery(new \DateTime(), new User()); diff --git a/tests/Reporting/ProjectDetails/ProjectDetailsModelTest.php b/tests/Reporting/ProjectDetails/ProjectDetailsModelTest.php index 5221e6e4..b2b5eb53 100644 --- a/tests/Reporting/ProjectDetails/ProjectDetailsModelTest.php +++ b/tests/Reporting/ProjectDetails/ProjectDetailsModelTest.php @@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectDetailsModelTest extends TestCase { - public function testDefaults() + public function testDefaults(): void { $project = new Project(); $sut = new ProjectDetailsModel($project); @@ -35,7 +35,7 @@ class ProjectDetailsModelTest extends TestCase self::assertNull($sut->getUserYear('2999', new User())); } - public function testGetYearsSorted() + public function testGetYearsSorted(): void { $project = new Project(); $sut = new ProjectDetailsModel($project); diff --git a/tests/Reporting/ProjectDetails/ProjectDetailsQueryTest.php b/tests/Reporting/ProjectDetails/ProjectDetailsQueryTest.php index 9fed7d13..889f377c 100644 --- a/tests/Reporting/ProjectDetails/ProjectDetailsQueryTest.php +++ b/tests/Reporting/ProjectDetails/ProjectDetailsQueryTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectDetailsQueryTest extends TestCase { - public function testDefaults() + public function testDefaults(): void { $user = new User(); $date = new \DateTime(); @@ -30,7 +30,7 @@ class ProjectDetailsQueryTest extends TestCase self::assertNull($sut->getProject()); } - public function testSetterGetter() + public function testSetterGetter(): void { $user = new User(); $date = new \DateTime(); diff --git a/tests/Reporting/ProjectInactive/ProjectInactiveQueryTest.php b/tests/Reporting/ProjectInactive/ProjectInactiveQueryTest.php index 54673acc..1b0b092d 100644 --- a/tests/Reporting/ProjectInactive/ProjectInactiveQueryTest.php +++ b/tests/Reporting/ProjectInactive/ProjectInactiveQueryTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectInactiveQueryTest extends TestCase { - public function testDefaults() + public function testDefaults(): void { $user = new User(); $date = new \DateTime(); @@ -28,7 +28,7 @@ class ProjectInactiveQueryTest extends TestCase self::assertSame($user, $sut->getUser()); } - public function testSetterGetter() + public function testSetterGetter(): void { $user = new User(); $date = new \DateTime(); diff --git a/tests/Reporting/ProjectView/ProjectViewQueryTest.php b/tests/Reporting/ProjectView/ProjectViewQueryTest.php index 87bba955..fbf39c32 100644 --- a/tests/Reporting/ProjectView/ProjectViewQueryTest.php +++ b/tests/Reporting/ProjectView/ProjectViewQueryTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class ProjectViewQueryTest extends TestCase { - public function testDefaults() + public function testDefaults(): void { $user = new User(); $date = new \DateTime(); @@ -33,7 +33,7 @@ class ProjectViewQueryTest extends TestCase self::assertFalse($sut->isIncludeNoWork()); } - public function testSetterGetter() + public function testSetterGetter(): void { $user = new User(); $date = new \DateTime(); diff --git a/tests/Reporting/ReportTest.php b/tests/Reporting/ReportTest.php index 07a5141d..b840e81f 100644 --- a/tests/Reporting/ReportTest.php +++ b/tests/Reporting/ReportTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class ReportTest extends TestCase { - public function testEmptyObject() + public function testEmptyObject(): void { $report = new Report('id', 'route', 'label', 'reporting'); self::assertInstanceOf(ReportInterface::class, $report); diff --git a/tests/Reporting/ReportingServiceTest.php b/tests/Reporting/ReportingServiceTest.php index 056d741d..8844cfae 100644 --- a/tests/Reporting/ReportingServiceTest.php +++ b/tests/Reporting/ReportingServiceTest.php @@ -36,7 +36,7 @@ class ReportingServiceTest extends TestCase return new ReportingService($dispatcher, $security); } - public function testGetAvailableReports() + public function testGetAvailableReports(): void { $sut = $this->getSut(); $reports = $sut->getAvailableReports(new User()); @@ -44,7 +44,7 @@ class ReportingServiceTest extends TestCase self::assertEmpty($reports); } - public function testGetAvailableReportsWithPermission() + public function testGetAvailableReportsWithPermission(): void { $sut = $this->getSut(true); $reports = $sut->getAvailableReports(new User()); diff --git a/tests/Repository/Loader/ActivityLoaderTest.php b/tests/Repository/Loader/ActivityLoaderTest.php index 1acf6cb6..6db7f037 100644 --- a/tests/Repository/Loader/ActivityLoaderTest.php +++ b/tests/Repository/Loader/ActivityLoaderTest.php @@ -17,7 +17,7 @@ use App\Repository\Loader\ActivityLoader; */ class ActivityLoaderTest extends AbstractLoaderTest { - public function testLoadResults() + public function testLoadResults(): void { $em = $this->getEntityManagerMock(3); diff --git a/tests/Repository/Loader/CustomerLoaderTest.php b/tests/Repository/Loader/CustomerLoaderTest.php index 40d53d12..d5918567 100644 --- a/tests/Repository/Loader/CustomerLoaderTest.php +++ b/tests/Repository/Loader/CustomerLoaderTest.php @@ -17,7 +17,7 @@ use App\Repository\Loader\CustomerLoader; */ class CustomerLoaderTest extends AbstractLoaderTest { - public function testLoadResults() + public function testLoadResults(): void { $em = $this->getEntityManagerMock(2); diff --git a/tests/Repository/Loader/DefaultLoaderTest.php b/tests/Repository/Loader/DefaultLoaderTest.php index 4b1644ea..138f82d3 100644 --- a/tests/Repository/Loader/DefaultLoaderTest.php +++ b/tests/Repository/Loader/DefaultLoaderTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class DefaultLoaderTest extends TestCase { - public function testLoadResults() + public function testLoadResults(): void { $sut = new DefaultLoader(); diff --git a/tests/Repository/Loader/InvoiceLoaderTest.php b/tests/Repository/Loader/InvoiceLoaderTest.php index 955bbdbf..5738d9bc 100644 --- a/tests/Repository/Loader/InvoiceLoaderTest.php +++ b/tests/Repository/Loader/InvoiceLoaderTest.php @@ -17,7 +17,7 @@ use App\Repository\Loader\InvoiceLoader; */ class InvoiceLoaderTest extends AbstractLoaderTest { - public function testLoadResults() + public function testLoadResults(): void { $em = $this->getEntityManagerMock(3); diff --git a/tests/Repository/Loader/ProjectLoaderTest.php b/tests/Repository/Loader/ProjectLoaderTest.php index 35165b3d..f541fc8d 100644 --- a/tests/Repository/Loader/ProjectLoaderTest.php +++ b/tests/Repository/Loader/ProjectLoaderTest.php @@ -18,7 +18,7 @@ use App\Repository\Loader\ProjectLoader; */ class ProjectLoaderTest extends AbstractLoaderTest { - public function testLoadResults() + public function testLoadResults(): void { $customer = $this->createMock(Customer::class); $customer->expects($this->once())->method('getId')->willReturn(13); diff --git a/tests/Repository/Loader/TeamLoaderTest.php b/tests/Repository/Loader/TeamLoaderTest.php index c795390d..1540ce6f 100644 --- a/tests/Repository/Loader/TeamLoaderTest.php +++ b/tests/Repository/Loader/TeamLoaderTest.php @@ -17,7 +17,7 @@ use App\Repository\Loader\TeamLoader; */ class TeamLoaderTest extends AbstractLoaderTest { - public function testLoadResults() + public function testLoadResults(): void { $em = $this->getEntityManagerMock(2); diff --git a/tests/Repository/Paginator/QueryBuilderPaginatorTest.php b/tests/Repository/Paginator/QueryBuilderPaginatorTest.php index aa8045c9..5ea43984 100644 --- a/tests/Repository/Paginator/QueryBuilderPaginatorTest.php +++ b/tests/Repository/Paginator/QueryBuilderPaginatorTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; */ class QueryBuilderPaginatorTest extends TestCase { - public function testPaginator() + public function testPaginator(): void { $em = $this->createMock(EntityManager::class); $qb = new QueryBuilder($em); diff --git a/tests/Repository/Query/BaseFormTypeQueryTest.php b/tests/Repository/Query/BaseFormTypeQueryTest.php index 93bb87a9..92bf9e64 100644 --- a/tests/Repository/Query/BaseFormTypeQueryTest.php +++ b/tests/Repository/Query/BaseFormTypeQueryTest.php @@ -22,7 +22,7 @@ use PHPUnit\Framework\TestCase; */ abstract class BaseFormTypeQueryTest extends TestCase { - protected function assertBaseQuery(BaseFormTypeQuery $sut) + public function assertBaseQuery(BaseFormTypeQuery $sut): void { $this->assertActivity($sut); $this->assertProject($sut); @@ -31,7 +31,7 @@ abstract class BaseFormTypeQueryTest extends TestCase $this->assertUser($sut); } - protected function assertUser(BaseFormTypeQuery $sut) + public function assertUser(BaseFormTypeQuery $sut): void { self::assertEmpty($sut->getUser()); $user = new User(); @@ -39,7 +39,7 @@ abstract class BaseFormTypeQueryTest extends TestCase self::assertSame($user, $sut->getUser()); } - protected function assertTeams(BaseFormTypeQuery $sut) + public function assertTeams(BaseFormTypeQuery $sut): void { self::assertEmpty($sut->getTeams()); @@ -57,7 +57,7 @@ abstract class BaseFormTypeQueryTest extends TestCase self::assertCount(2, $sut->getTeams()); } - protected function assertActivity(BaseFormTypeQuery $sut) + public function assertActivity(BaseFormTypeQuery $sut): void { $expected = new Activity(); $expected->setName('foo-bar'); @@ -79,7 +79,7 @@ abstract class BaseFormTypeQueryTest extends TestCase $this->assertFalse($sut->hasActivities()); } - protected function assertCustomer(BaseFormTypeQuery $sut) + public function assertCustomer(BaseFormTypeQuery $sut): void { $expected = new Customer('foo-bar'); @@ -99,7 +99,7 @@ abstract class BaseFormTypeQueryTest extends TestCase $this->assertFalse($sut->hasCustomers()); } - protected function assertProject(BaseFormTypeQuery $sut) + public function assertProject(BaseFormTypeQuery $sut): void { $expected = new Project(); $expected->setName('foo-bar'); diff --git a/tests/Repository/Query/ExportQueryTest.php b/tests/Repository/Query/ExportQueryTest.php index f6a51c01..64192fbc 100644 --- a/tests/Repository/Query/ExportQueryTest.php +++ b/tests/Repository/Query/ExportQueryTest.php @@ -36,7 +36,7 @@ class ExportQueryTest extends TimesheetQueryTest $this->assertMarkAsExported($sut); } - protected function assertMarkAsExported(ExportQuery $sut) + public function assertMarkAsExported(ExportQuery $sut): void { $this->assertTrue($sut->isMarkAsExported()); @@ -44,7 +44,7 @@ class ExportQueryTest extends TimesheetQueryTest $this->assertFalse($sut->isMarkAsExported()); } - protected function assertRenderer(ExportQuery $sut) + public function assertRenderer(ExportQuery $sut): void { $this->assertNull($sut->getRenderer()); diff --git a/tests/Repository/Query/TeamQueryTest.php b/tests/Repository/Query/TeamQueryTest.php index 1b10775a..1deafcdc 100644 --- a/tests/Repository/Query/TeamQueryTest.php +++ b/tests/Repository/Query/TeamQueryTest.php @@ -29,7 +29,7 @@ class TeamQueryTest extends BaseQueryTest $this->assertResetByFormError(new TeamQuery(), 'name'); } - protected function assertUsers(TeamQuery $sut) + public function assertUsers(TeamQuery $sut): void { $this->assertEmpty($sut->getUsers()); diff --git a/tests/Repository/Result/TimesheetResultStatisticTest.php b/tests/Repository/Result/TimesheetResultStatisticTest.php index 7b4c951d..0453a897 100644 --- a/tests/Repository/Result/TimesheetResultStatisticTest.php +++ b/tests/Repository/Result/TimesheetResultStatisticTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetResultStatisticTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $sut = new TimesheetResultStatistic(13, 7705); self::assertSame(13, $sut->getCount()); diff --git a/tests/Repository/TagRepositoryTest.php b/tests/Repository/TagRepositoryTest.php index 80385547..97d727de 100644 --- a/tests/Repository/TagRepositoryTest.php +++ b/tests/Repository/TagRepositoryTest.php @@ -28,7 +28,7 @@ class TagRepositoryTest extends AbstractRepositoryTest $this->importFixture($data); } - public function testFindAllTagNames() + public function testFindAllTagNames(): void { $em = $this->getEntityManager(); /** @var TagRepository $repository */ @@ -46,7 +46,7 @@ class TagRepositoryTest extends AbstractRepositoryTest $this->assertEquals('#2018-012', $result[5]); } - public function testFindNoTagNames() + public function testFindNoTagNames(): void { $em = $this->getEntityManager(); /** @var TagRepository $repository */ diff --git a/tests/Repository/TimesheetInvoiceItemRepositoryTest.php b/tests/Repository/TimesheetInvoiceItemRepositoryTest.php index 520c1dfe..0082a26d 100644 --- a/tests/Repository/TimesheetInvoiceItemRepositoryTest.php +++ b/tests/Repository/TimesheetInvoiceItemRepositoryTest.php @@ -22,7 +22,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetInvoiceItemRepositoryTest extends TestCase { - public function testSetExported() + public function testSetExported(): void { $repository = $this->createMock(TimesheetRepository::class); $repository->expects($this->once())->method('setExported')->willReturnCallback(function (array $items) { diff --git a/tests/Repository/TimesheetRepositoryTest.php b/tests/Repository/TimesheetRepositoryTest.php index f8124beb..b7a213fb 100644 --- a/tests/Repository/TimesheetRepositoryTest.php +++ b/tests/Repository/TimesheetRepositoryTest.php @@ -26,7 +26,7 @@ use App\Utils\Pagination; */ class TimesheetRepositoryTest extends AbstractRepositoryTest { - public function testResultTypeForQueryState() + public function testResultTypeForQueryState(): void { $em = $this->getEntityManager(); /** @var TimesheetRepository $repository */ @@ -41,7 +41,7 @@ class TimesheetRepositoryTest extends AbstractRepositoryTest $this->assertIsArray($result); } - public function testSave() + public function testSave(): void { $em = $this->getEntityManager(); /** @var ActivityRepository $activityRepository */ @@ -68,7 +68,7 @@ class TimesheetRepositoryTest extends AbstractRepositoryTest $this->assertNotNull($timesheet->getId()); } - public function testSaveWithTags() + public function testSaveWithTags(): void { $em = $this->getEntityManager(); /** @var ActivityRepository $activityRepository */ diff --git a/tests/Saml/SamlBadgeTest.php b/tests/Saml/SamlBadgeTest.php index 8cf07eec..b6871fe1 100644 --- a/tests/Saml/SamlBadgeTest.php +++ b/tests/Saml/SamlBadgeTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class SamlBadgeTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $attributes = new SamlLoginAttributes(); $sut = new SamlBadge($attributes); diff --git a/tests/Saml/SamlLogoutSubscriberTest.php b/tests/Saml/SamlLogoutSubscriberTest.php index 5ff06b85..99e0de84 100644 --- a/tests/Saml/SamlLogoutSubscriberTest.php +++ b/tests/Saml/SamlLogoutSubscriberTest.php @@ -25,7 +25,7 @@ use Symfony\Component\Security\Http\Event\LogoutEvent; */ class SamlLogoutSubscriberTest extends TestCase { - public function testLogout() + public function testLogout(): void { $auth = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock(); $auth->expects($this->once())->method('processSLO')->willThrowException(new Error('blub')); @@ -41,7 +41,7 @@ class SamlLogoutSubscriberTest extends TestCase $sut->logout(new LogoutEvent($request, $token)); } - public function testLogoutWithWrongTokenWillNotCallMethods() + public function testLogoutWithWrongTokenWillNotCallMethods(): void { $auth = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock(); $auth->expects($this->never())->method('processSLO'); @@ -57,7 +57,7 @@ class SamlLogoutSubscriberTest extends TestCase $sut->logout(new LogoutEvent($request, $token)); } - public function testLogoutWithLogoutUrl() + public function testLogoutWithLogoutUrl(): void { $auth = $this->getMockBuilder(Auth::class)->disableOriginalConstructor()->getMock(); $auth->expects($this->once())->method('processSLO')->willThrowException(new Error('blub')); diff --git a/tests/Saml/SamlProviderTest.php b/tests/Saml/SamlProviderTest.php index daf9af12..1a7f2ce0 100644 --- a/tests/Saml/SamlProviderTest.php +++ b/tests/Saml/SamlProviderTest.php @@ -62,7 +62,7 @@ class SamlProviderTest extends TestCase return $provider; } - public function testFindUserHydratesUser() + public function testFindUserHydratesUser(): void { $user = new User(); $user->setAuth(User::AUTH_INTERNAL); @@ -86,7 +86,7 @@ class SamlProviderTest extends TestCase self::assertEquals('foo@example.com', $tokenUser->getEmail()); } - public function testFindUserCreatesNewUser() + public function testFindUserCreatesNewUser(): void { $token = new SamlLoginAttributes(); $token->setUserIdentifier('foo2@example.com'); @@ -104,7 +104,7 @@ class SamlProviderTest extends TestCase self::assertEquals('foo@example.com', $tokenUser->getEmail()); } - public function testAuthenticateThrowsAuthenticationException() + public function testAuthenticateThrowsAuthenticationException(): void { $this->expectException(AuthenticationException::class); $this->expectExceptionMessage('Failed creating or hydrating user "foo1@example.com": Missing user attribute: Email'); diff --git a/tests/Saml/SamlTokenTest.php b/tests/Saml/SamlTokenTest.php index 6e13d85d..8aaa7435 100644 --- a/tests/Saml/SamlTokenTest.php +++ b/tests/Saml/SamlTokenTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class SamlTokenTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $user = new User(); $user->setUserIdentifier('foo'); diff --git a/tests/Saml/Security/SamlAuthenticationSuccessHandlerTest.php b/tests/Saml/Security/SamlAuthenticationSuccessHandlerTest.php index 979453a7..4fb80752 100644 --- a/tests/Saml/Security/SamlAuthenticationSuccessHandlerTest.php +++ b/tests/Saml/Security/SamlAuthenticationSuccessHandlerTest.php @@ -22,7 +22,7 @@ use Symfony\Component\Security\Http\HttpUtils; */ class SamlAuthenticationSuccessHandlerTest extends TestCase { - public function testWithAlwaysUseDefaultTargetPath() + public function testWithAlwaysUseDefaultTargetPath(): void { $httpUtils = new HttpUtils($this->getUrlGenerator()); $handler = new SamlAuthenticationSuccessHandler($httpUtils, ['always_use_default_target_path' => true]); @@ -32,7 +32,7 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase $this->assertTrue($response->isRedirect($defaultTargetPath)); } - public function testRelayState() + public function testRelayState(): void { $handler = new SamlAuthenticationSuccessHandler(new HttpUtils($this->getUrlGenerator()), ['always_use_default_target_path' => false]); $response = $handler->onAuthenticationSuccess($this->getRequest('/sso/login', 'http://localhost/relayed'), $this->getSamlToken()); @@ -40,7 +40,7 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase $this->assertTrue($response->isRedirect('http://localhost/relayed')); } - public function testWithoutRelayState() + public function testWithoutRelayState(): void { $httpUtils = new HttpUtils($this->getUrlGenerator()); $handler = new SamlAuthenticationSuccessHandler($httpUtils, ['always_use_default_target_path' => false]); @@ -50,7 +50,7 @@ class SamlAuthenticationSuccessHandlerTest extends TestCase $this->assertTrue($response->isRedirect($defaultTargetPath)); } - public function testRelayStateLoop() + public function testRelayStateLoop(): void { $httpUtils = new HttpUtils($this->getUrlGenerator()); $handler = new SamlAuthenticationSuccessHandler($httpUtils, ['always_use_default_target_path' => false]); diff --git a/tests/Security/AclDecisionManagerTest.php b/tests/Security/AclDecisionManagerTest.php index 012bb016..478e9acd 100644 --- a/tests/Security/AclDecisionManagerTest.php +++ b/tests/Security/AclDecisionManagerTest.php @@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface */ class AclDecisionManagerTest extends TestCase { - public function testFullyAuthenticated() + public function testFullyAuthenticated(): void { $manager = $this->createMock(AccessDecisionManagerInterface::class); $manager->expects($this->once())->method('decide')->willReturn(true); @@ -31,7 +31,7 @@ class AclDecisionManagerTest extends TestCase self::assertTrue($result); } - public function testIsNotFullyAuthenticated() + public function testIsNotFullyAuthenticated(): void { $manager = $this->createMock(AccessDecisionManagerInterface::class); $manager->expects($this->once())->method('decide')->willReturn(false); diff --git a/tests/Security/RolePermissionManagerTest.php b/tests/Security/RolePermissionManagerTest.php index 52af7aff..e89e37b3 100644 --- a/tests/Security/RolePermissionManagerTest.php +++ b/tests/Security/RolePermissionManagerTest.php @@ -21,7 +21,7 @@ use Symfony\Component\Cache\Adapter\ArrayAdapter; */ class RolePermissionManagerTest extends TestCase { - public function testWithEmptyRepository() + public function testWithEmptyRepository(): void { $repository = $this->getMockBuilder(RolePermissionRepository::class)->onlyMethods(['getAllAsArray'])->disableOriginalConstructor()->getMock(); $repository->method('getAllAsArray')->willReturn([]); @@ -34,7 +34,7 @@ class RolePermissionManagerTest extends TestCase self::assertFalse($sut->hasPermission('TEST_ROLE', 'foo')); } - public function testWithRepositoryData() + public function testWithRepositoryData(): void { $repository = $this->getMockBuilder(RolePermissionRepository::class)->onlyMethods(['getAllAsArray'])->disableOriginalConstructor()->getMock(); $repository->method('getAllAsArray')->willReturn([ @@ -57,7 +57,7 @@ class RolePermissionManagerTest extends TestCase self::assertTrue($sut->hasPermission('USER_ROLE', 'bar')); } - public function testWithConfigData() + public function testWithConfigData(): void { $repository = $this->getMockBuilder(RolePermissionRepository::class)->onlyMethods(['getAllAsArray'])->disableOriginalConstructor()->getMock(); $repository->method('getAllAsArray')->willReturn([]); @@ -76,7 +76,7 @@ class RolePermissionManagerTest extends TestCase self::assertTrue($sut->hasPermission('USER_ROLE', 'bar')); } - public function testWithMixedData() + public function testWithMixedData(): void { $repository = $this->getMockBuilder(RolePermissionRepository::class)->onlyMethods(['getAllAsArray'])->disableOriginalConstructor()->getMock(); $repository->method('getAllAsArray')->willReturn([ diff --git a/tests/Security/RoleServiceTest.php b/tests/Security/RoleServiceTest.php index bfe9b496..2f724141 100644 --- a/tests/Security/RoleServiceTest.php +++ b/tests/Security/RoleServiceTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class RoleServiceTest extends TestCase { - public function testWithEmptyRepository() + public function testWithEmptyRepository(): void { $real = [ 'ROLE_USER', @@ -35,7 +35,7 @@ class RoleServiceTest extends TestCase self::assertEquals($real, $sut->getSystemRoles()); } - public function testWithRepositoryData() + public function testWithRepositoryData(): void { $real = [ 'ROLE_TEAMLEAD', diff --git a/tests/Security/SessionHandlerTest.php b/tests/Security/SessionHandlerTest.php index dd6afa7e..0e5669b6 100644 --- a/tests/Security/SessionHandlerTest.php +++ b/tests/Security/SessionHandlerTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class SessionHandlerTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $sut = new SessionHandler($this->createMock(Connection::class)); diff --git a/tests/Security/UserCheckerTest.php b/tests/Security/UserCheckerTest.php index 5c76095f..203f8c4f 100644 --- a/tests/Security/UserCheckerTest.php +++ b/tests/Security/UserCheckerTest.php @@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Exception\DisabledException; */ class UserCheckerTest extends TestCase { - public function testCheckPreAuthReturnsOnUnknownUserClass() + public function testCheckPreAuthReturnsOnUnknownUserClass(): void { $sut = new UserChecker(); @@ -31,7 +31,7 @@ class UserCheckerTest extends TestCase $this->assertTrue(true); } - public function testCheckPostAuthReturnsOnUnknownUserClass() + public function testCheckPostAuthReturnsOnUnknownUserClass(): void { $sut = new UserChecker(); @@ -43,7 +43,7 @@ class UserCheckerTest extends TestCase $this->assertTrue(true); } - public function testDisabledCannotLoginInCheckPreAuth() + public function testDisabledCannotLoginInCheckPreAuth(): void { $this->expectException(DisabledException::class); $this->expectExceptionMessage('User account is disabled.'); @@ -51,7 +51,7 @@ class UserCheckerTest extends TestCase (new UserChecker())->checkPreAuth((new User())->setEnabled(false)); } - public function testDisabledCannotLoginInCheckPostAuth() + public function testDisabledCannotLoginInCheckPostAuth(): void { $this->expectException(DisabledException::class); $this->expectExceptionMessage('User account is disabled.'); diff --git a/tests/Timesheet/Calculator/BillableCalculatorTest.php b/tests/Timesheet/Calculator/BillableCalculatorTest.php index 5a0ae205..e16c8941 100644 --- a/tests/Timesheet/Calculator/BillableCalculatorTest.php +++ b/tests/Timesheet/Calculator/BillableCalculatorTest.php @@ -24,7 +24,7 @@ class BillableCalculatorTest extends TestCase /** * @dataProvider getTestData */ - public function testCalculate(bool $billable, string $mode, bool $expected, ?Customer $customer, ?Project $project, ?Activity $activity) + public function testCalculate(bool $billable, string $mode, bool $expected, ?Customer $customer, ?Project $project, ?Activity $activity): void { $sut = new BillableCalculator(); diff --git a/tests/Timesheet/Calculator/DurationCalculatorTest.php b/tests/Timesheet/Calculator/DurationCalculatorTest.php index 85be3cf5..a2818de8 100644 --- a/tests/Timesheet/Calculator/DurationCalculatorTest.php +++ b/tests/Timesheet/Calculator/DurationCalculatorTest.php @@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase; */ class DurationCalculatorTest extends TestCase { - public function testCalculateWithEmptyEnd() + public function testCalculateWithEmptyEnd(): void { $record = new Timesheet(); $record->setBegin(new \DateTime()); @@ -34,7 +34,7 @@ class DurationCalculatorTest extends TestCase /** * @dataProvider getTestData */ - public function testCalculate($rules, $start, $end, $expectedDuration) + public function testCalculate($rules, $start, $end, $expectedDuration): void { $record = new Timesheet(); $record->setBegin($start); diff --git a/tests/Timesheet/Calculator/RateCalculatorTest.php b/tests/Timesheet/Calculator/RateCalculatorTest.php index 1660ec4e..6852aba0 100644 --- a/tests/Timesheet/Calculator/RateCalculatorTest.php +++ b/tests/Timesheet/Calculator/RateCalculatorTest.php @@ -38,7 +38,7 @@ class RateCalculatorTest extends TestCase return $mock; } - public function testCalculateWithTimesheetHourlyRate() + public function testCalculateWithTimesheetHourlyRate(): void { $record = new Timesheet(); $record->setEnd(new \DateTime()); @@ -52,7 +52,7 @@ class RateCalculatorTest extends TestCase $this->assertEquals(50, $record->getRate()); } - public function testCalculateWithTimesheetFixedRate() + public function testCalculateWithTimesheetFixedRate(): void { $record = new Timesheet(); $record->setEnd(new \DateTime()); @@ -192,7 +192,7 @@ class RateCalculatorTest extends TestCase return $user; } - public function testCalculateWithEmptyEnd() + public function testCalculateWithEmptyEnd(): void { $record = new Timesheet(); $record->setBegin(new \DateTime()); @@ -213,7 +213,7 @@ class RateCalculatorTest extends TestCase * * @dataProvider getRuleDefinitions */ - public function testCalculateWithRulesByUsersHourlyRate($duration, $rules, $expectedRate) + public function testCalculateWithRulesByUsersHourlyRate($duration, $rules, $expectedRate): void { $end = new \DateTime('12:00:00', new \DateTimeZone('UTC')); $start = clone $end; diff --git a/tests/Timesheet/DateTimeFactoryTest.php b/tests/Timesheet/DateTimeFactoryTest.php index 014da762..69407ce1 100644 --- a/tests/Timesheet/DateTimeFactoryTest.php +++ b/tests/Timesheet/DateTimeFactoryTest.php @@ -30,19 +30,19 @@ class DateTimeFactoryTest extends TestCase return new DateTimeFactory(new DateTimeZone($timezone), $sunday); } - public function testGetTimezone() + public function testGetTimezone(): void { $sut = $this->createDateTimeFactory(self::TEST_TIMEZONE); $this->assertEquals(self::TEST_TIMEZONE, $sut->getTimezone()->getName()); } - public function testGetTimezoneWithFallbackTimezone() + public function testGetTimezoneWithFallbackTimezone(): void { $sut = $this->createDateTimeFactory(); $this->assertEquals(date_default_timezone_get(), $sut->getTimezone()->getName()); } - public function testGetStartOfMonth() + public function testGetStartOfMonth(): void { $expected = new DateTime('now', new DateTimeZone(self::TEST_TIMEZONE)); @@ -57,7 +57,7 @@ class DateTimeFactoryTest extends TestCase $this->assertEquals(self::TEST_TIMEZONE, $dateTime->getTimezone()->getName()); } - public function testGetEndOfMonth() + public function testGetEndOfMonth(): void { $expected = new DateTime('last day of this month', new DateTimeZone(self::TEST_TIMEZONE)); @@ -82,7 +82,7 @@ class DateTimeFactoryTest extends TestCase /** * @dataProvider getStartOfWeekData */ - public function testGetStartOfWeek(DateTimeFactory $sut, string $dayName, int $dayNum, int $day) + public function testGetStartOfWeek(DateTimeFactory $sut, string $dayName, int $dayNum, int $day): void { $expected = new DateTime('2018-07-26 16:47:31', new DateTimeZone(self::TEST_TIMEZONE)); @@ -119,7 +119,7 @@ class DateTimeFactoryTest extends TestCase /** * @dataProvider getEndOfWeekData */ - public function testGetEndOfWeek(DateTimeFactory $sut, string $dayName, int $dayNum, int $day) + public function testGetEndOfWeek(DateTimeFactory $sut, string $dayName, int $dayNum, int $day): void { $expected = new DateTime('2018-07-26 16:47:31', new DateTimeZone(self::TEST_TIMEZONE)); @@ -146,7 +146,7 @@ class DateTimeFactoryTest extends TestCase $this->assertEquals(self::TEST_TIMEZONE, $dateTime->getTimezone()->getName()); } - public function testCreateDateTime() + public function testCreateDateTime(): void { $sut = $this->createDateTimeFactory(self::TEST_TIMEZONE); $dateTime = $sut->createDateTime('2015-07-24 13:45:21'); @@ -159,7 +159,7 @@ class DateTimeFactoryTest extends TestCase $this->assertEquals(self::TEST_TIMEZONE, $dateTime->getTimezone()->getName()); } - public function testCreateDateTimeWithDefaultValue() + public function testCreateDateTimeWithDefaultValue(): void { $expected = new DateTime('now', new DateTimeZone(self::TEST_TIMEZONE)); @@ -170,7 +170,7 @@ class DateTimeFactoryTest extends TestCase $this->assertTrue(2 >= $difference); } - public function testCreateStartOfFinancialYearWithoutConfig() + public function testCreateStartOfFinancialYearWithoutConfig(): void { $sut = $this->createDateTimeFactory(self::TEST_TIMEZONE); $dateTime = $sut->createStartOfFinancialYear(); @@ -179,7 +179,7 @@ class DateTimeFactoryTest extends TestCase self::assertEquals($expected, $dateTime); } - public function testCreateStartOfFinancialYearWithConfig() + public function testCreateStartOfFinancialYearWithConfig(): void { $sut = $this->createDateTimeFactory(self::TEST_TIMEZONE); @@ -199,7 +199,7 @@ class DateTimeFactoryTest extends TestCase self::assertEquals($past, $financial); } - public function testCreateEndOfFinancialYearWithConfig() + public function testCreateEndOfFinancialYearWithConfig(): void { $sut = $this->createDateTimeFactory(self::TEST_TIMEZONE); @@ -218,7 +218,7 @@ class DateTimeFactoryTest extends TestCase self::assertEquals($expected, $end); } - public function testCreateStartOfYear() + public function testCreateStartOfYear(): void { $sut = $this->createDateTimeFactory(self::TEST_TIMEZONE); @@ -239,7 +239,7 @@ class DateTimeFactoryTest extends TestCase self::assertEquals('00:00:00', $year->format('H:i:s')); } - public function testCreateEndOfYear() + public function testCreateEndOfYear(): void { $sut = $this->createDateTimeFactory(self::TEST_TIMEZONE); diff --git a/tests/Timesheet/RateServiceTest.php b/tests/Timesheet/RateServiceTest.php index 3b52a4ef..85802e7c 100644 --- a/tests/Timesheet/RateServiceTest.php +++ b/tests/Timesheet/RateServiceTest.php @@ -42,7 +42,7 @@ class RateServiceTest extends TestCase return new \DateTime($datetime ?? 'now', new \DateTimeZone('UTC')); } - public function testCalculateWithTimesheetHourlyRate() + public function testCalculateWithTimesheetHourlyRate(): void { $record = new Timesheet(); $record->setEnd($this->createDateTime()); @@ -56,7 +56,7 @@ class RateServiceTest extends TestCase $this->assertEquals(50, $rate->getRate()); } - public function testCalculateWithTimesheetFixedRate() + public function testCalculateWithTimesheetFixedRate(): void { $record = new Timesheet(); $record->setEnd($this->createDateTime()); @@ -196,7 +196,7 @@ class RateServiceTest extends TestCase return $user; } - public function testCalculateWithEmptyEnd() + public function testCalculateWithEmptyEnd(): void { $record = new Timesheet(); $record->setBegin($this->createDateTime()); @@ -217,7 +217,7 @@ class RateServiceTest extends TestCase * * @dataProvider getRuleDefinitions */ - public function testCalculateWithRulesByUsersHourlyRate($duration, $rules, $expectedRate) + public function testCalculateWithRulesByUsersHourlyRate($duration, $rules, $expectedRate): void { $end = $this->createDateTime('12:00:00'); $start = clone $end; diff --git a/tests/Timesheet/Rounding/CeilRoundingTest.php b/tests/Timesheet/Rounding/CeilRoundingTest.php index 78a3aef5..29c74f40 100644 --- a/tests/Timesheet/Rounding/CeilRoundingTest.php +++ b/tests/Timesheet/Rounding/CeilRoundingTest.php @@ -21,7 +21,7 @@ class CeilRoundingTest extends TestCase /** * @dataProvider getTestData */ - public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration) + public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration): void { $record = new Timesheet(); $record->setBegin($start); diff --git a/tests/Timesheet/Rounding/ClosestRoundingTest.php b/tests/Timesheet/Rounding/ClosestRoundingTest.php index ff257656..a4183d9d 100644 --- a/tests/Timesheet/Rounding/ClosestRoundingTest.php +++ b/tests/Timesheet/Rounding/ClosestRoundingTest.php @@ -21,7 +21,7 @@ class ClosestRoundingTest extends TestCase /** * @dataProvider getTestData */ - public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration) + public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration): void { $record = new Timesheet(); $record->setBegin($start); diff --git a/tests/Timesheet/Rounding/DefaultRoundingTest.php b/tests/Timesheet/Rounding/DefaultRoundingTest.php index 868b5c9e..08ac613e 100644 --- a/tests/Timesheet/Rounding/DefaultRoundingTest.php +++ b/tests/Timesheet/Rounding/DefaultRoundingTest.php @@ -21,7 +21,7 @@ class DefaultRoundingTest extends TestCase /** * @dataProvider getTestData */ - public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration) + public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration): void { $record = new Timesheet(); $record->setBegin($start); diff --git a/tests/Timesheet/Rounding/FloorRoundingTest.php b/tests/Timesheet/Rounding/FloorRoundingTest.php index 19a506f4..d898fb88 100644 --- a/tests/Timesheet/Rounding/FloorRoundingTest.php +++ b/tests/Timesheet/Rounding/FloorRoundingTest.php @@ -21,7 +21,7 @@ class FloorRoundingTest extends TestCase /** * @dataProvider getTestData */ - public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration) + public function testCalculate($roundBegin, $roundEnd, $roundDuration, \DateTime $start, \DateTime $end, \DateTime $expectedStart, \DateTime $expectedEnd, $expectedDuration): void { $record = new Timesheet(); $record->setBegin($start); diff --git a/tests/Timesheet/RoundingServiceTest.php b/tests/Timesheet/RoundingServiceTest.php index 9ef2bafc..a2e46293 100644 --- a/tests/Timesheet/RoundingServiceTest.php +++ b/tests/Timesheet/RoundingServiceTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class RoundingServiceTest extends TestCase { - public function testCalculateWithEmptyEnd() + public function testCalculateWithEmptyEnd(): void { $record = new Timesheet(); $record->setBegin(new \DateTime()); @@ -32,7 +32,7 @@ class RoundingServiceTest extends TestCase /** * @dataProvider getTestData */ - public function testCalculate($rules, $start, $end, $expectedStart, $expectedEnd, $expectedDuration) + public function testCalculate($rules, $start, $end, $expectedStart, $expectedEnd, $expectedDuration): void { $record = new Timesheet(); $record->setBegin($start); diff --git a/tests/Timesheet/TimesheetServiceTest.php b/tests/Timesheet/TimesheetServiceTest.php index 0681b838..c9784bbe 100644 --- a/tests/Timesheet/TimesheetServiceTest.php +++ b/tests/Timesheet/TimesheetServiceTest.php @@ -65,7 +65,7 @@ class TimesheetServiceTest extends TestCase return $service; } - public function testCannotSavePersistedTimesheetAsNew() + public function testCannotSavePersistedTimesheetAsNew(): void { $timesheet = $this->createMock(Timesheet::class); $timesheet->expects($this->once())->method('getId')->willReturn(1); @@ -78,7 +78,7 @@ class TimesheetServiceTest extends TestCase $sut->saveNewTimesheet($timesheet); } - public function testCannotStartTimesheet() + public function testCannotStartTimesheet(): void { $authorizationChecker = $this->createMock(AuthorizationCheckerInterface::class); $authorizationChecker->expects($this->once())->method('isGranted')->willReturn(false); @@ -91,7 +91,7 @@ class TimesheetServiceTest extends TestCase $sut->saveNewTimesheet(new Timesheet()); } - public function testSaveNewTimesheetHasValidationError() + public function testSaveNewTimesheetHasValidationError(): void { $authorizationChecker = $this->createMock(AuthorizationCheckerInterface::class); $authorizationChecker->expects($this->once())->method('isGranted')->willReturn(true); @@ -110,7 +110,7 @@ class TimesheetServiceTest extends TestCase $sut->saveNewTimesheet(new Timesheet()); } - public function testSaveNewTimesheetStopsActiveRecords() + public function testSaveNewTimesheetStopsActiveRecords(): void { $authorizationChecker = $this->createMock(AuthorizationCheckerInterface::class); $authorizationChecker->expects($this->once())->method('isGranted')->willReturn(true); @@ -137,7 +137,7 @@ class TimesheetServiceTest extends TestCase $sut->saveNewTimesheet($newTimesheet); } - public function testSaveNewTimesheetFixesTimezone() + public function testSaveNewTimesheetFixesTimezone(): void { $user = new User(); $user->setTimezone('Europe/Paris'); @@ -160,7 +160,7 @@ class TimesheetServiceTest extends TestCase self::assertEquals('Europe/Paris', $timesheet->getTimezone()); } - public function testUpdateTimesheetFixesTimezone() + public function testUpdateTimesheetFixesTimezone(): void { $user = new User(); $user->setTimezone('Europe/Paris'); @@ -181,7 +181,7 @@ class TimesheetServiceTest extends TestCase self::assertEquals('Europe/Paris', $timesheet->getTimezone()); } - public function testCannotRestartedPersistedTimesheet() + public function testCannotRestartedPersistedTimesheet(): void { $timesheet = $this->createMock(Timesheet::class); $timesheet->expects($this->once())->method('getId')->willReturn(1); @@ -201,7 +201,7 @@ class TimesheetServiceTest extends TestCase $sut->restartTimesheet($timesheet, new Timesheet()); } - public function testRestartTimesheetDispatchesTwoEvents() + public function testRestartTimesheetDispatchesTwoEvents(): void { $timesheet = $this->createMock(Timesheet::class); $authorizationChecker = $this->createMock(AuthorizationCheckerInterface::class); @@ -233,7 +233,7 @@ class TimesheetServiceTest extends TestCase $sut->restartTimesheet($timesheet, new Timesheet()); } - public function testPreparePersistedTimesheetAsNew() + public function testPreparePersistedTimesheetAsNew(): void { $timesheet = $this->createMock(Timesheet::class); $timesheet->expects($this->once())->method('getId')->willReturn(1); @@ -246,7 +246,7 @@ class TimesheetServiceTest extends TestCase $sut->prepareNewTimesheet($timesheet); } - public function testStoppedEntriesCannotBeStoppedAgain() + public function testStoppedEntriesCannotBeStoppedAgain(): void { $dateTime = new \DateTime('-2 hours'); $timesheet = new Timesheet(); @@ -259,7 +259,7 @@ class TimesheetServiceTest extends TestCase self::assertSame($dateTime->getTimestamp(), $timesheet->getEnd()->getTimestamp()); } - public function testStopSetsEnd() + public function testStopSetsEnd(): void { $dateTime = new \DateTime('-2 hours'); $timesheet = new Timesheet(); @@ -273,7 +273,7 @@ class TimesheetServiceTest extends TestCase self::assertNotNull($timesheet->getEnd()); } - public function testDeleteDispatchesEvent() + public function testDeleteDispatchesEvent(): void { $timesheet = new Timesheet(); @@ -291,7 +291,7 @@ class TimesheetServiceTest extends TestCase $sut->deleteTimesheet($timesheet); } - public function testDeleteMultipleDispatchesEvent() + public function testDeleteMultipleDispatchesEvent(): void { $timesheets = [new Timesheet(), new Timesheet()]; diff --git a/tests/Timesheet/TrackingMode/AbstractTrackingModeTest.php b/tests/Timesheet/TrackingMode/AbstractTrackingModeTest.php index 2c83deaa..758dc7ec 100644 --- a/tests/Timesheet/TrackingMode/AbstractTrackingModeTest.php +++ b/tests/Timesheet/TrackingMode/AbstractTrackingModeTest.php @@ -33,12 +33,12 @@ abstract class AbstractTrackingModeTest extends TestCase return $timesheet; } - protected function assertDefaultBegin(Timesheet $timesheet) + public function assertDefaultBegin(Timesheet $timesheet): void { self::assertNull($timesheet->getBegin()); } - public function testCreateDoesNotChangeAnythingOnEmptyRequest() + public function testCreateDoesNotChangeAnythingOnEmptyRequest(): void { $sut = $this->createSut(); @@ -53,7 +53,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertNull($timesheet->getEnd()); } - public function testCreateUseBeginWithoutEndDateFromRequest() + public function testCreateUseBeginWithoutEndDateFromRequest(): void { $sut = $this->createSut(); @@ -70,7 +70,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(0, $timesheet->getDuration()); } - public function testCreateUseBeginEndDateFromRequest() + public function testCreateUseBeginEndDateFromRequest(): void { $sut = $this->createSut(); @@ -90,7 +90,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(28800, $timesheet->getDuration()); } - public function testCreateIgnoresValidEndOnInvalidBeginDateFromRequest() + public function testCreateIgnoresValidEndOnInvalidBeginDateFromRequest(): void { $sut = $this->createSut(); @@ -107,7 +107,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(0, $timesheet->getDuration()); } - public function testCreateUsesBeginAndIgnoresInvalidEndDateFromRequest() + public function testCreateUsesBeginAndIgnoresInvalidEndDateFromRequest(): void { $sut = $this->createSut(); @@ -125,7 +125,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(0, $timesheet->getDuration()); } - public function testCreateUseFromWithoutToDatetimeFromRequest() + public function testCreateUseFromWithoutToDatetimeFromRequest(): void { $sut = $this->createSut(); @@ -141,7 +141,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(0, $timesheet->getDuration()); } - public function testCreateUseFromToDatetimeFromRequest() + public function testCreateUseFromToDatetimeFromRequest(): void { $sut = $this->createSut(); @@ -161,7 +161,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(12196, $timesheet->getDuration()); } - public function testCreateUseFromToDatetimeOverwritesBeginEndTatesFromRequest() + public function testCreateUseFromToDatetimeOverwritesBeginEndTatesFromRequest(): void { $sut = $this->createSut(); @@ -183,7 +183,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(12196, $timesheet->getDuration()); } - public function testCreateIgnoresValidToOnInvalidFromDatetimeFromRequest() + public function testCreateIgnoresValidToOnInvalidFromDatetimeFromRequest(): void { $sut = $this->createSut(); @@ -200,7 +200,7 @@ abstract class AbstractTrackingModeTest extends TestCase self::assertEquals(0, $timesheet->getDuration()); } - public function testCreateUsesFromAndIgnoresInvalidToDatetimeFromRequest() + public function testCreateUsesFromAndIgnoresInvalidToDatetimeFromRequest(): void { $sut = $this->createSut(); diff --git a/tests/Timesheet/TrackingMode/DefaultModeTest.php b/tests/Timesheet/TrackingMode/DefaultModeTest.php index c33e2d26..fb3841da 100644 --- a/tests/Timesheet/TrackingMode/DefaultModeTest.php +++ b/tests/Timesheet/TrackingMode/DefaultModeTest.php @@ -18,7 +18,7 @@ use App\Timesheet\TrackingMode\DefaultMode; */ class DefaultModeTest extends AbstractTrackingModeTest { - protected function assertDefaultBegin(Timesheet $timesheet) + public function assertDefaultBegin(Timesheet $timesheet): void { self::assertNotNull($timesheet->getBegin()); self::assertInstanceOf(\DateTime::class, $timesheet->getBegin()); @@ -32,7 +32,7 @@ class DefaultModeTest extends AbstractTrackingModeTest return new DefaultMode((new RoundingServiceFactory($this))->create()); } - public function testDefaultValues() + public function testDefaultValues(): void { $sut = $this->createSut(); diff --git a/tests/Timesheet/TrackingMode/DurationFixedBeginModeTest.php b/tests/Timesheet/TrackingMode/DurationFixedBeginModeTest.php index 8f9adbab..9a4adfeb 100644 --- a/tests/Timesheet/TrackingMode/DurationFixedBeginModeTest.php +++ b/tests/Timesheet/TrackingMode/DurationFixedBeginModeTest.php @@ -30,7 +30,7 @@ class DurationFixedBeginModeTest extends TestCase return new DurationFixedBeginMode($configuration); } - public function testDefaultValues() + public function testDefaultValues(): void { $sut = $this->createSut(); @@ -42,7 +42,7 @@ class DurationFixedBeginModeTest extends TestCase self::assertEquals('duration_fixed_begin', $sut->getId()); } - public function testNow() + public function testNow(): void { $seconds = (new \DateTime())->getTimestamp(); $timesheet = new Timesheet(); @@ -54,7 +54,7 @@ class DurationFixedBeginModeTest extends TestCase self::assertLessThanOrEqual(2, $diff); } - public function testCreate() + public function testCreate(): void { $timesheet = new Timesheet(); $timesheet->setBegin(new \DateTime('22:54')); @@ -66,7 +66,7 @@ class DurationFixedBeginModeTest extends TestCase self::assertEquals('13:47', $timesheet->getBegin()->format('H:i')); } - public function testCreateWithoutBeginInjectsBegin() + public function testCreateWithoutBeginInjectsBegin(): void { $timesheet = (new Timesheet())->setUser(new User()); $request = new Request(); diff --git a/tests/Timesheet/TrackingMode/PunchInOutModeTest.php b/tests/Timesheet/TrackingMode/PunchInOutModeTest.php index 24f8632a..bcf9afc1 100644 --- a/tests/Timesheet/TrackingMode/PunchInOutModeTest.php +++ b/tests/Timesheet/TrackingMode/PunchInOutModeTest.php @@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request; */ class PunchInOutModeTest extends TestCase { - public function testDefaultValues() + public function testDefaultValues(): void { $sut = new PunchInOutMode(); @@ -32,7 +32,7 @@ class PunchInOutModeTest extends TestCase self::assertEquals('punch', $sut->getId()); } - public function testCreate() + public function testCreate(): void { $startingTime = new \DateTime('22:54'); $timesheet = new Timesheet(); @@ -44,7 +44,7 @@ class PunchInOutModeTest extends TestCase self::assertEquals($timesheet->getBegin(), $startingTime); } - public function testCreateWithoutBegin() + public function testCreateWithoutBegin(): void { $timesheet = (new Timesheet())->setUser(new User()); $request = new Request(); diff --git a/tests/Timesheet/TrackingModeServiceTest.php b/tests/Timesheet/TrackingModeServiceTest.php index 01ff64e2..193f4d4a 100644 --- a/tests/Timesheet/TrackingModeServiceTest.php +++ b/tests/Timesheet/TrackingModeServiceTest.php @@ -19,7 +19,7 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; */ class TrackingModeServiceTest extends TestCase { - public function testDefaultTrackingModesAreRegistered() + public function testDefaultTrackingModesAreRegistered(): void { $sut = (new TrackingModeServiceFactory($this))->create('punch'); @@ -36,14 +36,14 @@ class TrackingModeServiceTest extends TestCase self::assertContains('duration_fixed_begin', $ids); } - public function testGetActiveMode() + public function testGetActiveMode(): void { $sut = (new TrackingModeServiceFactory($this))->create('punch'); self::assertInstanceOf(PunchInOutMode::class, $sut->getActiveMode()); } - public function testGetActiveModeThrowsExceptionOnlyInvalidMode() + public function testGetActiveModeThrowsExceptionOnlyInvalidMode(): void { $this->expectException(ServiceNotFoundException::class); $this->expectExceptionMessage('You have requested a non-existent service "xxxxxx"'); diff --git a/tests/Timesheet/UtilTest.php b/tests/Timesheet/UtilTest.php index 8d7dc597..84159525 100644 --- a/tests/Timesheet/UtilTest.php +++ b/tests/Timesheet/UtilTest.php @@ -20,7 +20,7 @@ class UtilTest extends TestCase /** * @dataProvider getRateCalculationData */ - public function testCalculateRate(int|float $hourlyRate, int $duration, int|float $expectedRate) + public function testCalculateRate(int|float $hourlyRate, int $duration, int|float $expectedRate): void { $this->assertEquals($expectedRate, Util::calculateRate($hourlyRate, $duration)); } @@ -39,7 +39,7 @@ class UtilTest extends TestCase yield [7360.99, 1234, 2523.1838]; } - public function testCalculateRateWithRounding() + public function testCalculateRateWithRounding(): void { $total = 0.00; $seconds = 0; diff --git a/tests/TranslationsTest.php b/tests/TranslationsTest.php index 353b550c..c73f1939 100644 --- a/tests/TranslationsTest.php +++ b/tests/TranslationsTest.php @@ -16,7 +16,7 @@ use PHPUnit\Framework\TestCase; */ class TranslationsTest extends TestCase { - public function testForWrongFileExtension() + public function testForWrongFileExtension(): void { $files = glob(__DIR__ . '/../translations/*.*'); foreach ($files as $file) { @@ -24,7 +24,7 @@ class TranslationsTest extends TestCase } } - public function testForEmptyStrings() + public function testForEmptyStrings(): void { $files = glob(__DIR__ . '/../translations/*.xlf'); foreach ($files as $file) { @@ -47,7 +47,7 @@ class TranslationsTest extends TestCase } } - public function testReplacerWereNotTranslated() + public function testReplacerWereNotTranslated(): void { $englishFiles = glob(__DIR__ . '/../translations/*.en.xlf'); foreach ($englishFiles as $englishFile) { diff --git a/tests/Twig/ContextTest.php b/tests/Twig/ContextTest.php index 2fb71c7a..b9b5d3e8 100644 --- a/tests/Twig/ContextTest.php +++ b/tests/Twig/ContextTest.php @@ -59,7 +59,7 @@ class ContextTest extends TestCase ]; } - public function testIsModalRequest() + public function testIsModalRequest(): void { $sut = $this->getSut($this->getDefaultSettings()); self::assertFalse($sut->isModalRequest()); @@ -71,7 +71,7 @@ class ContextTest extends TestCase self::assertTrue($sut->isModalRequest()); } - public function testIsJavascriptRequest() + public function testIsJavascriptRequest(): void { $sut = $this->getSut($this->getDefaultSettings()); self::assertFalse($sut->isJavascriptRequest()); diff --git a/tests/Twig/DatatableExtensionsTest.php b/tests/Twig/DatatableExtensionsTest.php index ffa57fdd..a724b7c5 100644 --- a/tests/Twig/DatatableExtensionsTest.php +++ b/tests/Twig/DatatableExtensionsTest.php @@ -27,7 +27,7 @@ class DatatableExtensionsTest extends TestCase return new DatatableExtensions($repository, new ProfileManager()); } - public function testGetFunctions() + public function testGetFunctions(): void { $functions = ['initialize_datatable', 'datatable_column_class']; $sut = $this->getSut('de'); diff --git a/tests/Twig/ExtensionsTest.php b/tests/Twig/ExtensionsTest.php index 8374a072..1791f261 100644 --- a/tests/Twig/ExtensionsTest.php +++ b/tests/Twig/ExtensionsTest.php @@ -41,7 +41,7 @@ class ExtensionsTest extends TestCase throw new \Exception('Unknown twig test: ' . $name); } - public function testGetFilters() + public function testGetFilters(): void { $filters = ['report_date', 'docu_link', 'multiline_indent', 'color', 'font_contrast', 'default_color', 'nl2str']; $sut = $this->getSut(); @@ -62,7 +62,7 @@ class ExtensionsTest extends TestCase self::assertEquals(['html'], $twigFilters[$id]->getSafe(new Node())); } - public function testGetFunctions() + public function testGetFunctions(): void { $functions = ['class_name', 'iso_day_by_name', 'random_color']; $sut = $this->getSut(); @@ -76,7 +76,7 @@ class ExtensionsTest extends TestCase } } - public function testGetTests() + public function testGetTests(): void { $tests = ['number']; $i = 0; @@ -92,7 +92,7 @@ class ExtensionsTest extends TestCase } } - public function testDocuLink() + public function testDocuLink(): void { $data = [ 'timesheet.html' => 'https://www.kimai.org/documentation/timesheet.html', @@ -108,7 +108,7 @@ class ExtensionsTest extends TestCase } } - public function testGetClassName() + public function testGetClassName(): void { $sut = $this->getSut(); $this->assertEquals('DateTime', $sut->getClassName(new \DateTime())); @@ -152,7 +152,7 @@ sdfsdf' . PHP_EOL . "\n" . /** * @dataProvider getMultilineTestData */ - public function testMultilineIndent($indent, $string, $expected) + public function testMultilineIndent($indent, $string, $expected): void { $sut = $this->getSut(); self::assertEquals(implode("\n", $expected), $sut->multilineIndent($string, $indent)); @@ -161,7 +161,7 @@ sdfsdf' . PHP_EOL . "\n" . /** * Just a very short test, as this delegates to Utils/Color */ - public function testColor() + public function testColor(): void { $sut = $this->getSut(); @@ -177,14 +177,14 @@ sdfsdf' . PHP_EOL . "\n" . /** * Just a very short test, as this delegates to Utils/Color */ - public function testFontContrast() + public function testFontContrast(): void { $sut = $this->getSut(); self::assertEquals('#000000', $sut->calculateFontContrastColor('#ccc')); } - public function testIsoDayByName() + public function testIsoDayByName(): void { $sut = $this->getSut(); @@ -214,14 +214,14 @@ sdfsdf' . PHP_EOL . "\n" . /** * @dataProvider getTestDataReplaceNewline */ - public function testReplaceNewline(string $replacer, $input, $expected) + public function testReplaceNewline(string $replacer, $input, $expected): void { $sut = $this->getSut(); self::assertEquals($expected, $sut->replaceNewline($input, $replacer)); } - public function testGetRandomColor() + public function testGetRandomColor(): void { $sut = $this->getSut(); @@ -232,7 +232,7 @@ sdfsdf' . PHP_EOL . "\n" . self::assertEquals($fooColor, $sut->randomColor('foo-bar')); } - public function testGetDefaultColor() + public function testGetDefaultColor(): void { $sut = $this->getSut(); @@ -242,7 +242,7 @@ sdfsdf' . PHP_EOL . "\n" . self::assertEquals('', $sut->defaultColor('')); } - public function testIsNumeric() + public function testIsNumeric(): void { $test = $this->getTest('number'); self::assertFalse(\call_user_func($test->getCallable(), null)); diff --git a/tests/Twig/PaginationExtensionTest.php b/tests/Twig/PaginationExtensionTest.php index 4d294f77..cfb6e2dd 100644 --- a/tests/Twig/PaginationExtensionTest.php +++ b/tests/Twig/PaginationExtensionTest.php @@ -45,7 +45,7 @@ class PaginationExtensionTest extends TestCase return new PaginationExtension($this->getUrlGenerator()); } - public function testGetFunctions() + public function testGetFunctions(): void { $functions = ['pagination']; $sut = $this->getSut(); @@ -59,7 +59,7 @@ class PaginationExtensionTest extends TestCase } } - public function testRenderPaginationWithoutTemplateName() + public function testRenderPaginationWithoutTemplateName(): void { $sut = $this->getSut(); @@ -73,7 +73,7 @@ class PaginationExtensionTest extends TestCase $this->assertPaginationHtml($result); } - protected function assertPaginationHtml($result) + public function assertPaginationHtml($result): void { // this makes sure that we show the correct amount of pagination links! $expected = @@ -92,7 +92,7 @@ class PaginationExtensionTest extends TestCase self::assertEquals($expected, $result); } - public function testRenderPagination() + public function testRenderPagination(): void { $sut = $this->getSut(); @@ -106,7 +106,7 @@ class PaginationExtensionTest extends TestCase $this->assertPaginationHtml($result); } - public function testRenderPaginationWithoutRouteName() + public function testRenderPaginationWithoutRouteName(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('Pagination is missing the "routeName" option'); diff --git a/tests/Twig/Runtime/EncoreExtensionTest.php b/tests/Twig/Runtime/EncoreExtensionTest.php index a9fb30a2..026a2a7b 100644 --- a/tests/Twig/Runtime/EncoreExtensionTest.php +++ b/tests/Twig/Runtime/EncoreExtensionTest.php @@ -31,12 +31,12 @@ class EncoreExtensionTest extends TestCase return new EncoreExtension($container, __DIR__ . '/../'); } - public function testGetSubscribedServices() + public function testGetSubscribedServices(): void { self::assertEquals([EntrypointLookupInterface::class], EncoreExtension::getSubscribedServices()); } - public function testGetEncoreEntryCssSource() + public function testGetEncoreEntryCssSource(): void { $sut = $this->getSut(['test.css', 'test1.css']); $css = 'body { margin: 0; }p diff --git a/tests/Twig/Runtime/MarkdownExtensionTest.php b/tests/Twig/Runtime/MarkdownExtensionTest.php index 37b2cf2b..f4de785c 100644 --- a/tests/Twig/Runtime/MarkdownExtensionTest.php +++ b/tests/Twig/Runtime/MarkdownExtensionTest.php @@ -20,7 +20,7 @@ use PHPUnit\Framework\TestCase; */ class MarkdownExtensionTest extends TestCase { - public function testMarkdownToHtml() + public function testMarkdownToHtml(): void { $loader = $this->createMock(ConfigLoaderInterface::class); $config = SystemConfigurationFactory::create($loader, ['timesheet' => ['markdown_content' => true]]); @@ -33,7 +33,7 @@ class MarkdownExtensionTest extends TestCase ); } - public function testTimesheetContent() + public function testTimesheetContent(): void { $loader = $this->createMock(ConfigLoaderInterface::class); $config = SystemConfigurationFactory::create($loader, ['timesheet' => ['markdown_content' => false]]); @@ -60,7 +60,7 @@ class MarkdownExtensionTest extends TestCase ); } - public function testCommentContent() + public function testCommentContent(): void { $loader = $this->createMock(ConfigLoaderInterface::class); $config = SystemConfigurationFactory::create($loader, ['timesheet' => ['markdown_content' => false]]); @@ -100,7 +100,7 @@ class MarkdownExtensionTest extends TestCase ); } - public function testCommentOneLiner() + public function testCommentOneLiner(): void { $loader = $this->createMock(ConfigLoaderInterface::class); $config = SystemConfigurationFactory::create($loader, []); diff --git a/tests/Twig/Runtime/ThemeEventExtensionTest.php b/tests/Twig/Runtime/ThemeEventExtensionTest.php index 991f4943..248709c7 100644 --- a/tests/Twig/Runtime/ThemeEventExtensionTest.php +++ b/tests/Twig/Runtime/ThemeEventExtensionTest.php @@ -87,21 +87,21 @@ class ThemeEventExtensionTest extends TestCase return $environment; } - public function testTrigger() + public function testTrigger(): void { $sut = $this->getSut(); $event = $sut->trigger($this->getEnvironment(), 'foo', []); self::assertInstanceOf(ThemeEvent::class, $event); } - public function testTriggerWithoutListener() + public function testTriggerWithoutListener(): void { $sut = $this->getSut(false); $event = $sut->trigger($this->getEnvironment(), 'foo', []); self::assertInstanceOf(ThemeEvent::class, $event); } - public function testJavascriptTranslations() + public function testJavascriptTranslations(): void { $sut = $this->getSut(); $values = $sut->getJavascriptTranslations(); @@ -145,13 +145,13 @@ class ThemeEventExtensionTest extends TestCase /** * @dataProvider getProgressbarColors */ - public function testProgressbarClass(string $expected, int $percent, ?bool $reverseColors = false) + public function testProgressbarClass(string $expected, int $percent, ?bool $reverseColors = false): void { $sut = $this->getSut(false); self::assertEquals($expected, $sut->getProgressbarClass($percent, $reverseColors)); } - public function testGetTitle() + public function testGetTitle(): void { $sut = $this->getSut(false); $this->assertEquals('Kimai – foo', $sut->generateTitle()); @@ -160,7 +160,7 @@ class ThemeEventExtensionTest extends TestCase $this->assertEquals('Kimai | foo', $sut->generateTitle(null, ' | ')); } - public function testGetBrandedTitle() + public function testGetBrandedTitle(): void { $sut = $this->getSut(false, 'MyCompany'); $this->assertEquals('Kimai – foo', $sut->generateTitle()); diff --git a/tests/Twig/Runtime/TimesheetExtensionTest.php b/tests/Twig/Runtime/TimesheetExtensionTest.php index d770a324..74535479 100644 --- a/tests/Twig/Runtime/TimesheetExtensionTest.php +++ b/tests/Twig/Runtime/TimesheetExtensionTest.php @@ -22,7 +22,7 @@ use PHPUnit\Framework\TestCase; */ class TimesheetExtensionTest extends TestCase { - public function testActiveEntries() + public function testActiveEntries(): void { $entries = [new Timesheet(), new Timesheet()]; @@ -36,7 +36,7 @@ class TimesheetExtensionTest extends TestCase self::assertEquals($entries, $sut->activeEntries(new User())); } - public function testRecentEntries() + public function testRecentEntries(): void { $timesheet1 = $this->createMock(Timesheet::class); $timesheet1->method('getId')->willReturn(1); diff --git a/tests/Twig/Runtime/WidgetExtensionTest.php b/tests/Twig/Runtime/WidgetExtensionTest.php index 2a4015eb..a717b883 100644 --- a/tests/Twig/Runtime/WidgetExtensionTest.php +++ b/tests/Twig/Runtime/WidgetExtensionTest.php @@ -62,7 +62,7 @@ class WidgetExtensionTest extends TestCase return $env; } - public function testRenderWidgetForInvalidValue() + public function testRenderWidgetForInvalidValue(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Widget must be either a WidgetInterface or a string'); @@ -72,7 +72,7 @@ class WidgetExtensionTest extends TestCase $sut->renderWidget($this->getEnvironment(), true); } - public function testRenderWidgetForUnknownWidget() + public function testRenderWidgetForUnknownWidget(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Unknown widget "test" requested'); @@ -81,7 +81,7 @@ class WidgetExtensionTest extends TestCase $sut->renderWidget($this->getEnvironment(), 'test'); } - public function testRenderWidgetByString() + public function testRenderWidgetByString(): void { $widget = new More(); $widget->setId('test'); @@ -92,7 +92,7 @@ class WidgetExtensionTest extends TestCase $this->assertEquals($options, $data); } - public function testRenderWidgetObject() + public function testRenderWidgetObject(): void { $widget = new More(); $sut = $this->getSut(null, null); diff --git a/tests/Utils/ColorTest.php b/tests/Utils/ColorTest.php index dc833628..e93367ab 100644 --- a/tests/Utils/ColorTest.php +++ b/tests/Utils/ColorTest.php @@ -22,7 +22,7 @@ use PHPUnit\Framework\TestCase; */ class ColorTest extends TestCase { - public function testGetColorAndGetTimesheetColor() + public function testGetColorAndGetTimesheetColor(): void { $sut = new Color(); @@ -89,7 +89,7 @@ class ColorTest extends TestCase self::assertEquals('#123456', $sut->getColor($timesheet, true)); } - public function testGetFontContrastColor() + public function testGetFontContrastColor(): void { $sut = new Color(); $this->assertEquals('#ffffff', $sut->getFontContrastColor('#666')); @@ -100,7 +100,7 @@ class ColorTest extends TestCase $this->assertEquals('#000000', $sut->getFontContrastColor('#ffffff')); } - public function testGetFontContrastColorReturnsContrastForDefaultColorOnInvalidColor() + public function testGetFontContrastColorReturnsContrastForDefaultColorOnInvalidColor(): void { $sut = new Color(); $this->assertEquals('#000000', $sut->getFontContrastColor('')); @@ -114,7 +114,7 @@ class ColorTest extends TestCase $this->assertEquals('#000000', $sut->getFontContrastColor('#ccccccc')); } - public function testGetRandomColor() + public function testGetRandomColor(): void { $sut = new Color(); diff --git a/tests/Utils/DurationTest.php b/tests/Utils/DurationTest.php index 6d42bb38..34b038f1 100644 --- a/tests/Utils/DurationTest.php +++ b/tests/Utils/DurationTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class DurationTest extends TestCase { - public function testFormat() + public function testFormat(): void { $sut = new Duration(); @@ -28,7 +28,7 @@ class DurationTest extends TestCase /** * @dataProvider getParseDurationTestData */ - public function testParseDurationString($expected, $duration, $mode) + public function testParseDurationString($expected, $duration, $mode): void { $sut = new Duration(); $this->assertEquals($expected, $sut->parseDurationString($duration)); @@ -37,7 +37,7 @@ class DurationTest extends TestCase /** * @dataProvider getParseDurationTestData */ - public function testParseDuration($expected, $duration, $mode) + public function testParseDuration($expected, $duration, $mode): void { $sut = new Duration(); $this->assertEquals($expected, $sut->parseDuration($duration, $mode)); @@ -105,7 +105,7 @@ class DurationTest extends TestCase /** * @dataProvider getParseDurationInvalidData */ - public function testParseDurationThrowsInvalidArgumentException($duration, $mode) + public function testParseDurationThrowsInvalidArgumentException($duration, $mode): void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Utils/FileHelperTest.php b/tests/Utils/FileHelperTest.php index ed9f4cdb..059cb169 100644 --- a/tests/Utils/FileHelperTest.php +++ b/tests/Utils/FileHelperTest.php @@ -35,12 +35,12 @@ class FileHelperTest extends TestCase /** * @dataProvider getFileTestData */ - public function testEnsureMaxLength(string $expected, string $original) + public function testEnsureMaxLength(string $expected, string $original): void { self::assertEquals($expected, FileHelper::convertToAsciiFilename($original)); } - public function testDataDirectory() + public function testDataDirectory(): void { $data = realpath(__DIR__ . '/../_data/'); $sut = new FileHelper($data); diff --git a/tests/Utils/FormFormatConverterTest.php b/tests/Utils/FormFormatConverterTest.php index b6184130..3c2c9f96 100644 --- a/tests/Utils/FormFormatConverterTest.php +++ b/tests/Utils/FormFormatConverterTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class FormFormatConverterTest extends TestCase { - public function testConvert() + public function testConvert(): void { $sut = new FormFormatConverter(); @@ -33,7 +33,7 @@ class FormFormatConverterTest extends TestCase /** * @dataProvider getProblemPattern */ - public function testProblemPattern($format, $example) + public function testProblemPattern($format, $example): void { $sut = new FormFormatConverter(); $format = $sut->convert($format); @@ -41,7 +41,7 @@ class FormFormatConverterTest extends TestCase $this->assertMatchesRegularExpression($pattern, $example); } - public function testDayPattern() + public function testDayPattern(): void { for ($i = 1; $i < 32; $i++) { if ($i < 10) { @@ -51,7 +51,7 @@ class FormFormatConverterTest extends TestCase } } - public function testHourPattern() + public function testHourPattern(): void { for ($i = 0; $i < 24; $i++) { if ($i < 10) { @@ -61,7 +61,7 @@ class FormFormatConverterTest extends TestCase } } - public function testMinutePattern() + public function testMinutePattern(): void { for ($i = 0; $i < 60; $i++) { if ($i < 10) { @@ -71,7 +71,7 @@ class FormFormatConverterTest extends TestCase } } - public function testMonthPattern() + public function testMonthPattern(): void { for ($i = 1; $i < 13; $i++) { if ($i < 10) { @@ -81,7 +81,7 @@ class FormFormatConverterTest extends TestCase } } - public function testYearPattern() + public function testYearPattern(): void { for ($i = 0; $i < 200; $i++) { $this->assertMatchesRegularExpression('/^' . FormFormatConverter::PATTERN_YEAR . '$/', (string) (1900 + $i)); @@ -93,7 +93,7 @@ class FormFormatConverterTest extends TestCase yield ["yy-MM-dd HH 'h' mm", '2009-08-06 17 h 45']; } - public function testPattern() + public function testPattern(): void { $sut = new FormFormatConverter(); foreach ($this->getPossibleDateTimePattern() as $format => $example) { diff --git a/tests/Utils/MarkdownTest.php b/tests/Utils/MarkdownTest.php index cd633c6b..9b9b2633 100644 --- a/tests/Utils/MarkdownTest.php +++ b/tests/Utils/MarkdownTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; */ class MarkdownTest extends TestCase { - public function testMarkdownToHtml() + public function testMarkdownToHtml(): void { $sut = new Markdown(); $this->assertEquals('test
', $sut->toHtml('*test*')); @@ -65,7 +65,7 @@ class MarkdownTest extends TestCase $this->assertEquals($html, $sut->toHtml($markdown)); } - public function testDuplicateIds() + public function testDuplicateIds(): void { $sut = new Markdown(); @@ -85,7 +85,7 @@ class MarkdownTest extends TestCase $this->assertEquals($html, $sut->toHtml($markdown)); } - public function testLinksAreSanitized() + public function testLinksAreSanitized(): void { $sut = new Markdown(); diff --git a/tests/Utils/MenuItemModelTest.php b/tests/Utils/MenuItemModelTest.php index e0bcd34e..6fd83c8e 100644 --- a/tests/Utils/MenuItemModelTest.php +++ b/tests/Utils/MenuItemModelTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class MenuItemModelTest extends TestCase { - public function testChildRoutes() + public function testChildRoutes(): void { $sut = new MenuItemModel('test', 'foo', 'bar'); diff --git a/tests/Utils/ProfileManagerTest.php b/tests/Utils/ProfileManagerTest.php index 82d1ca63..2bf73153 100644 --- a/tests/Utils/ProfileManagerTest.php +++ b/tests/Utils/ProfileManagerTest.php @@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage; */ class ProfileManagerTest extends TestCase { - public function testEmpty() + public function testEmpty(): void { $request = new Request(); $session = new Session(new MockFileSessionStorage()); @@ -48,7 +48,7 @@ class ProfileManagerTest extends TestCase /** * @dataProvider getInvalidProfiles */ - public function testIsInvalidProfile(string $profile) + public function testIsInvalidProfile(string $profile): void { $sut = new ProfileManager(); self::assertFalse($sut->isValidProfile($profile)); @@ -71,7 +71,7 @@ class ProfileManagerTest extends TestCase /** * @dataProvider getDatatableNames */ - public function testDatatableName(string $expected, string $datatable, ?string $prefix) + public function testDatatableName(string $expected, string $datatable, ?string $prefix): void { $sut = new ProfileManager(); self::assertEquals($expected, $sut->getDatatableName($datatable, $prefix)); @@ -98,13 +98,13 @@ class ProfileManagerTest extends TestCase /** * @dataProvider getProfileNames */ - public function testGetProfile(string $profile, string $expected) + public function testGetProfile(string $profile, string $expected): void { $sut = new ProfileManager(); self::assertEquals($expected, $sut->getProfile($profile)); } - public function testSetProfile() + public function testSetProfile(): void { $request = new Request(); $session = new Session(new MockFileSessionStorage()); @@ -139,7 +139,7 @@ class ProfileManagerTest extends TestCase /** * @dataProvider getCookieProfiles */ - public function testGetProfileFromCookie(string $cookieValue, string $expected) + public function testGetProfileFromCookie(string $cookieValue, string $expected): void { $request = new Request(); self::assertFalse($request->cookies->has(ProfileManager::COOKIE_PROFILE)); @@ -168,7 +168,7 @@ class ProfileManagerTest extends TestCase /** * @dataProvider getSessionProfiles */ - public function testGetProfileFromSession(string $sessionValue, string $expected) + public function testGetProfileFromSession(string $sessionValue, string $expected): void { $request = new Request(); self::assertFalse($request->cookies->has(ProfileManager::COOKIE_PROFILE)); diff --git a/tests/Utils/SearchTermTest.php b/tests/Utils/SearchTermTest.php index b22d22c6..511d9d15 100644 --- a/tests/Utils/SearchTermTest.php +++ b/tests/Utils/SearchTermTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class SearchTermTest extends TestCase { - public function testNormalSearchTerm() + public function testNormalSearchTerm(): void { $sut = new SearchTerm('foo bar test 1'); self::assertEquals('foo bar test 1', $sut->getSearchTerm()); @@ -29,7 +29,7 @@ class SearchTermTest extends TestCase self::assertEquals('foo bar test 1', (string) $sut); } - public function testWithMetaField() + public function testWithMetaField(): void { $sut = new SearchTerm('foo:bar'); self::assertFalse($sut->hasSearchTerm()); @@ -41,7 +41,7 @@ class SearchTermTest extends TestCase self::assertEquals('foo:bar', $sut->getOriginalSearch()); } - public function testWithMultipleMetaFields() + public function testWithMultipleMetaFields(): void { $sut = new SearchTerm('foo:bar bar:foo'); self::assertFalse($sut->hasSearchTerm()); @@ -55,7 +55,7 @@ class SearchTermTest extends TestCase self::assertEquals('foo:bar bar:foo', $sut->getOriginalSearch()); } - public function testComplexWithMultipleAndDuplicateMetaFields() + public function testComplexWithMultipleAndDuplicateMetaFields(): void { $sut = new SearchTerm('foo:bar hello bar:foo world test foo:bar wuff'); self::assertTrue($sut->hasSearchTerm()); diff --git a/tests/Utils/StringHelperTest.php b/tests/Utils/StringHelperTest.php index ee0a4809..5403c5b2 100644 --- a/tests/Utils/StringHelperTest.php +++ b/tests/Utils/StringHelperTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class StringHelperTest extends TestCase { - public function testEnsureMaxLength() + public function testEnsureMaxLength(): void { self::assertNull(StringHelper::ensureMaxLength(null, 10)); self::assertEquals('', StringHelper::ensureMaxLength('', 10)); @@ -51,7 +51,7 @@ class StringHelperTest extends TestCase /** * @dataProvider getDdeAttackStrings */ - public function testSanitizeDde(string $input) + public function testSanitizeDde(string $input): void { self::assertEquals("' " . $input, StringHelper::sanitizeDDE($input)); } @@ -65,7 +65,7 @@ class StringHelperTest extends TestCase /** * @dataProvider getNonDdeAttackStrings */ - public function testSanitizeDdeWithCorrectStrings(string $input) + public function testSanitizeDdeWithCorrectStrings(string $input): void { self::assertEquals($input, StringHelper::sanitizeDDE($input)); } diff --git a/tests/Validator/Constraints/ColorChoicesValidatorTest.php b/tests/Validator/Constraints/ColorChoicesValidatorTest.php index 8e5617b0..44f290f1 100644 --- a/tests/Validator/Constraints/ColorChoicesValidatorTest.php +++ b/tests/Validator/Constraints/ColorChoicesValidatorTest.php @@ -40,7 +40,7 @@ class ColorChoicesValidatorTest extends ConstraintValidatorTestCase yield [null]; } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); @@ -51,7 +51,7 @@ class ColorChoicesValidatorTest extends ConstraintValidatorTestCase * @dataProvider getValidColors * @param string $color */ - public function testConstraintWithValidColor($color) + public function testConstraintWithValidColor($color): void { $constraint = new ColorChoices(); $this->validator->validate($color, $constraint); @@ -84,7 +84,7 @@ class ColorChoicesValidatorTest extends ConstraintValidatorTestCase * @param string|null $invalidName * @param string|null $invalidNameCode */ - public function testValidationError(string $color, $invalidColor = null, $invalidName = null, $invalidNameCode = null) + public function testValidationError(string $color, $invalidColor = null, $invalidName = null, $invalidNameCode = null): void { $constraint = new ColorChoices(); diff --git a/tests/Validator/Constraints/DateTimeFormatValidatorTest.php b/tests/Validator/Constraints/DateTimeFormatValidatorTest.php index 0de579da..2b3060f6 100644 --- a/tests/Validator/Constraints/DateTimeFormatValidatorTest.php +++ b/tests/Validator/Constraints/DateTimeFormatValidatorTest.php @@ -39,7 +39,7 @@ class DateTimeFormatValidatorTest extends ConstraintValidatorTestCase ]; } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); @@ -50,7 +50,7 @@ class DateTimeFormatValidatorTest extends ConstraintValidatorTestCase * @dataProvider getValidData * @param string $input */ - public function testConstraintWithValidData($input) + public function testConstraintWithValidData($input): void { $constraint = new DateTimeFormat(); $this->validator->validate($input, $constraint); @@ -72,7 +72,7 @@ class DateTimeFormatValidatorTest extends ConstraintValidatorTestCase * @dataProvider getInvalidData * @param mixed $input */ - public function testValidationError($input) + public function testValidationError($input): void { $constraint = new DateTimeFormat(); diff --git a/tests/Validator/Constraints/HexColorValidatorTest.php b/tests/Validator/Constraints/HexColorValidatorTest.php index 80fcc40b..a0b20acd 100644 --- a/tests/Validator/Constraints/HexColorValidatorTest.php +++ b/tests/Validator/Constraints/HexColorValidatorTest.php @@ -39,7 +39,7 @@ class HexColorValidatorTest extends ConstraintValidatorTestCase yield [null]; } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); @@ -50,7 +50,7 @@ class HexColorValidatorTest extends ConstraintValidatorTestCase * @dataProvider getValidColors * @param string $color */ - public function testConstraintWithValidColor($color) + public function testConstraintWithValidColor($color): void { $constraint = new HexColor(); $this->validator->validate($color, $constraint); @@ -79,7 +79,7 @@ class HexColorValidatorTest extends ConstraintValidatorTestCase * @dataProvider getInvalidColors * @param mixed $color */ - public function testValidationError($color, $parameterType = null) + public function testValidationError($color, $parameterType = null): void { $constraint = new HexColor(); diff --git a/tests/Validator/Constraints/ProjectValidatorTest.php b/tests/Validator/Constraints/ProjectValidatorTest.php index 7e204946..51b4bf1d 100644 --- a/tests/Validator/Constraints/ProjectValidatorTest.php +++ b/tests/Validator/Constraints/ProjectValidatorTest.php @@ -28,14 +28,14 @@ class ProjectValidatorTest extends ConstraintValidatorTestCase return new ProjectValidator(); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new NotBlank()); } - public function testEndBeforeStartIsInvalid() + public function testEndBeforeStartIsInvalid(): void { $begin = new \DateTime(); $end = new \DateTime('-1 hour'); @@ -51,7 +51,7 @@ class ProjectValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testGetTargets() + public function testGetTargets(): void { $constraint = new ProjectConstraint(); self::assertEquals('class', $constraint->getTargets()); diff --git a/tests/Validator/Constraints/QuickEntryModelValidatorTest.php b/tests/Validator/Constraints/QuickEntryModelValidatorTest.php index ceb7cf85..007abc1b 100644 --- a/tests/Validator/Constraints/QuickEntryModelValidatorTest.php +++ b/tests/Validator/Constraints/QuickEntryModelValidatorTest.php @@ -31,21 +31,21 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase return new QuickEntryModelValidator(); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new QuickEntryModel()); } - public function testTriggersOnMissingProjectAndActivity() + public function testTriggersOnMissingProjectAndActivity(): void { $model = new QuickEntryModelEntity(); $timesheet = new Timesheet(); @@ -64,7 +64,7 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testTriggersOnMissingActivity() + public function testTriggersOnMissingActivity(): void { $model = new QuickEntryModelEntity(); $model->setProject(new Project()); @@ -81,7 +81,7 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testTriggersOnMissingProject() + public function testTriggersOnMissingProject(): void { $model = new QuickEntryModelEntity(); $model->setActivity(new Activity()); @@ -98,7 +98,7 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testDoesNotTriggerOnPrototype() + public function testDoesNotTriggerOnPrototype(): void { $model = new QuickEntryModelEntity(); @@ -107,7 +107,7 @@ class QuickEntryModelValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testDoesNotTriggerOnProperlyFilled() + public function testDoesNotTriggerOnProperlyFilled(): void { $model = new QuickEntryModelEntity(); $model->setActivity(new Activity()); diff --git a/tests/Validator/Constraints/QuickEntryTimesheetValidatorTest.php b/tests/Validator/Constraints/QuickEntryTimesheetValidatorTest.php index 1d37f3c6..947f2674 100644 --- a/tests/Validator/Constraints/QuickEntryTimesheetValidatorTest.php +++ b/tests/Validator/Constraints/QuickEntryTimesheetValidatorTest.php @@ -36,21 +36,21 @@ class QuickEntryTimesheetValidatorTest extends ConstraintValidatorTestCase return new QuickEntryTimesheetValidator([new TimesheetBasic()]); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Activity(), $this->createConstraint()); } - public function testNotTriggersOnEmptyDurationAndNewTimesheet() + public function testNotTriggersOnEmptyDurationAndNewTimesheet(): void { $timesheet = new Timesheet(); $timesheet->setDuration(null); diff --git a/tests/Validator/Constraints/RoleValidatorTest.php b/tests/Validator/Constraints/RoleValidatorTest.php index e55ffcc3..e7e9b295 100644 --- a/tests/Validator/Constraints/RoleValidatorTest.php +++ b/tests/Validator/Constraints/RoleValidatorTest.php @@ -42,7 +42,7 @@ class RoleValidatorTest extends ConstraintValidatorTestCase ]; } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); @@ -53,14 +53,14 @@ class RoleValidatorTest extends ConstraintValidatorTestCase * @dataProvider getValidRoles * @param string $role */ - public function testConstraintWithValidRole($role) + public function testConstraintWithValidRole($role): void { $constraint = new Role(); $this->validator->validate($role, $constraint); $this->assertNoViolation(); } - public function testNullIsInvalid() + public function testNullIsInvalid(): void { $this->validator->validate(null, new Role(['message' => 'myMessage'])); @@ -86,7 +86,7 @@ class RoleValidatorTest extends ConstraintValidatorTestCase * @dataProvider getInvalidRoles * @param mixed $role */ - public function testValidationError($role) + public function testValidationError($role): void { $constraint = new Role([ 'message' => 'myMessage', diff --git a/tests/Validator/Constraints/TeamValidatorTest.php b/tests/Validator/Constraints/TeamValidatorTest.php index 6a0f5467..c724e17c 100644 --- a/tests/Validator/Constraints/TeamValidatorTest.php +++ b/tests/Validator/Constraints/TeamValidatorTest.php @@ -30,14 +30,14 @@ class TeamValidatorTest extends ConstraintValidatorTestCase return new TeamValidator(); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new NotBlank()); // @phpstan-ignore-line } - public function testMissingTeamlead() + public function testMissingTeamlead(): void { $member = new TeamMember(); $member->setTeamlead(false); diff --git a/tests/Validator/Constraints/TimeFormatValidatorTest.php b/tests/Validator/Constraints/TimeFormatValidatorTest.php index e21af9ae..e60b877c 100644 --- a/tests/Validator/Constraints/TimeFormatValidatorTest.php +++ b/tests/Validator/Constraints/TimeFormatValidatorTest.php @@ -28,14 +28,14 @@ class TimeFormatValidatorTest extends ConstraintValidatorTestCase return new TimeFormatValidator(); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new NotBlank()); } - public function testWrongValueThrowsException() + public function testWrongValueThrowsException(): void { $this->expectException(UnexpectedValueException::class); $this->expectExceptionMessage('Expected argument of type "string", "stdClass" given'); @@ -46,7 +46,7 @@ class TimeFormatValidatorTest extends ConstraintValidatorTestCase /** * @dataProvider getValidTimes */ - public function testValidationSucceeds(?string $value) + public function testValidationSucceeds(?string $value): void { $this->validator->validate($value, new TimeFormat()); $this->assertNoViolation(); @@ -69,7 +69,7 @@ class TimeFormatValidatorTest extends ConstraintValidatorTestCase /** * @dataProvider getInvalidTimes */ - public function testValidationProblem(?string $value) + public function testValidationProblem(?string $value): void { $this->validator->validate($value, new TimeFormat()); diff --git a/tests/Validator/Constraints/TimesheetBasicValidatorTest.php b/tests/Validator/Constraints/TimesheetBasicValidatorTest.php index 0b3bcc49..a2add546 100644 --- a/tests/Validator/Constraints/TimesheetBasicValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetBasicValidatorTest.php @@ -39,21 +39,21 @@ class TimesheetBasicValidatorTest extends ConstraintValidatorTestCase return new TimesheetBasicValidator($configuration); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new NotBlank(), new TimesheetBasic(['message' => 'myMessage'])); } - public function testEmptyTimesheet() + public function testEmptyTimesheet(): void { $timesheet = new Timesheet(); $this->validator->validate($timesheet, new TimesheetBasic(['message' => 'myMessage'])); @@ -70,7 +70,7 @@ class TimesheetBasicValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testFutureBegin() + public function testFutureBegin(): void { $begin = new \DateTime('+10 hour'); $timesheet = new Timesheet(); @@ -95,7 +95,7 @@ class TimesheetBasicValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testEndBeforeBegin() + public function testEndBeforeBegin(): void { $end = new \DateTime('-10 hour'); $begin = new \DateTime('-1 hour'); @@ -117,7 +117,7 @@ class TimesheetBasicValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testProjectMismatch() + public function testProjectMismatch(): void { $end = new \DateTime('-1 hour'); $begin = new \DateTime('-10 hour'); @@ -172,7 +172,7 @@ class TimesheetBasicValidatorTest extends ConstraintValidatorTestCase /** * @dataProvider getProjectStartEndTestData */ - public function testEndBeforeWithProjectStartAndEnd(\DateTime $start, \DateTime $end, array $violations) + public function testEndBeforeWithProjectStartAndEnd(\DateTime $start, \DateTime $end, array $violations): void { $timesheet = new Timesheet(); $timesheet->setBegin(new \DateTime('-10 hour')); @@ -206,7 +206,7 @@ class TimesheetBasicValidatorTest extends ConstraintValidatorTestCase $assertion->assertRaised(); } - public function testGetTargets() + public function testGetTargets(): void { $constraint = new TimesheetBasic(); self::assertEquals('class', $constraint->getTargets()); diff --git a/tests/Validator/Constraints/TimesheetBudgetUsedValidatorTest.php b/tests/Validator/Constraints/TimesheetBudgetUsedValidatorTest.php index b113f39c..df7f7fef 100644 --- a/tests/Validator/Constraints/TimesheetBudgetUsedValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetBudgetUsedValidatorTest.php @@ -100,14 +100,14 @@ class TimesheetBudgetUsedValidatorTest extends ConstraintValidatorTestCase return new TimesheetBudgetUsedValidator($configuration, $customerRepository, $projectRepository, $activityRepository, $timesheetRepository, $rateService, $auth, $localeService); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testConstraintWithPreExistingViolation() + public function testConstraintWithPreExistingViolation(): void { $this->validator = $this->createValidator(); $this->validator->initialize($this->context); @@ -117,14 +117,14 @@ class TimesheetBudgetUsedValidatorTest extends ConstraintValidatorTestCase $this->buildViolation('FOOOOOOOOO')->assertRaised(); } - public function testTargetIsInvalid() + public function testTargetIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new TimesheetBudgetUsed()); // @phpstan-ignore-line } - public function testWithMissingEnd() + public function testWithMissingEnd(): void { $timesheet = new Timesheet(); $timesheet->setBegin(new DateTime()); @@ -133,7 +133,7 @@ class TimesheetBudgetUsedValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testWithMissingUser() + public function testWithMissingUser(): void { $timesheet = new Timesheet(); $timesheet->setBegin(new DateTime()); @@ -143,7 +143,7 @@ class TimesheetBudgetUsedValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testWithMissingProject() + public function testWithMissingProject(): void { $timesheet = new Timesheet(); $timesheet->setBegin(new DateTime()); @@ -154,7 +154,7 @@ class TimesheetBudgetUsedValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testWithoutBudget() + public function testWithoutBudget(): void { $project = new Project(); $project->setCustomer(new Customer('foo')); @@ -169,7 +169,7 @@ class TimesheetBudgetUsedValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testWithAllowedOverbooking() + public function testWithAllowedOverbooking(): void { $this->validator = $this->createValidator(true); $this->validator->initialize($this->context); diff --git a/tests/Validator/Constraints/TimesheetExportedValidatorTest.php b/tests/Validator/Constraints/TimesheetExportedValidatorTest.php index 00a4a184..5f0bf4c0 100644 --- a/tests/Validator/Constraints/TimesheetExportedValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetExportedValidatorTest.php @@ -48,21 +48,21 @@ class TimesheetExportedValidatorTest extends ConstraintValidatorTestCase return new TimesheetExportedValidator($auth); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new NotBlank(), new TimesheetExported(['message' => 'myMessage'])); // @phpstan-ignore-line } - public function testTriggersOnMissingPermission() + public function testTriggersOnMissingPermission(): void { $this->validator = $this->createMyValidator(false); $this->validator->initialize($this->context); @@ -79,7 +79,7 @@ class TimesheetExportedValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testNotTriggersOnNewTimesheet() + public function testNotTriggersOnNewTimesheet(): void { $this->validator = $this->createMyValidator(false); $this->validator->initialize($this->context); @@ -93,7 +93,7 @@ class TimesheetExportedValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testDoesNotTriggerWithPermission() + public function testDoesNotTriggerWithPermission(): void { $this->validator = $this->createMyValidator(true); $this->validator->initialize($this->context); @@ -106,7 +106,7 @@ class TimesheetExportedValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testDoesNotTriggerIfNotExported() + public function testDoesNotTriggerIfNotExported(): void { $this->validator = $this->createMyValidator(false); $this->validator->initialize($this->context); @@ -119,7 +119,7 @@ class TimesheetExportedValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testGetTargets() + public function testGetTargets(): void { $constraint = new TimesheetExported(); self::assertEquals('class', $constraint->getTargets()); diff --git a/tests/Validator/Constraints/TimesheetFutureTimesValidatorTest.php b/tests/Validator/Constraints/TimesheetFutureTimesValidatorTest.php index 8825a855..766b5f1b 100644 --- a/tests/Validator/Constraints/TimesheetFutureTimesValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetFutureTimesValidatorTest.php @@ -49,21 +49,21 @@ class TimesheetFutureTimesValidatorTest extends ConstraintValidatorTestCase return new TimesheetFutureTimesValidator($config); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new NotBlank(), new TimesheetFutureTimes(['message' => 'myMessage'])); // @phpstan-ignore-line } - public function testFutureBeginIsDisallowed() + public function testFutureBeginIsDisallowed(): void { $begin = new \DateTime('+10 hour'); $timesheet = new Timesheet(); @@ -77,7 +77,7 @@ class TimesheetFutureTimesValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testFutureBeginIsAllowed() + public function testFutureBeginIsAllowed(): void { $this->validator = $this->createMyValidator(true); $this->validator->initialize($this->context); diff --git a/tests/Validator/Constraints/TimesheetLockdownValidatorTest.php b/tests/Validator/Constraints/TimesheetLockdownValidatorTest.php index 23be83d3..221c603d 100644 --- a/tests/Validator/Constraints/TimesheetLockdownValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetLockdownValidatorTest.php @@ -64,21 +64,21 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase return new TimesheetLockdownValidator($auth, new LockdownService($config)); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new NotBlank(), new TimesheetLockdown(['message' => 'myMessage'])); // @phpstan-ignore-line } - public function testValidatorWithoutNowConstraint() + public function testValidatorWithoutNowConstraint(): void { $this->validator = $this->createMyValidator(false, false, 'first day of last month', 'last day of last month', '+10 days'); $this->validator->initialize($this->context); @@ -98,7 +98,7 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testValidatorWithEmptyTimesheet() + public function testValidatorWithEmptyTimesheet(): void { $this->validator = $this->createMyValidator(false, false, 'first day of last month', 'last day of last month', '+10 days'); $this->validator->initialize($this->context); @@ -109,7 +109,7 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase self::assertEmpty($this->context->getViolations()); } - public function testValidatorWithoutNowStringConstraint() + public function testValidatorWithoutNowStringConstraint(): void { $this->validator = $this->createMyValidator(false, false, 'first day of last month', 'last day of last month', '+10 days'); $this->validator->initialize($this->context); @@ -125,7 +125,7 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase self::assertEmpty($this->context->getViolations()); } - public function testValidatorWithEndBeforeStartPeriod() + public function testValidatorWithEndBeforeStartPeriod(): void { $this->validator = $this->createMyValidator(false, false, 'first day of this month', 'last day of last month', '+10 days'); $this->validator->initialize($this->context); @@ -144,7 +144,7 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase /** * @dataProvider getTestData */ - public function testLockdown(bool $allowOverwriteFull, bool $allowOverwriteGrace, string $beginModifier, string $nowModifier, bool $isViolation) + public function testLockdown(bool $allowOverwriteFull, bool $allowOverwriteGrace, string $beginModifier, string $nowModifier, bool $isViolation): void { $this->validator = $this->createMyValidator($allowOverwriteFull, $allowOverwriteGrace, 'first day of last month', 'last day of last month', '+10 days'); $this->validator->initialize($this->context); @@ -193,7 +193,7 @@ class TimesheetLockdownValidatorTest extends ConstraintValidatorTestCase /** * @dataProvider getConfigTestData */ - public function testLockdownConfig(bool $allowOverwriteFull, bool $allowOverwriteGrace, ?string $lockdownBegin, ?string $lockdownEnd, ?string $grace, bool $isViolation) + public function testLockdownConfig(bool $allowOverwriteFull, bool $allowOverwriteGrace, ?string $lockdownBegin, ?string $lockdownEnd, ?string $grace, bool $isViolation): void { $this->validator = $this->createMyValidator($allowOverwriteFull, $allowOverwriteGrace, $lockdownBegin, $lockdownEnd, $grace); $this->validator->initialize($this->context); diff --git a/tests/Validator/Constraints/TimesheetLongRunningValidatorTest.php b/tests/Validator/Constraints/TimesheetLongRunningValidatorTest.php index cc1a502b..044f00d6 100644 --- a/tests/Validator/Constraints/TimesheetLongRunningValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetLongRunningValidatorTest.php @@ -44,21 +44,21 @@ class TimesheetLongRunningValidatorTest extends ConstraintValidatorTestCase return new TimesheetLongRunningValidator($config); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new NotBlank(), new TimesheetLongRunning(['message' => 'myMessage'])); // @phpstan-ignore-line } - public function testLongRunningTriggers() + public function testLongRunningTriggers(): void { $begin = new \DateTime(); $end = new \DateTime('+10 hour'); @@ -75,7 +75,7 @@ class TimesheetLongRunningValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testLongRunningTriggersOverMaximum() + public function testLongRunningTriggersOverMaximum(): void { $begin = new \DateTime(); $end = clone $begin; @@ -93,7 +93,7 @@ class TimesheetLongRunningValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testLongRunningDoesNotTriggerOnMaximum() + public function testLongRunningDoesNotTriggerOnMaximum(): void { $timesheet = new Timesheet(); $timesheet->setBegin(new \DateTime()); @@ -105,7 +105,7 @@ class TimesheetLongRunningValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testLongRunningNotTriggersIfConfiguredToZero() + public function testLongRunningNotTriggersIfConfiguredToZero(): void { $this->validator = $this->createMyValidator(0); $this->validator->initialize($this->context); @@ -121,7 +121,7 @@ class TimesheetLongRunningValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testLongRunningNotTriggersIfDurationIsLowerThan() + public function testLongRunningNotTriggersIfDurationIsLowerThan(): void { $this->validator = $this->createMyValidator(121); $this->validator->initialize($this->context); @@ -137,7 +137,7 @@ class TimesheetLongRunningValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testNotTriggersOnRunningRecord() + public function testNotTriggersOnRunningRecord(): void { $begin = new \DateTime('-10 hour'); $timesheet = new Timesheet(); @@ -147,7 +147,7 @@ class TimesheetLongRunningValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testGetTargets() + public function testGetTargets(): void { $constraint = new TimesheetLongRunning(); self::assertEquals('class', $constraint->getTargets()); diff --git a/tests/Validator/Constraints/TimesheetMultiUpdateValidatorTest.php b/tests/Validator/Constraints/TimesheetMultiUpdateValidatorTest.php index 442c7976..a848b361 100644 --- a/tests/Validator/Constraints/TimesheetMultiUpdateValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetMultiUpdateValidatorTest.php @@ -31,14 +31,14 @@ class TimesheetMultiUpdateValidatorTest extends ConstraintValidatorTestCase return new TimesheetMultiUpdateValidator(); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new NotBlank()); } - public function testProjectMismatch() + public function testProjectMismatch(): void { $activity = new Activity(); $project1 = new Project(); @@ -57,7 +57,7 @@ class TimesheetMultiUpdateValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testProjectWithoutActivity() + public function testProjectWithoutActivity(): void { $timesheet = new TimesheetMultiUpdateDTO(); $timesheet @@ -72,7 +72,7 @@ class TimesheetMultiUpdateValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testActivityWithoutProject() + public function testActivityWithoutProject(): void { $timesheet = new TimesheetMultiUpdateDTO(); $timesheet @@ -87,7 +87,7 @@ class TimesheetMultiUpdateValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testHourlyRateAndFixedRateInParallelAreNotAllowed() + public function testHourlyRateAndFixedRateInParallelAreNotAllowed(): void { $timesheet = new TimesheetMultiUpdateDTO(); $timesheet->setHourlyRate(10.12); @@ -104,7 +104,7 @@ class TimesheetMultiUpdateValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testDisabledValues() + public function testDisabledValues(): void { $customer = new Customer('foo'); $customer->setVisible(false); diff --git a/tests/Validator/Constraints/TimesheetMultiUserValidatorTest.php b/tests/Validator/Constraints/TimesheetMultiUserValidatorTest.php index 09ee4e50..da12037e 100644 --- a/tests/Validator/Constraints/TimesheetMultiUserValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetMultiUserValidatorTest.php @@ -28,14 +28,14 @@ class TimesheetMultiUserValidatorTest extends ConstraintValidatorTestCase return new TimesheetMultiUserValidator(); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new NotBlank()); } - public function testEmptyTimesheet() + public function testEmptyTimesheet(): void { $timesheet = new MultiUserTimesheet(); diff --git a/tests/Validator/Constraints/TimesheetOverlappingValidatorTest.php b/tests/Validator/Constraints/TimesheetOverlappingValidatorTest.php index 0dbc1fbf..0b467128 100644 --- a/tests/Validator/Constraints/TimesheetOverlappingValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetOverlappingValidatorTest.php @@ -47,21 +47,21 @@ class TimesheetOverlappingValidatorTest extends ConstraintValidatorTestCase return new TimesheetOverlappingValidator($config, $repository); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new NotBlank(), new TimesheetOverlapping(['message' => 'myMessage'])); // @phpstan-ignore-line } - public function testOverlappingDisallowedWithRecords() + public function testOverlappingDisallowedWithRecords(): void { $begin = new \DateTime(); $end = new \DateTime('+10 hour'); @@ -77,7 +77,7 @@ class TimesheetOverlappingValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testOverlappingDisallowedWithoutRecords() + public function testOverlappingDisallowedWithoutRecords(): void { $this->validator = $this->createMyValidator(false, false); $this->validator->initialize($this->context); @@ -92,7 +92,7 @@ class TimesheetOverlappingValidatorTest extends ConstraintValidatorTestCase self::assertEmpty($this->context->getViolations()); } - public function testOverlappingAllowedWithRecords() + public function testOverlappingAllowedWithRecords(): void { $this->validator = $this->createMyValidator(true, true); $this->validator->initialize($this->context); @@ -107,7 +107,7 @@ class TimesheetOverlappingValidatorTest extends ConstraintValidatorTestCase self::assertEmpty($this->context->getViolations()); } - public function testOverlappingAllowedWithoutRecords() + public function testOverlappingAllowedWithoutRecords(): void { $this->validator = $this->createMyValidator(true, false); $this->validator->initialize($this->context); diff --git a/tests/Validator/Constraints/TimesheetRestartValidatorTest.php b/tests/Validator/Constraints/TimesheetRestartValidatorTest.php index 2e1605fb..42d6ab1a 100644 --- a/tests/Validator/Constraints/TimesheetRestartValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetRestartValidatorTest.php @@ -46,14 +46,14 @@ class TimesheetRestartValidatorTest extends ConstraintValidatorTestCase return new TimesheetRestartValidator($auth, $service); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); @@ -63,7 +63,7 @@ class TimesheetRestartValidatorTest extends ConstraintValidatorTestCase /** * @dataProvider getTestData */ - public function testRestartDisallowed(bool $allowed, ?string $property, string $trackingMode) + public function testRestartDisallowed(bool $allowed, ?string $property, string $trackingMode): void { $this->validator = $this->createMyValidator($allowed, $trackingMode); $this->validator->initialize($this->context); diff --git a/tests/Validator/Constraints/TimesheetValidatorTest.php b/tests/Validator/Constraints/TimesheetValidatorTest.php index ce1230cc..acd6c88d 100644 --- a/tests/Validator/Constraints/TimesheetValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetValidatorTest.php @@ -33,14 +33,14 @@ class TimesheetValidatorTest extends ConstraintValidatorTestCase return new TimesheetValidator([]); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); diff --git a/tests/Validator/Constraints/TimesheetZeroDurationValidatorTest.php b/tests/Validator/Constraints/TimesheetZeroDurationValidatorTest.php index 9ce027f6..12caf35c 100644 --- a/tests/Validator/Constraints/TimesheetZeroDurationValidatorTest.php +++ b/tests/Validator/Constraints/TimesheetZeroDurationValidatorTest.php @@ -44,14 +44,14 @@ class TimesheetZeroDurationValidatorTest extends ConstraintValidatorTestCase return new TimesheetZeroDurationValidator($config); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } - public function testInvalidValueThrowsException() + public function testInvalidValueThrowsException(): void { $this->expectException(UnexpectedTypeException::class); @@ -70,7 +70,7 @@ class TimesheetZeroDurationValidatorTest extends ConstraintValidatorTestCase return $timesheet; } - public function testZeroDurationIsDisallowed() + public function testZeroDurationIsDisallowed(): void { $timesheet = $this->prepareTimesheet(); @@ -82,7 +82,7 @@ class TimesheetZeroDurationValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } - public function testZeroDurationIsAllowed() + public function testZeroDurationIsAllowed(): void { $this->validator = $this->createMyValidator(true); $this->validator->initialize($this->context); diff --git a/tests/Validator/Constraints/UserValidatorTest.php b/tests/Validator/Constraints/UserValidatorTest.php index a65f8f3d..15978574 100644 --- a/tests/Validator/Constraints/UserValidatorTest.php +++ b/tests/Validator/Constraints/UserValidatorTest.php @@ -32,28 +32,28 @@ class UserValidatorTest extends ConstraintValidatorTestCase return new UserValidator($userService); } - public function testConstraintIsInvalid() + public function testConstraintIsInvalid(): void { $this->expectException(UnexpectedTypeException::class); $this->validator->validate('foo', new NotBlank()); // @phpstan-ignore-line } - public function testNullIsValid() + public function testNullIsValid(): void { $this->validator->validate(null, new User(['message' => 'myMessage'])); // @phpstan-ignore-line $this->assertNoViolation(); } - public function testNonUserIsValid() + public function testNonUserIsValid(): void { $this->validator->validate(new TestUserEntity(), new User(['message' => 'myMessage'])); // @phpstan-ignore-line $this->assertNoViolation(); } - public function testEmptyUserIsValid() + public function testEmptyUserIsValid(): void { $user = new UserEntity(); $user->setUserIdentifier('foo'); @@ -63,7 +63,7 @@ class UserValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testUserIsValidWithEmptyRepository() + public function testUserIsValidWithEmptyRepository(): void { $user = new UserEntity(); $user->setUserIdentifier('foo'); @@ -74,7 +74,7 @@ class UserValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } - public function testUserIsInvalidWithRepository() + public function testUserIsInvalidWithRepository(): void { $existing = $this->createMock(UserEntity::class); $existing->expects($this->exactly(4))->method('getId')->willReturn(123); diff --git a/tests/Validator/ValidationExceptionTest.php b/tests/Validator/ValidationExceptionTest.php index 8ff0fd7b..9d960aa5 100644 --- a/tests/Validator/ValidationExceptionTest.php +++ b/tests/Validator/ValidationExceptionTest.php @@ -17,14 +17,14 @@ use PHPUnit\Framework\TestCase; */ class ValidationExceptionTest extends TestCase { - public function testException() + public function testException(): void { $sut = new ValidationException(); self::assertEquals(400, $sut->getCode()); self::assertEquals('Validation failed', $sut->getMessage()); } - public function testConstruct() + public function testConstruct(): void { $sut = new ValidationException('Something went wrong'); self::assertEquals(400, $sut->getCode()); diff --git a/tests/Validator/ValidationFailedExceptionTest.php b/tests/Validator/ValidationFailedExceptionTest.php index b973606c..67c96d2d 100644 --- a/tests/Validator/ValidationFailedExceptionTest.php +++ b/tests/Validator/ValidationFailedExceptionTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Validator\ConstraintViolationList; */ class ValidationFailedExceptionTest extends TestCase { - public function testException() + public function testException(): void { $list = new ConstraintViolationList(); $sut = new ValidationFailedException($list); @@ -27,7 +27,7 @@ class ValidationFailedExceptionTest extends TestCase self::assertSame($list, $sut->getViolations()); } - public function testConstruct() + public function testConstruct(): void { $list = new ConstraintViolationList(); $sut = new ValidationFailedException($list, 'Something went wrong'); diff --git a/tests/Voter/ActivityVoterTest.php b/tests/Voter/ActivityVoterTest.php index 7ec39fbd..5fc4e3c4 100644 --- a/tests/Voter/ActivityVoterTest.php +++ b/tests/Voter/ActivityVoterTest.php @@ -26,12 +26,12 @@ class ActivityVoterTest extends AbstractVoterTest /** * @dataProvider getTestData */ - public function testVote(User $user, $subject, $attribute, $result) + public function testVote(User $user, $subject, $attribute, $result): void { $this->assertVote($user, $subject, $attribute, $result); } - protected function assertVote(User $user, $subject, $attribute, $result) + public function assertVote(User $user, $subject, $attribute, $result): void { $token = new UsernamePasswordToken($user, 'bar', $user->getRoles()); $sut = $this->getVoter(ActivityVoter::class); @@ -85,7 +85,7 @@ class ActivityVoterTest extends AbstractVoterTest } } - public function testTeamlead() + public function testTeamlead(): void { $team = new Team('foo'); $user = new User(); @@ -124,7 +124,7 @@ class ActivityVoterTest extends AbstractVoterTest $this->assertVote($user, $activity, 'edit', VoterInterface::ACCESS_DENIED); } - public function testTeamMember() + public function testTeamMember(): void { $team = new Team('foo'); $user = new User(); diff --git a/tests/Voter/CustomerVoterTest.php b/tests/Voter/CustomerVoterTest.php index 58f80eda..397738f5 100644 --- a/tests/Voter/CustomerVoterTest.php +++ b/tests/Voter/CustomerVoterTest.php @@ -21,7 +21,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; */ class CustomerVoterTest extends AbstractVoterTest { - protected function assertVote(User $user, $subject, $attribute, $result) + public function assertVote(User $user, $subject, $attribute, $result): void { $token = new UsernamePasswordToken($user, 'bar', $user->getRoles()); $sut = $this->getVoter(CustomerVoter::class); @@ -30,7 +30,7 @@ class CustomerVoterTest extends AbstractVoterTest $this->assertEquals($result, $actual, sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); } - public function testVote() + public function testVote(): void { $userNoRole = $this->getUser(0, 'foo'); $userStandard = $this->getUser(1, User::ROLE_USER); @@ -83,7 +83,7 @@ class CustomerVoterTest extends AbstractVoterTest } } - public function testTeamlead() + public function testTeamlead(): void { $team = new Team('foo'); $user = new User(); @@ -96,7 +96,7 @@ class CustomerVoterTest extends AbstractVoterTest $this->assertVote($user, $customer, 'edit', VoterInterface::ACCESS_GRANTED); } - public function testTeamMember() + public function testTeamMember(): void { $team = new Team('foo'); $user = new User(); @@ -119,7 +119,7 @@ class CustomerVoterTest extends AbstractVoterTest $this->assertVote($user, $customer, 'edit', VoterInterface::ACCESS_GRANTED); } - public function testAccess() + public function testAccess(): void { // ALLOW: customer has no teams $this->assertVote(new User(), new Customer('foo'), 'access', VoterInterface::ACCESS_GRANTED); diff --git a/tests/Voter/EntityMultiRoleVoterTest.php b/tests/Voter/EntityMultiRoleVoterTest.php index cfed8047..60851b36 100644 --- a/tests/Voter/EntityMultiRoleVoterTest.php +++ b/tests/Voter/EntityMultiRoleVoterTest.php @@ -25,7 +25,7 @@ class EntityMultiRoleVoterTest extends AbstractVoterTest /** * @dataProvider getTestData */ - public function testVote(User $user, $subject, $attribute, $result) + public function testVote(User $user, $subject, $attribute, $result): void { $token = new UsernamePasswordToken($user, 'foo', $user->getRoles()); $sut = $this->getVoter(EntityMultiRoleVoter::class); diff --git a/tests/Voter/ProjectVoterTest.php b/tests/Voter/ProjectVoterTest.php index c937d3bf..f4cb948c 100644 --- a/tests/Voter/ProjectVoterTest.php +++ b/tests/Voter/ProjectVoterTest.php @@ -22,7 +22,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; */ class ProjectVoterTest extends AbstractVoterTest { - protected function assertVote(User $user, $subject, $attribute, $result) + public function assertVote(User $user, $subject, $attribute, $result): void { $token = new UsernamePasswordToken($user, 'bar', $user->getRoles()); $sut = $this->getVoter(ProjectVoter::class); @@ -35,7 +35,7 @@ class ProjectVoterTest extends AbstractVoterTest $this->assertEquals($result, $actual, sprintf('Failed voting "%s" for User with roles %s.', $attribute, implode(', ', $user->getRoles()))); } - public function testVote() + public function testVote(): void { $userNoRole = $this->getUser(0, 'foo'); $userStandard = $this->getUser(1, User::ROLE_USER); @@ -90,7 +90,7 @@ class ProjectVoterTest extends AbstractVoterTest } } - public function testTeamlead() + public function testTeamlead(): void { $team = new Team('foo'); $user = new User(); @@ -112,7 +112,7 @@ class ProjectVoterTest extends AbstractVoterTest $this->assertVote($user, $project, 'edit', VoterInterface::ACCESS_GRANTED); } - public function testTeamMember() + public function testTeamMember(): void { $team = new Team('foo'); $user = new User(); diff --git a/tests/Voter/RolePermissionVoterTest.php b/tests/Voter/RolePermissionVoterTest.php index 832aceb1..b2d0c7bf 100644 --- a/tests/Voter/RolePermissionVoterTest.php +++ b/tests/Voter/RolePermissionVoterTest.php @@ -23,7 +23,7 @@ class RolePermissionVoterTest extends AbstractVoterTest /** * @dataProvider getTestData */ - public function testVote(User $user, $subject, $attribute, $result) + public function testVote(User $user, $subject, $attribute, $result): void { $token = new UsernamePasswordToken($user, 'bar', $user->getRoles()); $sut = $this->getVoter(RolePermissionVoter::class); diff --git a/tests/Voter/TeamVoterTest.php b/tests/Voter/TeamVoterTest.php index aceeed5d..8174d2a2 100644 --- a/tests/Voter/TeamVoterTest.php +++ b/tests/Voter/TeamVoterTest.php @@ -23,7 +23,7 @@ class TeamVoterTest extends AbstractVoterTest /** * @dataProvider getTestData */ - public function testVote(User $user, $subject, $attribute, $result) + public function testVote(User $user, $subject, $attribute, $result): void { $token = new UsernamePasswordToken($user, 'bar', $user->getRoles()); $sut = $this->getVoter(TeamVoter::class); diff --git a/tests/Voter/UserVoterTest.php b/tests/Voter/UserVoterTest.php index f3842eee..a076b7ba 100644 --- a/tests/Voter/UserVoterTest.php +++ b/tests/Voter/UserVoterTest.php @@ -23,7 +23,7 @@ class UserVoterTest extends AbstractVoterTest /** * @dataProvider getTestData */ - public function testVote(User $user, $subject, $attribute, $result) + public function testVote(User $user, $subject, $attribute, $result): void { $token = new UsernamePasswordToken($user, 'bar', $user->getRoles()); $sut = $this->getVoter(UserVoter::class); @@ -89,7 +89,7 @@ class UserVoterTest extends AbstractVoterTest /** * @dataProvider getTestDataForAuthType */ - public function testPasswordIsDeniedForNonInternalUser(string $authType, int $result) + public function testPasswordIsDeniedForNonInternalUser(string $authType, int $result): void { $user = new User(); $user->setUserIdentifier('admin'); @@ -112,7 +112,7 @@ class UserVoterTest extends AbstractVoterTest ]; } - public function testViewTeamMember() + public function testViewTeamMember(): void { $userMock = $this->createMock(User::class); $userMock->method('getId')->willReturn(1); diff --git a/tests/Widget/Type/AbstractWidgetTest.php b/tests/Widget/Type/AbstractWidgetTest.php index 2891bf0d..267291d2 100644 --- a/tests/Widget/Type/AbstractWidgetTest.php +++ b/tests/Widget/Type/AbstractWidgetTest.php @@ -21,14 +21,14 @@ abstract class AbstractWidgetTest extends TestCase abstract public function getDefaultOptions(): array; - public function testDefaultData() + public function testDefaultData(): void { $sut = $this->createSut(); self::assertInstanceOf(AbstractWidget::class, $sut); self::assertEquals($this->getDefaultOptions(), $sut->getOptions()); } - public function testSetter() + public function testSetter(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/AmountMonthTest.php b/tests/Widget/Type/AmountMonthTest.php index e6b8fbdb..781c9e9b 100644 --- a/tests/Widget/Type/AmountMonthTest.php +++ b/tests/Widget/Type/AmountMonthTest.php @@ -46,7 +46,7 @@ class AmountMonthTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/AmountTodayTest.php b/tests/Widget/Type/AmountTodayTest.php index 1ce350fd..6697d7a6 100644 --- a/tests/Widget/Type/AmountTodayTest.php +++ b/tests/Widget/Type/AmountTodayTest.php @@ -46,7 +46,7 @@ class AmountTodayTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/AmountTotalTest.php b/tests/Widget/Type/AmountTotalTest.php index 0e29eecf..6a21ab4f 100644 --- a/tests/Widget/Type/AmountTotalTest.php +++ b/tests/Widget/Type/AmountTotalTest.php @@ -46,7 +46,7 @@ class AmountTotalTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/AmountWeekTest.php b/tests/Widget/Type/AmountWeekTest.php index fb74472e..5b34aba2 100644 --- a/tests/Widget/Type/AmountWeekTest.php +++ b/tests/Widget/Type/AmountWeekTest.php @@ -46,7 +46,7 @@ class AmountWeekTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/AmountYearTest.php b/tests/Widget/Type/AmountYearTest.php index 0877912b..0cef2db0 100644 --- a/tests/Widget/Type/AmountYearTest.php +++ b/tests/Widget/Type/AmountYearTest.php @@ -53,7 +53,7 @@ class AmountYearTest extends AbstractWidgetTypeTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/DailyWorkingTimeChartTest.php b/tests/Widget/Type/DailyWorkingTimeChartTest.php index 9b3fb695..f3696cd6 100644 --- a/tests/Widget/Type/DailyWorkingTimeChartTest.php +++ b/tests/Widget/Type/DailyWorkingTimeChartTest.php @@ -35,7 +35,7 @@ class DailyWorkingTimeChartTest extends TestCase return $sut; } - public function testDefaultValues() + public function testDefaultValues(): void { $sut = $this->createSut(); self::assertInstanceOf(WidgetInterface::class, $sut); @@ -47,7 +47,7 @@ class DailyWorkingTimeChartTest extends TestCase self::assertEquals('', $options['color']); } - public function testSetter() + public function testSetter(): void { $sut = $this->createSut(); @@ -56,7 +56,7 @@ class DailyWorkingTimeChartTest extends TestCase self::assertEquals('trääääää', $sut->getOptions()['föööö']); } - public function testGetOptions() + public function testGetOptions(): void { $sut = $this->createSut(); @@ -66,7 +66,7 @@ class DailyWorkingTimeChartTest extends TestCase self::assertEquals('xxx', $options['type']); } - public function testGetData() + public function testGetData(): void { $activity = $this->createMock(Activity::class); $activity->method('getId')->willReturn(42); diff --git a/tests/Widget/Type/DurationYearTest.php b/tests/Widget/Type/DurationYearTest.php index 5aad5f35..1128f64b 100644 --- a/tests/Widget/Type/DurationYearTest.php +++ b/tests/Widget/Type/DurationYearTest.php @@ -50,7 +50,7 @@ class DurationYearTest extends AbstractWidgetTypeTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/PaginatedWorkingTimeChartTest.php b/tests/Widget/Type/PaginatedWorkingTimeChartTest.php index c9bbc359..e7200fa3 100644 --- a/tests/Widget/Type/PaginatedWorkingTimeChartTest.php +++ b/tests/Widget/Type/PaginatedWorkingTimeChartTest.php @@ -38,14 +38,14 @@ class PaginatedWorkingTimeChartTest extends TestCase return $sut; } - public function testDefaultValues() + public function testDefaultValues(): void { $sut = $this->createSut(); self::assertEquals('PaginatedWorkingTimeChart', $sut->getId()); self::assertEquals('stats.yourWorkingHours', $sut->getTitle()); } - public function testSetter() + public function testSetter(): void { $sut = $this->createSut(); @@ -54,7 +54,7 @@ class PaginatedWorkingTimeChartTest extends TestCase self::assertEquals('trääääää', $sut->getOptions()['föööö']); } - public function testGetOptions() + public function testGetOptions(): void { $sut = $this->createSut(); @@ -62,7 +62,7 @@ class PaginatedWorkingTimeChartTest extends TestCase self::assertEquals('bar', $options['type']); } - public function testGetData() + public function testGetData(): void { $activity = $this->createMock(Activity::class); $activity->method('getId')->willReturn(42); @@ -90,7 +90,7 @@ class PaginatedWorkingTimeChartTest extends TestCase self::assertNull($data['financialBegin']); } - public function testGetDataWithFinancialYear() + public function testGetDataWithFinancialYear(): void { $activity = $this->createMock(Activity::class); $activity->method('getId')->willReturn(42); diff --git a/tests/Widget/Type/TotalsActivityTest.php b/tests/Widget/Type/TotalsActivityTest.php index b8432fe6..960b4348 100644 --- a/tests/Widget/Type/TotalsActivityTest.php +++ b/tests/Widget/Type/TotalsActivityTest.php @@ -61,7 +61,7 @@ class TotalsActivityTest extends AbstractWidgetTest self::assertEquals(1, $sut->getData()); } - public function testData() + public function testData(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Widget/Type/TotalsCustomerTest.php b/tests/Widget/Type/TotalsCustomerTest.php index 5fdb2b49..e937206f 100644 --- a/tests/Widget/Type/TotalsCustomerTest.php +++ b/tests/Widget/Type/TotalsCustomerTest.php @@ -61,7 +61,7 @@ class TotalsCustomerTest extends AbstractWidgetTest self::assertEquals(1, $sut->getData()); } - public function testData() + public function testData(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Widget/Type/TotalsProjectTest.php b/tests/Widget/Type/TotalsProjectTest.php index d57b636c..14a67158 100644 --- a/tests/Widget/Type/TotalsProjectTest.php +++ b/tests/Widget/Type/TotalsProjectTest.php @@ -61,7 +61,7 @@ class TotalsProjectTest extends AbstractWidgetTest self::assertEquals(1, $sut->getData()); } - public function testData() + public function testData(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Widget/Type/TotalsUserTest.php b/tests/Widget/Type/TotalsUserTest.php index e83d7351..a79e4fdd 100644 --- a/tests/Widget/Type/TotalsUserTest.php +++ b/tests/Widget/Type/TotalsUserTest.php @@ -61,7 +61,7 @@ class TotalsUserTest extends AbstractWidgetTest self::assertEquals(1, $sut->getData()); } - public function testData() + public function testData(): void { $user = new User(); $user->setAlias('foo'); diff --git a/tests/Widget/Type/UserAmountMonthTest.php b/tests/Widget/Type/UserAmountMonthTest.php index e1d2324d..8d7cfc3b 100644 --- a/tests/Widget/Type/UserAmountMonthTest.php +++ b/tests/Widget/Type/UserAmountMonthTest.php @@ -50,7 +50,7 @@ class UserAmountMonthTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/UserAmountTodayTest.php b/tests/Widget/Type/UserAmountTodayTest.php index 5dc52f60..64b37936 100644 --- a/tests/Widget/Type/UserAmountTodayTest.php +++ b/tests/Widget/Type/UserAmountTodayTest.php @@ -50,7 +50,7 @@ class UserAmountTodayTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/UserAmountTotalTest.php b/tests/Widget/Type/UserAmountTotalTest.php index 945f64a1..5dc1f9dc 100644 --- a/tests/Widget/Type/UserAmountTotalTest.php +++ b/tests/Widget/Type/UserAmountTotalTest.php @@ -50,7 +50,7 @@ class UserAmountTotalTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/UserAmountWeekTest.php b/tests/Widget/Type/UserAmountWeekTest.php index a817bbd6..8cf2bdae 100644 --- a/tests/Widget/Type/UserAmountWeekTest.php +++ b/tests/Widget/Type/UserAmountWeekTest.php @@ -50,7 +50,7 @@ class UserAmountWeekTest extends AbstractWidgetTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/UserAmountYearTest.php b/tests/Widget/Type/UserAmountYearTest.php index 715d8d73..1f1e0e46 100644 --- a/tests/Widget/Type/UserAmountYearTest.php +++ b/tests/Widget/Type/UserAmountYearTest.php @@ -53,7 +53,7 @@ class UserAmountYearTest extends AbstractWidgetTypeTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/Type/UserDurationYearTest.php b/tests/Widget/Type/UserDurationYearTest.php index b6f4c926..ec780274 100644 --- a/tests/Widget/Type/UserDurationYearTest.php +++ b/tests/Widget/Type/UserDurationYearTest.php @@ -50,7 +50,7 @@ class UserDurationYearTest extends AbstractWidgetTypeTest ]; } - public function testSettings() + public function testSettings(): void { $sut = $this->createSut(); diff --git a/tests/Widget/WidgetExceptionTest.php b/tests/Widget/WidgetExceptionTest.php index e73909e3..35346a3f 100644 --- a/tests/Widget/WidgetExceptionTest.php +++ b/tests/Widget/WidgetExceptionTest.php @@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase; */ class WidgetExceptionTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $ex = new WidgetException(); self::assertInstanceOf(\Exception::class, $ex); diff --git a/tests/Widget/WidgetServiceTest.php b/tests/Widget/WidgetServiceTest.php index d748ac9e..00562634 100644 --- a/tests/Widget/WidgetServiceTest.php +++ b/tests/Widget/WidgetServiceTest.php @@ -18,13 +18,13 @@ use PHPUnit\Framework\TestCase; */ class WidgetServiceTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $sut = new WidgetService(); self::assertFalse($sut->hasWidget('sdfsdf')); } - public function testHasAndGetWidget() + public function testHasAndGetWidget(): void { $widget = new More(); $widget->setId('sdfsdf'); diff --git a/tests/phpstan-doctrine.php b/tests/phpstan-doctrine.php index b3ad6e92..cd85c5eb 100644 --- a/tests/phpstan-doctrine.php +++ b/tests/phpstan-doctrine.php @@ -20,4 +20,4 @@ $debug = (bool) ($_SERVER['APP_DEBUG'] ?? (in_array($env, ['dev', 'test']))); $kernel = new Kernel($env, $debug); $kernel->boot(); -return $kernel->getContainer()->get('doctrine')->getManager(); +return $kernel->getContainer()->get('doctrine')->getManager(); // @phpstan-ignore-line diff --git a/tests/phpstan.neon b/tests/phpstan.neon index 7a985085..6f2fce64 100644 --- a/tests/phpstan.neon +++ b/tests/phpstan.neon @@ -18,12 +18,12 @@ parameters: objectManagerLoader: %rootDir%/../../../tests/phpstan-doctrine.php ignoreErrors: - - message: "#^Method App\\\\Tests\\\\API\\\\APIControllerBaseTest\\:\\:assertApiResponseTypeStructure\\(\\) has parameter \\$result with no value type specified in iterable type array\\.$#" + message: "#^Method App\\\\Tests\\\\API\\\\APIControllerBaseTest\\:\\:assertApiException\\(\\) has parameter \\$expectedErrors with no value type specified in iterable type array\\.$#" count: 1 path: API/APIControllerBaseTest.php - - message: "#^Method App\\\\Tests\\\\API\\\\APIControllerBaseTest\\:\\:assertApiException\\(\\) has parameter \\$expectedErrors with no value type specified in iterable type array\\.$#" + message: "#^Method App\\\\Tests\\\\API\\\\APIControllerBaseTest\\:\\:assertApiResponseTypeStructure\\(\\) has parameter \\$result with no value type specified in iterable type array\\.$#" count: 1 path: API/APIControllerBaseTest.php @@ -132,31 +132,6 @@ parameters: count: 1 path: API/APIControllerBaseTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\ActionsControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActionsControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActionsControllerTest\\:\\:test_getActivityActions\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActionsControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActionsControllerTest\\:\\:test_getCustomerActions\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActionsControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActionsControllerTest\\:\\:test_getProjectActions\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActionsControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActionsControllerTest\\:\\:test_getTimesheetActions\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActionsControllerTest.php - - message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" count: 4 @@ -177,11 +152,6 @@ parameters: count: 1 path: API/ActivityControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:assertRateStructure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:assertRateStructure\\(\\) has parameter \\$result with no value type specified in iterable type array\\.$#" count: 1 @@ -212,56 +182,6 @@ parameters: count: 1 path: API/ActivityControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testAddFixedRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testAddRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testAddRateActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testAddRateMissingEntityAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testAddRateMissingUserAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testDeleteNotAllowed\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testDeleteRate\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testDeleteRateEntityNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testDeleteRateRateNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testDeleteRateWithInvalidAssignment\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testGetCollection\\(\\) has parameter \\$expected with no type specified\\.$#" count: 1 @@ -282,116 +202,6 @@ parameters: count: 1 path: API/ActivityControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testGetCollectionWithQuery\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testGetEntity\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testGetRates\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testGetRatesEmptyResult\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testGetRatesEntityNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testGetRatesIsSecured\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testInvalidPatchAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testMetaAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingMetafield\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingName\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingValue\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testMetaActionThrowsNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPatchAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPatchActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPatchActionWithNonGlobalActivity\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPatchActionWithUnknownActivity\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPostAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPostActionWithInvalidData\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPostActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ActivityControllerTest\\:\\:testPostActionWithLeastFields\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ActivityControllerTest.php - - message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" count: 12 @@ -437,106 +247,6 @@ parameters: count: 1 path: API/ApiDocControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticate\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticateFailsOnMissingApiTokenForUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticateFailsOnWrongPassword\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticateWithEmptyToken\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticateWithEmptyUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticateWithMissingAuthHeader\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticateWithMissingToken\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testAuthenticateWithMissingUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\SessionAuthenticatorTest\\:\\:testSupports\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/SessionAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticate\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticateFailsOnMissingApiTokenForUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticateFailsOnWrongPassword\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticateWithEmptyToken\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticateWithEmptyUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticateWithMissingAuthHeader\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticateWithMissingToken\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testAuthenticateWithMissingUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Authentication\\\\TokenAuthenticatorTest\\:\\:testSupports\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Authentication/TokenAuthenticatorTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ConfigurationControllerTest\\:\\:testGetTimesheet\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ConfigurationControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ConfigurationControllerTest\\:\\:testIsTimesheetSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ConfigurationControllerTest.php - - message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" count: 1 @@ -557,11 +267,6 @@ parameters: count: 1 path: API/CustomerControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:assertRateStructure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:assertRateStructure\\(\\) has parameter \\$result with no value type specified in iterable type array\\.$#" count: 1 @@ -592,176 +297,6 @@ parameters: count: 1 path: API/CustomerControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testAddFixedRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testAddRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testAddRateActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testAddRateMissingEntityAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testAddRateMissingUserAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testDeleteNotAllowed\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testDeleteRate\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testDeleteRateEntityNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testDeleteRateRateNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testDeleteRateWithInvalidAssignment\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetCollection\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetCollectionWithQuery\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetEntity\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetEntityWithFullResponse\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetRates\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetRatesEmptyResult\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetRatesEntityNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testGetRatesIsSecured\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testInvalidPatchAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testMetaAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testMetaActionNotAllowed\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingMetafield\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingName\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingValue\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testMetaActionThrowsNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testPatchAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testPatchActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testPatchActionWithUnknownActivity\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testPostAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testPostActionWithInvalidData\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testPostActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\CustomerControllerTest\\:\\:testPostActionWithLeastFields\\(\\) has no return type specified\\.$#" - count: 1 - path: API/CustomerControllerTest.php - - message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" count: 12 @@ -772,16 +307,6 @@ parameters: count: 13 path: API/CustomerControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\Model\\\\TimesheetConfigTest\\:\\:testSetter\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Model/TimesheetConfigTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\NotFoundExceptionTest\\:\\:testConstructor\\(\\) has no return type specified\\.$#" - count: 1 - path: API/NotFoundExceptionTest.php - - message: "#^Cannot call method addSubscriber\\(\\) on object\\|null\\.$#" count: 1 @@ -797,11 +322,6 @@ parameters: count: 1 path: API/ProjectControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:assertRateStructure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:assertRateStructure\\(\\) has parameter \\$result with no value type specified in iterable type array\\.$#" count: 1 @@ -837,61 +357,6 @@ parameters: count: 1 path: API/ProjectControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testAddFixedRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testAddRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testAddRateActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testAddRateMissingEntityAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testAddRateMissingUserAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testDeleteNotAllowed\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testDeleteRate\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testDeleteRateEntityNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testDeleteRateRateNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testDeleteRateWithInvalidAssignment\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testGetCollection\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testGetCollectionWithParams\\(\\) has parameter \\$customer with no type specified\\.$#" count: 1 @@ -912,121 +377,6 @@ parameters: count: 1 path: API/ProjectControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testGetEntity\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testGetRates\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testGetRatesEmptyResult\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testGetRatesEntityNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testGetRatesIsSecured\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testInvalidPatchAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testMetaAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingMetafield\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingName\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingValue\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testMetaActionThrowsNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testNotFound\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPatchAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPatchActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPatchActionWithUnknownActivity\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPostAction\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPostActionWithInvalidData\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPostActionWithInvalidUser\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPostActionWithLeastFields\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPostActionWithOtherFields\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPostActionWithOtherFields3\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\ProjectControllerTest\\:\\:testPostActionWithOtherFieldsAndFalse\\(\\) has no return type specified\\.$#" - count: 1 - path: API/ProjectControllerTest.php - - message: "#^Parameter \\#1 \\$customer of method App\\\\Entity\\\\Team\\:\\:addCustomer\\(\\) expects App\\\\Entity\\\\Customer, App\\\\Entity\\\\Customer\\|null given\\.$#" count: 1 @@ -1042,31 +392,6 @@ parameters: count: 15 path: API/ProjectControllerTest.php - - - message: "#^Method App\\\\Tests\\\\API\\\\Serializer\\\\ValidationFailedExceptionErrorHandlerTest\\:\\:testSubscribingMethods\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Serializer/ValidationFailedExceptionErrorHandlerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Serializer\\\\ValidationFailedExceptionErrorHandlerTest\\:\\:testWithConstraintsList\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Serializer/ValidationFailedExceptionErrorHandlerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Serializer\\\\ValidationFailedExceptionErrorHandlerTest\\:\\:testWithConstraintsListAndWrongException\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Serializer/ValidationFailedExceptionErrorHandlerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Serializer\\\\ValidationFailedExceptionErrorHandlerTest\\:\\:testWithEmptyConstraintsList\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Serializer/ValidationFailedExceptionErrorHandlerTest.php - - - - message: "#^Method App\\\\Tests\\\\API\\\\Serializer\\\\ValidationFailedExceptionErrorHandlerTest\\:\\:testWithUnsupportedException\\(\\) has no return type specified\\.$#" - count: 1 - path: API/Serializer/ValidationFailedExceptionErrorHandlerTest.php - - message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" count: 3 @@ -1212,66 +537,6 @@ parameters: count: 8 path: API/UserControllerTest.php - - - message: "#^Method App\\\\Tests\\\\Activity\\\\ActivityServiceTest\\:\\:testCannotSavePersistedProjectAsNew\\(\\) has no return type specified\\.$#" - count: 1 - path: Activity/ActivityServiceTest.php - - - - message: "#^Method App\\\\Tests\\\\Activity\\\\ActivityServiceTest\\:\\:testUpdateDispatchesEvents\\(\\) has no return type specified\\.$#" - count: 1 - path: Activity/ActivityServiceTest.php - - - - message: "#^Method App\\\\Tests\\\\Activity\\\\ActivityServiceTest\\:\\:testcreateNewActivityDispatchesEvents\\(\\) has no return type specified\\.$#" - count: 1 - path: Activity/ActivityServiceTest.php - - - - message: "#^Method App\\\\Tests\\\\Activity\\\\ActivityServiceTest\\:\\:testcreateNewActivityWithoutCustomer\\(\\) has no return type specified\\.$#" - count: 1 - path: Activity/ActivityServiceTest.php - - - - message: "#^Method App\\\\Tests\\\\Activity\\\\ActivityServiceTest\\:\\:testsaveNewActivityDispatchesEvents\\(\\) has no return type specified\\.$#" - count: 1 - path: Activity/ActivityServiceTest.php - - - - message: "#^Method App\\\\Tests\\\\Activity\\\\ActivityServiceTest\\:\\:testsaveNewActivityHasValidationError\\(\\) has no return type specified\\.$#" - count: 1 - path: Activity/ActivityServiceTest.php - - - - message: "#^Method App\\\\Tests\\\\Calendar\\\\GoogleSourceTest\\:\\:testConstruct\\(\\) has no return type specified\\.$#" - count: 1 - path: Calendar/GoogleSourceTest.php - - - - message: "#^Method App\\\\Tests\\\\Calendar\\\\GoogleTest\\:\\:testConstruct\\(\\) has no return type specified\\.$#" - count: 1 - path: Calendar/GoogleTest.php - - - - message: "#^Method App\\\\Tests\\\\Calendar\\\\RecentActivitiesSourceTest\\:\\:testConstruct\\(\\) has no return type specified\\.$#" - count: 1 - path: Calendar/RecentActivitiesSourceTest.php - - - - message: "#^Method App\\\\Tests\\\\Calendar\\\\TimesheetEntryTest\\:\\:testConstruct\\(\\) has no return type specified\\.$#" - count: 1 - path: Calendar/TimesheetEntryTest.php - - - - message: "#^Method App\\\\Tests\\\\Calendar\\\\TimesheetEntryTest\\:\\:testEmpty\\(\\) has no return type specified\\.$#" - count: 1 - path: Calendar/TimesheetEntryTest.php - - - - message: "#^Method App\\\\Tests\\\\Calendar\\\\TimesheetEntryTest\\:\\:testGetTitle\\(\\) has no return type specified\\.$#" - count: 1 - path: Calendar/TimesheetEntryTest.php - - message: "#^Cannot call method getRepository\\(\\) on object\\|null\\.$#" count: 1 @@ -1487,41 +752,6 @@ parameters: count: 1 path: Command/PromoteUserCommandTest.php - - - message: "#^Method App\\\\Tests\\\\Command\\\\ReloadCommandTest\\:\\:testCommandName\\(\\) has no return type specified\\.$#" - count: 1 - path: Command/ReloadCommandTest.php - - - - message: "#^Method App\\\\Tests\\\\Command\\\\ResetDevelopmentCommandTest\\:\\:testCommandName\\(\\) has no return type specified\\.$#" - count: 1 - path: Command/ResetDevelopmentCommandTest.php - - - - message: "#^Method App\\\\Tests\\\\Command\\\\ResetDevelopmentCommandTest\\:\\:testCommandNameIsNotEnabledInProd\\(\\) has no return type specified\\.$#" - count: 1 - path: Command/ResetDevelopmentCommandTest.php - - - - message: "#^Method App\\\\Tests\\\\Command\\\\ResetTestCommandTest\\:\\:testCommandName\\(\\) has no return type specified\\.$#" - count: 1 - path: Command/ResetTestCommandTest.php - - - - message: "#^Method App\\\\Tests\\\\Command\\\\ResetTestCommandTest\\:\\:testCommandNameIsNotEnabledInProd\\(\\) has no return type specified\\.$#" - count: 1 - path: Command/ResetTestCommandTest.php - - - - message: "#^Method App\\\\Tests\\\\Command\\\\TimesheetStopAllCommandTest\\:\\:testCommandName\\(\\) has no return type specified\\.$#" - count: 1 - path: Command/TimesheetStopAllCommandTest.php - - - - message: "#^Method App\\\\Tests\\\\Command\\\\TimesheetStopAllCommandTest\\:\\:testRun\\(\\) has no return type specified\\.$#" - count: 1 - path: Command/TimesheetStopAllCommandTest.php - - message: "#^Cannot call method getConnection\\(\\) on object\\|null\\.$#" count: 1 @@ -1557,31 +787,11 @@ parameters: count: 1 path: Configuration/LdapConfigurationTest.php - - - message: "#^Method App\\\\Tests\\\\Configuration\\\\LdapConfigurationTest\\:\\:testDefault\\(\\) has no return type specified\\.$#" - count: 1 - path: Configuration/LdapConfigurationTest.php - - - - message: "#^Method App\\\\Tests\\\\Configuration\\\\LdapConfigurationTest\\:\\:testMapping\\(\\) has no return type specified\\.$#" - count: 1 - path: Configuration/LdapConfigurationTest.php - - message: "#^Method App\\\\Tests\\\\Configuration\\\\LocaleServiceTest\\:\\:getSut\\(\\) has parameter \\$settings with no value type specified in iterable type array\\.$#" count: 1 path: Configuration/LocaleServiceTest.php - - - message: "#^Method App\\\\Tests\\\\Configuration\\\\MailConfigurationTest\\:\\:testGetFromAddress\\(\\) has no return type specified\\.$#" - count: 1 - path: Configuration/MailConfigurationTest.php - - - - message: "#^Method App\\\\Tests\\\\Configuration\\\\MailConfigurationTest\\:\\:testGetFromAddressWithEmptyAddressReturnsNull\\(\\) has no return type specified\\.$#" - count: 1 - path: Configuration/MailConfigurationTest.php - - message: "#^Method App\\\\Tests\\\\Configuration\\\\SamlConfigurationTest\\:\\:getDefaultSettings\\(\\) has no return type specified\\.$#" count: 1 @@ -1597,16 +807,6 @@ parameters: count: 1 path: Configuration/SamlConfigurationTest.php - - - message: "#^Method App\\\\Tests\\\\Configuration\\\\SamlConfigurationTest\\:\\:testDefault\\(\\) has no return type specified\\.$#" - count: 1 - path: Configuration/SamlConfigurationTest.php - - - - message: "#^Method App\\\\Tests\\\\Configuration\\\\SamlConfigurationTest\\:\\:testDefaultSettings\\(\\) has no return type specified\\.$#" - count: 1 - path: Configuration/SamlConfigurationTest.php - - message: "#^Method App\\\\Tests\\\\Configuration\\\\SystemConfigurationTest\\:\\:getSut\\(\\) has parameter \\$loaderSettings with no value type specified in iterable type array\\.$#" count: 1 @@ -1617,16 +817,6 @@ parameters: count: 1 path: Configuration/SystemConfigurationTest.php - - - message: "#^Method App\\\\Tests\\\\ConsoleApplicationTest\\:\\:testVersion\\(\\) has no return type specified\\.$#" - count: 1 - path: ConsoleApplicationTest.php - - - - message: "#^Method App\\\\Tests\\\\ConstantsTest\\:\\:testBuild\\(\\) has no return type specified\\.$#" - count: 1 - path: ConstantsTest.php - - message: "#^Cannot call method addSubscriber\\(\\) on object\\|null\\.$#" count: 1 @@ -1652,106 +842,6 @@ parameters: count: 1 path: Controller/ActivityControllerTest.php - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testAddRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testCreateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testCreateActionShowsMetaFields\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testCreateDefaultTeamAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testDeleteAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testDeleteActionWithTimesheetEntries\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testDeleteActionWithTimesheetEntriesAndReplacement\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testDetailsAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testEditAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testEditActionForGlobalActivity\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testExportAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testExportActionWithSearchTermQuery\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testExportIsSecureForRole\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testIndexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testIndexActionAsSuperAdmin\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testIndexActionWithSearchTermQuery\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testIsSecureForRole\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testTeamPermissionAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testValidationForCreateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ActivityControllerTest.php - - message: "#^Method App\\\\Tests\\\\Controller\\\\ActivityControllerTest\\:\\:testValidationForCreateAction\\(\\) has parameter \\$formData with no value type specified in iterable type array\\.$#" count: 1 @@ -1787,41 +877,6 @@ parameters: count: 1 path: Controller/Auth/SamlControllerTest.php - - - message: "#^Method App\\\\Tests\\\\Controller\\\\Auth\\\\SamlControllerTest\\:\\:testAcsActionThrowsExceptionOnDisabledSaml\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/Auth/SamlControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\Auth\\\\SamlControllerTest\\:\\:testAssertionConsumerServiceAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/Auth/SamlControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\Auth\\\\SamlControllerTest\\:\\:testLoginActionThrowsErrorOnSecurityErrorAttribute\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/Auth/SamlControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\Auth\\\\SamlControllerTest\\:\\:testLoginActionThrowsExceptionOnDisabledSaml\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/Auth/SamlControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\Auth\\\\SamlControllerTest\\:\\:testLogoutActionThrowsExceptionOnDisabledSaml\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/Auth/SamlControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\Auth\\\\SamlControllerTest\\:\\:testMetadataAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/Auth/SamlControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\Auth\\\\SamlControllerTest\\:\\:testMetadataActionThrowsExceptionOnDisabledSaml\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/Auth/SamlControllerTest.php - - message: "#^Parameter \\#1 \\$source of method DOMDocument\\:\\:loadXML\\(\\) expects string, string\\|false given\\.$#" count: 1 @@ -1832,26 +887,6 @@ parameters: count: 1 path: Controller/CalendarControllerTest.php - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CalendarControllerTest\\:\\:testCalendarAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CalendarControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CalendarControllerTest\\:\\:testCalendarActionAsSuperAdmin\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CalendarControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CalendarControllerTest\\:\\:testCalendarActionWithGoogleSource\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CalendarControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CalendarControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CalendarControllerTest.php - - message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, string\\|false given\\.$#" count: 4 @@ -1962,126 +997,6 @@ parameters: count: 1 path: Controller/CustomerControllerTest.php - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testAddCommentAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testAddRateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testCreateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testCreateActionShowsMetaFields\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testCreateDefaultTeamAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testDeleteAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testDeleteActionWithTimesheetEntries\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testDeleteActionWithTimesheetEntriesAndReplacement\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testDeleteCommentAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testDeleteCommentActionWithoutToken\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testDetailsAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testEditAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testExportAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testExportActionWithSearchTermQuery\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testExportIsSecureForRole\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testIndexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testIndexActionAsSuperAdmin\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testIndexActionWithSearchTermQuery\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testIsSecureForRole\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testPinCommentAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testProjectsAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testTeamPermissionAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testValidationForCreateAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/CustomerControllerTest.php - - message: "#^Method App\\\\Tests\\\\Controller\\\\CustomerControllerTest\\:\\:testValidationForCreateAction\\(\\) has parameter \\$formData with no value type specified in iterable type array\\.$#" count: 1 @@ -2107,76 +1022,6 @@ parameters: count: 2 path: Controller/CustomerControllerTest.php - - - message: "#^Method App\\\\Tests\\\\Controller\\\\DashboardControllerTest\\:\\:testIndexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/DashboardControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\DashboardControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/DashboardControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\DoctorControllerTest\\:\\:testDoctorIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/DoctorControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\DoctorControllerTest\\:\\:testDoctorIsSecureForRole\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/DoctorControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\DoctorControllerTest\\:\\:testFlushLogWithInvalidCsrf\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/DoctorControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\DoctorControllerTest\\:\\:testIndexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/DoctorControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testExportAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testExportActionWithInvalidRenderer\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testExportActionWithMissingRenderer\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testIndexActionHasErrorMessageOnEmptyQuery\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testIndexActionWithEntriesAndTeams\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testIndexActionWithEntriesForTeamleadDoesNotShowUserWithoutTeam\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\ExportControllerTest\\:\\:testIsSecureForrole\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/ExportControllerTest.php - - message: "#^Parameter \\#1 \\$project of method App\\\\Entity\\\\Team\\:\\:addProject\\(\\) expects App\\\\Entity\\\\Project, App\\\\Entity\\\\Project\\|null given\\.$#" count: 1 @@ -2187,21 +1032,6 @@ parameters: count: 2 path: Controller/ExportControllerTest.php - - - message: "#^Method App\\\\Tests\\\\Controller\\\\HomepageControllerTest\\:\\:testIndexAction\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/HomepageControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\HomepageControllerTest\\:\\:testIndexActionWithChangedPreferences\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/HomepageControllerTest.php - - - - message: "#^Method App\\\\Tests\\\\Controller\\\\HomepageControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#" - count: 1 - path: Controller/HomepageControllerTest.php - - message: "#^Argument of an invalid type array\\