Skip to content

Commit c6faa6a

Browse files
Merge branch '4.4' into 5.1
* 4.4: [Debug] fix test consistently use same types for strict comparisons [PhpUnitBridge] Skip internal classes in CoverageListenerTrait [VarExporter] unserialize() might throw an Exception on php 8. [ErrorHandler] Parse "x not found" errors correctly on php 8. Prevent parsing invalid octal digits as octal numbers remove unnecessary check for existing request [DI] fix ContainerBuilder on PHP8 [Console] Make sure $maxAttempts is an int or null. [VarDumper] Fix caster for invalid SplFileInfo objects on php 8. [Intl] Skip test cases that produce a TypeError on php 8. [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3. [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x add bosnian (bs) translation [Debug] Parse "x not found" errors correctly on php 8.
2 parents d035ca0 + 5a01f0e commit c6faa6a

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

Tests/NumberFormatter/AbstractNumberFormatterTest.php

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,16 @@ public function testFormatFractionDigits($value, $expected, $fractionDigits = nu
377377

378378
public function formatFractionDigitsProvider()
379379
{
380-
return [
381-
[1.123, '1.123', null, 0],
382-
[1.123, '1', 0, 0],
383-
[1.123, '1.1', 1, 1],
384-
[1.123, '1.12', 2, 2],
385-
[1.123, '1.123', -1, 0],
386-
];
380+
yield [1.123, '1.123', null, 0];
381+
yield [1.123, '1', 0, 0];
382+
yield [1.123, '1.1', 1, 1];
383+
yield [1.123, '1.12', 2, 2];
384+
yield [1.123, '1.123', -1, 0];
385+
386+
if (\PHP_VERSION_ID < 80000) {
387+
// This dataset will produce a TypeError on php 8.
388+
yield [1.123, '1', 'abc', 0];
389+
}
387390
}
388391

389392
/**
@@ -409,13 +412,16 @@ public function testFormatGroupingUsed($value, $expected, $groupingUsed = null,
409412

410413
public function formatGroupingUsedProvider()
411414
{
412-
return [
413-
[1000, '1,000', null, 1],
414-
[1000, '1000', 0, 0],
415-
[1000, '1,000', 1, 1],
416-
[1000, '1,000', 2, 1],
417-
[1000, '1,000', -1, 1],
418-
];
415+
yield [1000, '1,000', null, 1];
416+
yield [1000, '1000', 0, 0];
417+
yield [1000, '1,000', 1, 1];
418+
yield [1000, '1,000', 2, 1];
419+
yield [1000, '1,000', -1, 1];
420+
421+
if (\PHP_VERSION_ID < 80000) {
422+
// This dataset will produce a TypeError on php 8.
423+
yield [1000, '1000', 'abc', 0];
424+
}
419425
}
420426

421427
/**

0 commit comments

Comments
 (0)