From f40ae91444da6a86a3a80e9783ba7a6c889cd5da Mon Sep 17 00:00:00 2001 From: Constantin Graf Date: Thu, 6 Jun 2024 18:46:23 +0200 Subject: [PATCH] Fixed timezone in time entries importer (tests) --- .../Api/V1/OrganizationController.php | 2 ++ .../Importer/ClockifyTimeEntriesImporterTest.php | 16 ++++++++-------- .../Importer/TogglTimeEntriesImporterTest.php | 16 ++++++++-------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Api/V1/OrganizationController.php b/app/Http/Controllers/Api/V1/OrganizationController.php index 9859602b..5dcd431c 100644 --- a/app/Http/Controllers/Api/V1/OrganizationController.php +++ b/app/Http/Controllers/Api/V1/OrganizationController.php @@ -15,6 +15,7 @@ class OrganizationController extends Controller * Get organization * * @operationId getOrganization + * * @throws AuthorizationException */ public function show(Organization $organization): OrganizationResource @@ -28,6 +29,7 @@ class OrganizationController extends Controller * Update organization * * @operationId updateOrganization + * * @throws AuthorizationException */ public function update(Organization $organization, OrganizationUpdateRequest $request): OrganizationResource diff --git a/tests/Unit/Service/Import/Importer/ClockifyTimeEntriesImporterTest.php b/tests/Unit/Service/Import/Importer/ClockifyTimeEntriesImporterTest.php index 744a1425..170a10ac 100644 --- a/tests/Unit/Service/Import/Importer/ClockifyTimeEntriesImporterTest.php +++ b/tests/Unit/Service/Import/Importer/ClockifyTimeEntriesImporterTest.php @@ -30,16 +30,16 @@ class ClockifyTimeEntriesImporterTest extends ImporterTestAbstract $timeEntry1 = $timeEntries->firstWhere('description', ''); $this->assertNotNull($timeEntry1); $this->assertSame('', $timeEntry1->description); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->start->toDateTimeString()); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->start->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->end->toDateTimeString()); $this->assertFalse($timeEntry1->billable); $this->assertTrue($timeEntry1->is_imported); $this->assertSame([$testScenario->tag1->getKey(), $testScenario->tag2->getKey()], $timeEntry1->tags); $timeEntry2 = $timeEntries->firstWhere('description', 'Working hard'); $this->assertNotNull($timeEntry2); $this->assertSame('Working hard', $timeEntry2->description); - $this->assertSame('2024-03-04 10:23:00', $timeEntry2->start->toDateTimeString()); - $this->assertSame('2024-03-04 11:23:01', $timeEntry2->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:00', $timeEntry2->start->toDateTimeString()); + $this->assertSame('2024-03-04 10:23:01', $timeEntry2->end->toDateTimeString()); $this->assertTrue($timeEntry2->billable); $this->assertTrue($timeEntry2->is_imported); $this->assertSame([], $timeEntry2->tags); @@ -67,16 +67,16 @@ class ClockifyTimeEntriesImporterTest extends ImporterTestAbstract $timeEntry1 = $timeEntries->firstWhere('description', ''); $this->assertNotNull($timeEntry1); $this->assertSame('', $timeEntry1->description); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->start->toDateTimeString()); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->start->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->end->toDateTimeString()); $this->assertFalse($timeEntry1->billable); $this->assertTrue($timeEntry1->is_imported); $this->assertSame([$testScenario->tag1->getKey(), $testScenario->tag2->getKey()], $timeEntry1->tags); $timeEntry2 = $timeEntries->firstWhere('description', 'Working hard'); $this->assertNotNull($timeEntry2); $this->assertSame('Working hard', $timeEntry2->description); - $this->assertSame('2024-03-04 10:23:00', $timeEntry2->start->toDateTimeString()); - $this->assertSame('2024-03-04 11:23:01', $timeEntry2->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:00', $timeEntry2->start->toDateTimeString()); + $this->assertSame('2024-03-04 10:23:01', $timeEntry2->end->toDateTimeString()); $this->assertTrue($timeEntry2->billable); $this->assertTrue($timeEntry2->is_imported); $this->assertSame([], $timeEntry2->tags); diff --git a/tests/Unit/Service/Import/Importer/TogglTimeEntriesImporterTest.php b/tests/Unit/Service/Import/Importer/TogglTimeEntriesImporterTest.php index fc36c1d1..523df916 100644 --- a/tests/Unit/Service/Import/Importer/TogglTimeEntriesImporterTest.php +++ b/tests/Unit/Service/Import/Importer/TogglTimeEntriesImporterTest.php @@ -31,15 +31,15 @@ class TogglTimeEntriesImporterTest extends ImporterTestAbstract $timeEntry1 = $timeEntries->firstWhere('description', ''); $this->assertNotNull($timeEntry1); $this->assertSame('', $timeEntry1->description); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->start->toDateTimeString()); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->start->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->end->toDateTimeString()); $this->assertFalse($timeEntry1->billable); $this->assertSame([$testScenario->tag1->getKey(), $testScenario->tag2->getKey()], $timeEntry1->tags); $timeEntry2 = $timeEntries->firstWhere('description', 'Working hard'); $this->assertNotNull($timeEntry2); $this->assertSame('Working hard', $timeEntry2->description); - $this->assertSame('2024-03-04 10:23:00', $timeEntry2->start->toDateTimeString()); - $this->assertSame('2024-03-04 11:23:01', $timeEntry2->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:00', $timeEntry2->start->toDateTimeString()); + $this->assertSame('2024-03-04 10:23:01', $timeEntry2->end->toDateTimeString()); $this->assertTrue($timeEntry2->billable); $this->assertSame([], $timeEntry2->tags); $this->assertSame(2, $report->timeEntriesCreated); @@ -73,15 +73,15 @@ class TogglTimeEntriesImporterTest extends ImporterTestAbstract $timeEntry1 = $timeEntries->firstWhere('description', ''); $this->assertNotNull($timeEntry1); $this->assertSame('', $timeEntry1->description); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->start->toDateTimeString()); - $this->assertSame('2024-03-04 10:23:52', $timeEntry1->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->start->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:52', $timeEntry1->end->toDateTimeString()); $this->assertFalse($timeEntry1->billable); $this->assertSame([$testScenario->tag1->getKey(), $testScenario->tag2->getKey()], $timeEntry1->tags); $timeEntry2 = $timeEntries->firstWhere('description', 'Working hard'); $this->assertNotNull($timeEntry2); $this->assertSame('Working hard', $timeEntry2->description); - $this->assertSame('2024-03-04 10:23:00', $timeEntry2->start->toDateTimeString()); - $this->assertSame('2024-03-04 11:23:01', $timeEntry2->end->toDateTimeString()); + $this->assertSame('2024-03-04 09:23:00', $timeEntry2->start->toDateTimeString()); + $this->assertSame('2024-03-04 10:23:01', $timeEntry2->end->toDateTimeString()); $this->assertTrue($timeEntry2->billable); $this->assertSame([], $timeEntry2->tags); $this->assertSame(2, $report->timeEntriesCreated);