financial year setting + new users working time per year report (#2547)
This commit is contained in:
@@ -35,7 +35,7 @@ class PermissionControllerTest extends ControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_SUPER_ADMIN);
|
||||
$this->assertAccessIsGranted($client, '/admin/permissions');
|
||||
$this->assertHasDataTable($client);
|
||||
$this->assertDataTableRowCount($client, 'datatable_user_admin_permissions', 118);
|
||||
$this->assertDataTableRowCount($client, 'datatable_user_admin_permissions', 119);
|
||||
$this->assertPageActions($client, [
|
||||
//'back' => $this->createUrl('/admin/user/'),
|
||||
'create modal-ajax-form' => $this->createUrl('/admin/permissions/roles/create'),
|
||||
|
||||
@@ -34,9 +34,13 @@ class ProfileControllerTest extends ControllerBaseTest
|
||||
$this->request($client, '/profile/' . UserFixtures::USERNAME_USER);
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$this->assertHasNoEntriesWithFilter($client);
|
||||
$this->assertHasProfileBox($client, 'John Doe');
|
||||
$this->assertHasAboutMeBox($client, UserFixtures::USERNAME_USER);
|
||||
|
||||
$content = $client->getResponse()->getContent();
|
||||
$year = (new \DateTime())->format('Y');
|
||||
$this->assertStringContainsString('<h3 class="box-title">' . $year . '</h3>', $content);
|
||||
$this->assertStringContainsString('var userProfileChart' . $year . ' = new Chart(', $content);
|
||||
}
|
||||
|
||||
public function testIndexAction()
|
||||
|
||||
@@ -28,6 +28,11 @@ class ReportUsersListControllerTest extends ControllerBaseTest
|
||||
$this->importFixture($fixture);
|
||||
}
|
||||
|
||||
public function testYearlyListIsSecure()
|
||||
{
|
||||
$this->assertUrlIsSecured('/reporting/yearly_users_list');
|
||||
}
|
||||
|
||||
public function testWeeklyListIsSecure()
|
||||
{
|
||||
$this->assertUrlIsSecured('/reporting/weekly_users_list');
|
||||
@@ -38,6 +43,11 @@ class ReportUsersListControllerTest extends ControllerBaseTest
|
||||
$this->assertUrlIsSecured('/reporting/monthly_users_list');
|
||||
}
|
||||
|
||||
public function testYearlyUsersListIsSecureForUserRole()
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/reporting/yearly_users_list');
|
||||
}
|
||||
|
||||
public function testWeeklyUsersListIsSecureForUserRole()
|
||||
{
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/reporting/weekly_users_list');
|
||||
@@ -48,6 +58,16 @@ class ReportUsersListControllerTest extends ControllerBaseTest
|
||||
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/reporting/monthly_users_list');
|
||||
}
|
||||
|
||||
public function testYearlyUsersReport()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
$this->importReportingFixture(User::ROLE_TEAMLEAD);
|
||||
$this->assertAccessIsGranted($client, '/reporting/yearly_users_list');
|
||||
self::assertStringContainsString('<div class="box-body yearly-user-list-reporting-box', $client->getResponse()->getContent());
|
||||
$select = $client->getCrawler()->filterXPath("//select[@id='user']");
|
||||
self::assertEquals(0, $select->count());
|
||||
}
|
||||
|
||||
public function testWeeklyUsersReport()
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
|
||||
Reference in New Issue
Block a user