Skip to content

Commit 928a37e

Browse files
Fix timestamp regex to accept both Z and timezone offset formats
- Accept both '2024-01-01T12:00:00Z' and '2024-01-01T12:00:00+00:00' - Fixes test failures on systems with different git timestamp formats Co-authored-by: Manuel Kießling <manuel@kiessling.net>
1 parent f2bdfb4 commit 928a37e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/Unit/WorkspaceMgmt/GitCliAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ public function testGetRecentCommitsTimestampIsIso8601(): void
176176

177177
self::assertCount(1, $commits);
178178

179-
// Verify timestamp is in ISO 8601 format (e.g., 2024-01-01T12:00:00+00:00)
179+
// Verify timestamp is in ISO 8601 format (e.g., 2024-01-01T12:00:00+00:00 or 2024-01-01T12:00:00Z)
180180
$timestamp = $commits[0]->timestamp;
181-
self::assertMatchesRegularExpression('/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2}$/', $timestamp);
181+
self::assertMatchesRegularExpression('/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$/', $timestamp);
182182
}
183183

184184
private function runGitCommand(string $command): void

0 commit comments

Comments
 (0)