added multi-select for customer, project and activity (#1557)

This commit is contained in:
Kevin Papst
2020-03-16 14:06:26 +01:00
committed by GitHub
parent 6eeb01ad48
commit 4b1cfa5840
74 changed files with 1262 additions and 754 deletions

View File

@@ -158,9 +158,40 @@ class TimesheetControllerTest extends APIControllerBaseTest
$end->setTime(23, 59, 59);
$query = [
'customer' => 1,
'project' => 1,
'activity' => 1,
'customers' => '1',
'projects' => '1',
'activities' => '1',
'page' => 2,
'size' => 5,
'order' => 'DESC',
'orderBy' => 'rate',
'active' => 0,
'begin' => $begin->format(self::DATE_FORMAT_HTML5),
'end' => $end->format(self::DATE_FORMAT_HTML5),
'exported' => 0,
];
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
$result = json_decode($client->getResponse()->getContent(), true);
$this->assertIsArray($result);
$this->assertNotEmpty($result);
$this->assertEquals(5, count($result));
$this->assertDefaultStructure($result[0], false);
}
public function testGetCollectionWithDeprecatedQuery()
{
$begin = new \DateTime('first day of this month');
$begin->setTime(0, 0, 0);
$end = new \DateTime('last day of this month');
$end->setTime(23, 59, 59);
$query = [
'customer' => '1',
'project' => '1',
'activity' => '1',
'page' => 2,
'size' => 5,
'order' => 'DESC',