Skip to content

Fix ICU dependant tests #21320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ public function testReverseTransformEmpty()

public function testReverseTransformWithGrouping()
{
// Since we test against "de_AT", we need the full implementation
// Since we test against "de_DE", we need the full implementation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

German data seems to be changing less often.

IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$transformer = new IntegerToLocalizedStringTransformer(null, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function testTransform($from, $to, $locale)
public function provideTransformationsWithGrouping()
{
return array(
array(1234.5, '1.234,5', 'de_AT'),
array(12345.912, '12.345,912', 'de_AT'),
array(1234.5, '1.234,5', 'de_DE'),
array(12345.912, '12.345,912', 'de_DE'),
array(1234.5, '1 234,5', 'fr'),
array(1234.5, '1 234,5', 'ru'),
array(1234.5, '1 234,5', 'fi'),
Expand Down Expand Up @@ -410,10 +410,10 @@ public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
*/
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGroupSep()
{
// Since we test against "de_AT", we need the full implementation
// Since we test against "de_DE", we need the full implementation
IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$transformer = new NumberToLocalizedStringTransformer(null, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public function testSubmitFromSingleTextDateTimeWithDefaultFormat()

public function testSubmitFromSingleTextDateTime()
{
// we test against "de_AT", so we need the full implementation
// we test against "de_DE", so we need the full implementation
IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$form = $this->factory->create('date', null, array(
'format' => \IntlDateFormatter::MEDIUM,
Expand All @@ -90,10 +90,10 @@ public function testSubmitFromSingleTextDateTime()

public function testSubmitFromSingleTextString()
{
// we test against "de_AT", so we need the full implementation
// we test against "de_DE", so we need the full implementation
IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$form = $this->factory->create('date', null, array(
'format' => \IntlDateFormatter::MEDIUM,
Expand All @@ -111,10 +111,10 @@ public function testSubmitFromSingleTextString()

public function testSubmitFromSingleTextTimestamp()
{
// we test against "de_AT", so we need the full implementation
// we test against "de_DE", so we need the full implementation
IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$form = $this->factory->create('date', null, array(
'format' => \IntlDateFormatter::MEDIUM,
Expand All @@ -134,10 +134,10 @@ public function testSubmitFromSingleTextTimestamp()

public function testSubmitFromSingleTextRaw()
{
// we test against "de_AT", so we need the full implementation
// we test against "de_DE", so we need the full implementation
IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$form = $this->factory->create('date', null, array(
'format' => \IntlDateFormatter::MEDIUM,
Expand Down Expand Up @@ -398,10 +398,10 @@ public function testThrowExceptionIfDaysIsInvalid()

public function testSetDataWithNegativeTimezoneOffsetStringInput()
{
// we test against "de_AT", so we need the full implementation
// we test against "de_DE", so we need the full implementation
IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$form = $this->factory->create('date', null, array(
'format' => \IntlDateFormatter::MEDIUM,
Expand All @@ -420,10 +420,10 @@ public function testSetDataWithNegativeTimezoneOffsetStringInput()

public function testSetDataWithNegativeTimezoneOffsetDateTimeInput()
{
// we test against "de_AT", so we need the full implementation
// we test against "de_DE", so we need the full implementation
IntlTestHelper::requireFullIntl($this, false);

\Locale::setDefault('de_AT');
\Locale::setDefault('de_DE');

$form = $this->factory->create('date', null, array(
'format' => \IntlDateFormatter::MEDIUM,
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Intl/Util/IntlTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function requireIntl(\PHPUnit_Framework_TestCase $testCase, $minim
// * the intl extension is loaded with version Intl::getIcuStubVersion()
// * the intl extension is not loaded

if (($minimumIcuVersion || defined('HHVM_VERSION_ID')) && IcuVersion::compare(Intl::getIcuVersion(), $minimumIcuVersion, '!=', 1)) {
if (($minimumIcuVersion || defined('HHVM_VERSION_ID')) && IcuVersion::compare(Intl::getIcuVersion(), $minimumIcuVersion, '<', 1)) {
$testCase->markTestSkipped('ICU version '.$minimumIcuVersion.' is required.');
}

Expand Down