Fix tests
This commit is contained in:
parent
dd3dc1a684
commit
733f017904
@ -122,6 +122,17 @@ class TimezoneTypeTest extends BaseTypeTest
|
||||
*/
|
||||
public function testIntlTimeZoneInputWithBc()
|
||||
{
|
||||
$reflector = new \ReflectionExtension('intl');
|
||||
ob_start();
|
||||
$reflector->info();
|
||||
$output = strip_tags(ob_get_clean());
|
||||
preg_match('/^ICU TZData version (?:=>)?(.*)$/m', $output, $matches);
|
||||
$tzDbVersion = isset($matches[1]) ? (int) trim($matches[1]) : 0;
|
||||
|
||||
if (!$tzDbVersion || 2017 <= $tzDbVersion) {
|
||||
$this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion);
|
||||
}
|
||||
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'intltimezone']);
|
||||
$form->submit('Europe/Saratov');
|
||||
|
||||
@ -134,6 +145,17 @@ class TimezoneTypeTest extends BaseTypeTest
|
||||
*/
|
||||
public function testIntlTimeZoneInputWithBcAndIntl()
|
||||
{
|
||||
$reflector = new \ReflectionExtension('intl');
|
||||
ob_start();
|
||||
$reflector->info();
|
||||
$output = strip_tags(ob_get_clean());
|
||||
preg_match('/^ICU TZData version (?:=>)?(.*)$/m', $output, $matches);
|
||||
$tzDbVersion = isset($matches[1]) ? (int) trim($matches[1]) : 0;
|
||||
|
||||
if (!$tzDbVersion || 2017 <= $tzDbVersion) {
|
||||
$this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion);
|
||||
}
|
||||
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, ['input' => 'intltimezone', 'intl' => true]);
|
||||
$form->submit('Europe/Saratov');
|
||||
|
||||
|
@ -76,7 +76,7 @@ class TimezoneValidatorTest extends ConstraintValidatorTestCase
|
||||
yield ['PST8PDT'];
|
||||
yield ['America/Montreal'];
|
||||
|
||||
// expired in ICU
|
||||
// previously expired in ICU
|
||||
yield ['Europe/Saratov'];
|
||||
|
||||
// standard
|
||||
@ -316,6 +316,17 @@ class TimezoneValidatorTest extends ConstraintValidatorTestCase
|
||||
*/
|
||||
public function testIntlCompatibility()
|
||||
{
|
||||
$reflector = new \ReflectionExtension('intl');
|
||||
ob_start();
|
||||
$reflector->info();
|
||||
$output = strip_tags(ob_get_clean());
|
||||
preg_match('/^ICU TZData version (?:=>)?(.*)$/m', $output, $matches);
|
||||
$tzDbVersion = isset($matches[1]) ? (int) trim($matches[1]) : 0;
|
||||
|
||||
if (!$tzDbVersion || 2017 <= $tzDbVersion) {
|
||||
$this->markTestSkipped('"Europe/Saratov" is expired until 2017, current version is '.$tzDbVersion);
|
||||
}
|
||||
|
||||
$constraint = new Timezone([
|
||||
'message' => 'myMessage',
|
||||
'intlCompatible' => true,
|
||||
|
Reference in New Issue
Block a user