Skip to content

Commit 6ad0600

Browse files
committed
Fix tests
1 parent 81da1cf commit 6ad0600

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Tests/Constraints/TimezoneValidatorTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getValidTimezones(): iterable
7676
yield ['PST8PDT'];
7777
yield ['America/Montreal'];
7878

79-
// expired in ICU
79+
// previously expired in ICU
8080
yield ['Europe/Saratov'];
8181

8282
// standard
@@ -316,6 +316,17 @@ public function getDeprecatedTimezones(): iterable
316316
*/
317317
public function testIntlCompatibility()
318318
{
319+
$reflector = new \ReflectionExtension('intl');
320+
ob_start();
321+
$reflector->info();
322+
$output = strip_tags(ob_get_clean());
323+
preg_match('/^ICU TZData version (?:=>)?(.*)$/m', $output, $matches);
324+
$tzDbVersion = isset($matches[1]) ? (int) trim($matches[1]) : 0;
325+
326+
if (!$tzDbVersion || 2017 <= $tzDbVersion) {
327+
$this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion);
328+
}
329+
319330
$constraint = new Timezone([
320331
'message' => 'myMessage',
321332
'intlCompatible' => true,

0 commit comments

Comments
 (0)