Skip to content

Commit 3c5c0dc

Browse files
minor #61390 run tests with PHPUnit 12.3 (xabbuh)
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e1092 run tests with PHPUnit 12.3
2 parents 7da6905 + d3d6818 commit 3c5c0dc

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ protected function setUp(): void
5252

5353
protected function tearDown(): void
5454
{
55-
\Locale::setDefault($this->defaultLocale);
55+
if (isset($this->defaultLocale)) {
56+
\Locale::setDefault($this->defaultLocale);
57+
}
5658

5759
if (\extension_loaded('intl')) {
5860
ini_set('intl.use_exceptions', $this->initialTestCaseUseException);

Tests/Extension/Core/Type/IntegerTypeTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ protected function setUp(): void
3030

3131
protected function tearDown(): void
3232
{
33-
\Locale::setDefault($this->previousLocale);
33+
if (isset($this->defaultLocale)) {
34+
\Locale::setDefault($this->defaultLocale);
35+
}
3436
}
3537

3638
#[RequiresPhpExtension('intl')]

Tests/Extension/Core/Type/MoneyTypeTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ protected function setUp(): void
3434

3535
protected function tearDown(): void
3636
{
37-
\Locale::setDefault($this->defaultLocale);
37+
if (isset($this->defaultLocale)) {
38+
\Locale::setDefault($this->defaultLocale);
39+
}
3840
}
3941

4042
public function testPassMoneyPatternToView()

Tests/Extension/Core/Type/NumberTypeTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ protected function setUp(): void
3535

3636
protected function tearDown(): void
3737
{
38-
\Locale::setDefault($this->defaultLocale);
38+
if (isset($this->defaultLocale)) {
39+
\Locale::setDefault($this->defaultLocale);
40+
}
3941
}
4042

4143
public function testDefaultFormatting()

Tests/Extension/Core/Type/PercentTypeTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ protected function setUp(): void
3434

3535
protected function tearDown(): void
3636
{
37-
\Locale::setDefault($this->defaultLocale);
37+
if (isset($this->defaultLocale)) {
38+
\Locale::setDefault($this->defaultLocale);
39+
}
3840
}
3941

4042
public function testSubmitWithRoundingMode()

0 commit comments

Comments
 (0)