Skip to content

Commit 9352177

Browse files
[Validator] Skip tests using unavailable timezone on the local host
1 parent d8d1446 commit 9352177

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tests/Constraints/TimezoneValidatorTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ public function testGroupedTimezonesWithInvalidCountry()
274274
*/
275275
public function testDeprecatedTimezonesAreValidWithBC(string $timezone)
276276
{
277+
// Skip test if the timezone is not available in the current timezone database
278+
if (!\in_array($timezone, \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC), true)) {
279+
$this->markTestSkipped(sprintf('Timezone "%s" is not available in the current timezone database', $timezone));
280+
}
281+
277282
$constraint = new Timezone(\DateTimeZone::ALL_WITH_BC);
278283

279284
$this->validator->validate($timezone, $constraint);

0 commit comments

Comments
 (0)