Release 2.12 (#4609)
This commit is contained in:
@@ -27,17 +27,17 @@ use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
*/
|
||||
class ActivityControllerTest extends ControllerBaseTest
|
||||
{
|
||||
public function testIsSecure()
|
||||
public function testIsSecure(): void
|
||||
{
|
||||
$this->assertUrlIsSecured('/admin/activity/');
|
||||
}
|
||||
|
||||
public function testIsSecureForRole()
|
||||
public function testIsSecureForRole(): void
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/admin/activity/');
|
||||
}
|
||||
|
||||
public function testIndexAction()
|
||||
public function testIndexAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/');
|
||||
@@ -49,7 +49,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testIndexActionAsSuperAdmin()
|
||||
public function testIndexActionAsSuperAdmin(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/');
|
||||
@@ -61,7 +61,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testIndexActionWithSearchTermQuery()
|
||||
public function testIndexActionWithSearchTermQuery(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
@@ -92,19 +92,19 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertDataTableRowCount($client, 'datatable_activity_admin', 5);
|
||||
}
|
||||
|
||||
public function testExportIsSecureForRole()
|
||||
public function testExportIsSecureForRole(): void
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/admin/activity/export');
|
||||
}
|
||||
|
||||
public function testExportAction()
|
||||
public function testExportAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/export');
|
||||
$this->assertExcelExportResponse($client, 'kimai-activities_');
|
||||
}
|
||||
|
||||
public function testExportActionWithSearchTermQuery()
|
||||
public function testExportActionWithSearchTermQuery(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
@@ -134,7 +134,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertExcelExportResponse($client, 'kimai-activities_');
|
||||
}
|
||||
|
||||
public function testDetailsAction()
|
||||
public function testDetailsAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
/** @var EntityManager $em */
|
||||
@@ -171,7 +171,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
self::assertEquals(1, $node->count());
|
||||
}
|
||||
|
||||
public function testAddRateAction()
|
||||
public function testAddRateAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/1/rate');
|
||||
@@ -190,7 +190,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
self::assertStringContainsString('123.45', $node->text(null, true));
|
||||
}
|
||||
|
||||
public function testCreateAction()
|
||||
public function testCreateAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/create');
|
||||
@@ -218,7 +218,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertEquals('An AcTiVitY Name', $editForm->get('activity_edit_form[name]')->getValue());
|
||||
}
|
||||
|
||||
public function testCreateActionShowsMetaFields()
|
||||
public function testCreateActionShowsMetaFields(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
self::getContainer()->get('event_dispatcher')->addSubscriber(new ActivityTestMetaFieldSubscriberMock());
|
||||
@@ -231,7 +231,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertFalse($form->has('activity_edit_form[metaFields][0][value]'));
|
||||
}
|
||||
|
||||
public function testEditAction()
|
||||
public function testEditAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/1/edit');
|
||||
@@ -247,7 +247,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertEquals('Test 2', $editForm->get('activity_edit_form[name]')->getValue());
|
||||
}
|
||||
|
||||
public function testEditActionForGlobalActivity()
|
||||
public function testEditActionForGlobalActivity(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/1/edit');
|
||||
@@ -263,7 +263,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertEquals('Test 2', $editForm->get('activity_edit_form[name]')->getValue());
|
||||
}
|
||||
|
||||
public function testTeamPermissionAction()
|
||||
public function testTeamPermissionAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$em = $this->getEntityManager();
|
||||
@@ -295,7 +295,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
self::assertEquals(2, $activity->getTeams()->count());
|
||||
}
|
||||
|
||||
public function testCreateDefaultTeamAction()
|
||||
public function testCreateDefaultTeamAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/activity/1/details');
|
||||
@@ -311,7 +311,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
self::assertEquals(1, $node->count());
|
||||
}
|
||||
|
||||
public function testDeleteAction()
|
||||
public function testDeleteAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->request($client, '/admin/activity/1/edit');
|
||||
@@ -332,7 +332,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertFalse($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
public function testDeleteActionWithTimesheetEntries()
|
||||
public function testDeleteActionWithTimesheetEntries(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
@@ -372,7 +372,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
$this->assertFalse($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
public function testDeleteActionWithTimesheetEntriesAndReplacement()
|
||||
public function testDeleteActionWithTimesheetEntriesAndReplacement(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
@@ -428,7 +428,7 @@ class ActivityControllerTest extends ControllerBaseTest
|
||||
/**
|
||||
* @dataProvider getValidationTestData
|
||||
*/
|
||||
public function testValidationForCreateAction(array $formData, array $validationFields)
|
||||
public function testValidationForCreateAction(array $formData, array $validationFields): void
|
||||
{
|
||||
$this->assertFormHasValidationError(
|
||||
User::ROLE_ADMIN,
|
||||
|
||||
@@ -60,7 +60,7 @@ class SamlControllerTest extends TestCase
|
||||
return new SamlConfiguration($this->getSystemConfigurationMock($this->getDefaultSettings($activated), []));
|
||||
}
|
||||
|
||||
public function testAssertionConsumerServiceAction()
|
||||
public function testAssertionConsumerServiceAction(): void
|
||||
{
|
||||
$this->expectException(\RuntimeException::class);
|
||||
$this->expectExceptionMessage('You must configure the check path in your firewall.');
|
||||
@@ -71,7 +71,7 @@ class SamlControllerTest extends TestCase
|
||||
$sut->assertionConsumerServiceAction();
|
||||
}
|
||||
|
||||
public function testMetadataAction()
|
||||
public function testMetadataAction(): void
|
||||
{
|
||||
$expectedXmlString = <<<EOD
|
||||
<?xml version="1.0"?>
|
||||
@@ -120,7 +120,7 @@ class SamlControllerTest extends TestCase
|
||||
self::assertEquals($expected->firstChild->firstChild, $actual->firstChild->firstChild);
|
||||
}
|
||||
|
||||
public function testLoginActionThrowsErrorOnSecurityErrorAttribute()
|
||||
public function testLoginActionThrowsErrorOnSecurityErrorAttribute(): void
|
||||
{
|
||||
$this->expectException(\RuntimeException::class);
|
||||
$this->expectExceptionMessage('My test error');
|
||||
@@ -135,7 +135,7 @@ class SamlControllerTest extends TestCase
|
||||
$sut->loginAction($request);
|
||||
}
|
||||
|
||||
public function testLoginActionThrowsExceptionOnDisabledSaml()
|
||||
public function testLoginActionThrowsExceptionOnDisabledSaml(): void
|
||||
{
|
||||
$this->expectException(NotFoundHttpException::class);
|
||||
$this->expectExceptionMessage('SAML deactivated');
|
||||
@@ -146,7 +146,7 @@ class SamlControllerTest extends TestCase
|
||||
$sut->loginAction(new Request());
|
||||
}
|
||||
|
||||
public function testMetadataActionThrowsExceptionOnDisabledSaml()
|
||||
public function testMetadataActionThrowsExceptionOnDisabledSaml(): void
|
||||
{
|
||||
$this->expectException(NotFoundHttpException::class);
|
||||
$this->expectExceptionMessage('SAML deactivated');
|
||||
@@ -157,7 +157,7 @@ class SamlControllerTest extends TestCase
|
||||
$sut->metadataAction();
|
||||
}
|
||||
|
||||
public function testLogoutActionThrowsExceptionOnDisabledSaml()
|
||||
public function testLogoutActionThrowsExceptionOnDisabledSaml(): void
|
||||
{
|
||||
$this->expectException(NotFoundHttpException::class);
|
||||
$this->expectExceptionMessage('SAML deactivated');
|
||||
@@ -168,7 +168,7 @@ class SamlControllerTest extends TestCase
|
||||
$sut->logoutAction();
|
||||
}
|
||||
|
||||
public function testAcsActionThrowsExceptionOnDisabledSaml()
|
||||
public function testAcsActionThrowsExceptionOnDisabledSaml(): void
|
||||
{
|
||||
$this->expectException(NotFoundHttpException::class);
|
||||
$this->expectExceptionMessage('SAML deactivated');
|
||||
|
||||
@@ -20,12 +20,12 @@ use App\Tests\Mocks\SystemConfigurationFactory;
|
||||
*/
|
||||
class CalendarControllerTest extends ControllerBaseTest
|
||||
{
|
||||
public function testIsSecure()
|
||||
public function testIsSecure(): void
|
||||
{
|
||||
$this->assertUrlIsSecured('/calendar/');
|
||||
}
|
||||
|
||||
public function testCalendarAction()
|
||||
public function testCalendarAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser();
|
||||
$fixtures = new TimesheetFixtures($this->getUserByRole(), 10);
|
||||
@@ -42,13 +42,13 @@ class CalendarControllerTest extends ControllerBaseTest
|
||||
$this->assertEquals(1, $dragAndDropBoxes->count());
|
||||
}
|
||||
|
||||
public function testCalendarActionAsSuperAdmin()
|
||||
public function testCalendarActionAsSuperAdmin(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/calendar/');
|
||||
}
|
||||
|
||||
public function testCalendarActionWithGoogleSource()
|
||||
public function testCalendarActionWithGoogleSource(): void
|
||||
{
|
||||
$loader = new TestConfigLoader([]);
|
||||
$config = SystemConfigurationFactory::create($loader, $this->getDefaultSettings());
|
||||
|
||||
@@ -28,17 +28,17 @@ use Symfony\Component\HttpKernel\HttpKernelBrowser;
|
||||
*/
|
||||
class CustomerControllerTest extends ControllerBaseTest
|
||||
{
|
||||
public function testIsSecure()
|
||||
public function testIsSecure(): void
|
||||
{
|
||||
$this->assertUrlIsSecured('/admin/customer/');
|
||||
}
|
||||
|
||||
public function testIsSecureForRole()
|
||||
public function testIsSecureForRole(): void
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/admin/customer/');
|
||||
}
|
||||
|
||||
public function testIndexAction()
|
||||
public function testIndexAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
$this->assertAccessIsGranted($client, '/admin/customer/');
|
||||
@@ -49,7 +49,7 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testIndexActionAsSuperAdmin()
|
||||
public function testIndexActionAsSuperAdmin(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/customer/');
|
||||
@@ -61,7 +61,7 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testIndexActionWithSearchTermQuery()
|
||||
public function testIndexActionWithSearchTermQuery(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
@@ -95,19 +95,19 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
$this->assertDataTableRowCount($client, 'datatable_customer_admin', 5);
|
||||
}
|
||||
|
||||
public function testExportIsSecureForRole()
|
||||
public function testExportIsSecureForRole(): void
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/admin/customer/export');
|
||||
}
|
||||
|
||||
public function testExportAction()
|
||||
public function testExportAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
$this->assertAccessIsGranted($client, '/admin/customer/export');
|
||||
$this->assertExcelExportResponse($client, 'kimai-customers_');
|
||||
}
|
||||
|
||||
public function testExportActionWithSearchTermQuery()
|
||||
public function testExportActionWithSearchTermQuery(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
|
||||
@@ -126,7 +126,7 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
$this->assertExcelExportResponse($client, 'kimai-customers_');
|
||||
}
|
||||
|
||||
public function testDetailsAction()
|
||||
public function testDetailsAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/customer/1/details');
|
||||
@@ -155,7 +155,7 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
self::assertEquals(1, $node->count());
|
||||
}
|
||||
|
||||
public function testAddRateAction()
|
||||
public function testAddRateAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/customer/1/rate');
|
||||
@@ -174,7 +174,7 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
self::assertStringContainsString('123.45', $node->text(null, true));
|
||||
}
|
||||
|
||||
public function testAddCommentAction()
|
||||
public function testAddCommentAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
@@ -197,7 +197,7 @@ class CustomerControllerTest extends ControllerBaseTest
|
||||
self::assertStringContainsString('<p>A beautiful and short comment <strong>with some</strong> markdown formatting</p>', $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,
|
||||
|
||||
@@ -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/');
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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('<p>A beautiful and long comment <strong>with some</strong> markdown formatting</p>', $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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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/');
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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('<a href="/en/login">', $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 [
|
||||
[
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user