Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 388be9d

Browse filesBrowse files
committed
minor #21320 Fix ICU dependant tests (jakzal)
This PR was squashed before being merged into the 2.7 branch (closes #21320). Discussion ---------- Fix ICU dependant tests | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - #20551 changed the condition checking if the ICU version matches the stubbed data. The change intended to enable tests on more ICU versions, but it actually has limited them. I'm still not convinced it should've been done but let's at least fix the condition. Ideal solution would be to have the latest ICU data available on travis (still not there travis-ci/travis-ci#3616). I also needed to fix several tests. Currently skipped tests in components depending on ICU data: | | 4.8.1.1 | 54.1 | 55.1 | 57.1 | |---|---|--|--|--| | Intl | 488 | 488 | 7 | 6 | | Locale | 0 | 0 | 0 | 0 | | Translation| 0 | 0 | 0 | 0 | | Validator | 69 | 69 | 69 | 0 | | Form | 75 | 75 | 75 | 1 | Commits ------- d3b5d8e Fix tests with ICU 57.1 677d820 Fix the condition checking the minimum ICU version
2 parents 0292cf2 + d3b5d8e commit 388be9d
Copy full SHA for 388be9d

File tree

4 files changed

+19
-19
lines changed
Filter options

4 files changed

+19
-19
lines changed

‎src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ public function testReverseTransformEmpty()
108108

109109
public function testReverseTransformWithGrouping()
110110
{
111-
// Since we test against "de_AT", we need the full implementation
111+
// Since we test against "de_DE", we need the full implementation
112112
IntlTestHelper::requireFullIntl($this, false);
113113

114-
\Locale::setDefault('de_AT');
114+
\Locale::setDefault('de_DE');
115115

116116
$transformer = new IntegerToLocalizedStringTransformer(null, true);
117117

‎src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function testTransform($from, $to, $locale)
5454
public function provideTransformationsWithGrouping()
5555
{
5656
return array(
57-
array(1234.5, '1.234,5', 'de_AT'),
58-
array(12345.912, '12.345,912', 'de_AT'),
57+
array(1234.5, '1.234,5', 'de_DE'),
58+
array(12345.912, '12.345,912', 'de_DE'),
5959
array(1234.5, '1 234,5', 'fr'),
6060
array(1234.5, '1 234,5', 'ru'),
6161
array(1234.5, '1 234,5', 'fi'),
@@ -410,10 +410,10 @@ public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDot()
410410
*/
411411
public function testDecimalSeparatorMayNotBeDotIfGroupingSeparatorIsDotWithNoGroupSep()
412412
{
413-
// Since we test against "de_AT", we need the full implementation
413+
// Since we test against "de_DE", we need the full implementation
414414
IntlTestHelper::requireFullIntl($this, false);
415415

416-
\Locale::setDefault('de_AT');
416+
\Locale::setDefault('de_DE');
417417

418418
$transformer = new NumberToLocalizedStringTransformer(null, true);
419419

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
+12-12Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public function testSubmitFromSingleTextDateTimeWithDefaultFormat()
6969

7070
public function testSubmitFromSingleTextDateTime()
7171
{
72-
// we test against "de_AT", so we need the full implementation
72+
// we test against "de_DE", so we need the full implementation
7373
IntlTestHelper::requireFullIntl($this, false);
7474

75-
\Locale::setDefault('de_AT');
75+
\Locale::setDefault('de_DE');
7676

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

9191
public function testSubmitFromSingleTextString()
9292
{
93-
// we test against "de_AT", so we need the full implementation
93+
// we test against "de_DE", so we need the full implementation
9494
IntlTestHelper::requireFullIntl($this, false);
9595

96-
\Locale::setDefault('de_AT');
96+
\Locale::setDefault('de_DE');
9797

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

112112
public function testSubmitFromSingleTextTimestamp()
113113
{
114-
// we test against "de_AT", so we need the full implementation
114+
// we test against "de_DE", so we need the full implementation
115115
IntlTestHelper::requireFullIntl($this, false);
116116

117-
\Locale::setDefault('de_AT');
117+
\Locale::setDefault('de_DE');
118118

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

135135
public function testSubmitFromSingleTextRaw()
136136
{
137-
// we test against "de_AT", so we need the full implementation
137+
// we test against "de_DE", so we need the full implementation
138138
IntlTestHelper::requireFullIntl($this, false);
139139

140-
\Locale::setDefault('de_AT');
140+
\Locale::setDefault('de_DE');
141141

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

399399
public function testSetDataWithNegativeTimezoneOffsetStringInput()
400400
{
401-
// we test against "de_AT", so we need the full implementation
401+
// we test against "de_DE", so we need the full implementation
402402
IntlTestHelper::requireFullIntl($this, false);
403403

404-
\Locale::setDefault('de_AT');
404+
\Locale::setDefault('de_DE');
405405

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

421421
public function testSetDataWithNegativeTimezoneOffsetDateTimeInput()
422422
{
423-
// we test against "de_AT", so we need the full implementation
423+
// we test against "de_DE", so we need the full implementation
424424
IntlTestHelper::requireFullIntl($this, false);
425425

426-
\Locale::setDefault('de_AT');
426+
\Locale::setDefault('de_DE');
427427

428428
$form = $this->factory->create('date', null, array(
429429
'format' => \IntlDateFormatter::MEDIUM,

‎src/Symfony/Component/Intl/Util/IntlTestHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Intl/Util/IntlTestHelper.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static function requireIntl(\PHPUnit_Framework_TestCase $testCase, $minim
4141
// * the intl extension is loaded with version Intl::getIcuStubVersion()
4242
// * the intl extension is not loaded
4343

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.