From 7f1055b97c61c6be941371bbe38270fc048c988f Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Sat, 5 Sep 2020 18:44:57 +0200 Subject: [PATCH] [Intl] Skip test cases that produce a TypeError on php 8. --- .../AbstractNumberFormatterTest.php | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php index 0f2a7c4b53..dd6a300c55 100644 --- a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php @@ -377,14 +377,16 @@ abstract class AbstractNumberFormatterTest extends TestCase public function formatFractionDigitsProvider() { - return [ - [1.123, '1.123', null, 0], - [1.123, '1', 0, 0], - [1.123, '1.1', 1, 1], - [1.123, '1.12', 2, 2], - [1.123, '1.123', -1, 0], - [1.123, '1', 'abc', 0], - ]; + yield [1.123, '1.123', null, 0]; + yield [1.123, '1', 0, 0]; + yield [1.123, '1.1', 1, 1]; + yield [1.123, '1.12', 2, 2]; + yield [1.123, '1.123', -1, 0]; + + if (\PHP_VERSION_ID < 80000) { + // This dataset will produce a TypeError on php 8. + yield [1.123, '1', 'abc', 0]; + } } /** @@ -410,14 +412,16 @@ abstract class AbstractNumberFormatterTest extends TestCase public function formatGroupingUsedProvider() { - return [ - [1000, '1,000', null, 1], - [1000, '1000', 0, 0], - [1000, '1,000', 1, 1], - [1000, '1,000', 2, 1], - [1000, '1000', 'abc', 0], - [1000, '1,000', -1, 1], - ]; + yield [1000, '1,000', null, 1]; + yield [1000, '1000', 0, 0]; + yield [1000, '1,000', 1, 1]; + yield [1000, '1,000', 2, 1]; + yield [1000, '1,000', -1, 1]; + + if (\PHP_VERSION_ID < 80000) { + // This dataset will produce a TypeError on php 8. + yield [1000, '1000', 'abc', 0]; + } } /**