added multi-select for customer, project and activity (#1557)
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user