fix dates in project API (#1451)
This commit is contained in:
@@ -130,6 +130,9 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
'name' => 'foo',
|
||||
'customer' => 1,
|
||||
'visible' => true,
|
||||
'orderDate' => '2018-02-08T13:02:54',
|
||||
'start' => '2019-02-01T19:32:17',
|
||||
'end' => '2020-02-08T21:11:42',
|
||||
];
|
||||
$this->request($client, '/api/projects', 'POST', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
@@ -138,6 +141,9 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
$this->assertIsArray($result);
|
||||
$this->assertStructure($result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
self::assertEquals('2018-02-08T13:02:54+0000', $result['orderDate']);
|
||||
self::assertEquals('2019-02-01T19:32:17+0000', $result['start']);
|
||||
self::assertEquals('2020-02-08T21:11:42+0000', $result['end']);
|
||||
}
|
||||
|
||||
public function testPostActionWithInvalidUser()
|
||||
|
||||
@@ -102,10 +102,8 @@ class DailyWorkingTimeChartTest extends TestCase
|
||||
{
|
||||
$repository = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->onlyMethods(['getDailyData'])->getMock();
|
||||
$repository->expects($this->once())->method('getDailyData')->willReturnCallback(function ($begin, $end, $user) {
|
||||
$today = (new \DateTime());
|
||||
|
||||
return [
|
||||
['year' => $today->format('Y'), 'month' => $today->format('n'), 'day' => $today->format('j'), 'rate' => 13.75, 'duration' => 1234]
|
||||
['year' => $begin->format('Y'), 'month' => $begin->format('n'), 'day' => $begin->format('j'), 'rate' => 13.75, 'duration' => 1234]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user