Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion src/Util/TestListenerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ public function addError($test, \Exception $e, $time)
{
if (false !== self::$enabledPolyfills) {
$r = new \ReflectionProperty('Exception', 'message');
$r->setAccessible(true);
if (\PHP_VERSION_ID < 80100)
{
// This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
$r->setAccessible(true);
}
$r->setValue($e, 'Polyfills enabled, '.$r->getValue($e));
}
}
Expand Down
12 changes: 10 additions & 2 deletions tests/Intl/Icu/AbstractNumberFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,11 @@ public function testGetSymbol()
$currencyFormatter = static::getNumberFormatter('en', NumberFormatter::CURRENCY);

$r = new \ReflectionProperty('Symfony\Polyfill\Intl\Icu\NumberFormatter', 'enSymbols');
$r->setAccessible(true);
if (\PHP_VERSION_ID < 80100)
{
// This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
$r->setAccessible(true);
}
$expected = $r->getValue();

for ($i = 0; $i <= 17; ++$i) {
Expand All @@ -644,7 +648,11 @@ public function testGetTextAttribute()
$currencyFormatter = static::getNumberFormatter('en', NumberFormatter::CURRENCY);

$r = new \ReflectionProperty('Symfony\Polyfill\Intl\Icu\NumberFormatter', 'enTextAttributes');
$r->setAccessible(true);
if (\PHP_VERSION_ID < 80100)
{
// This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
$r->setAccessible(true);
}
$expected = $r->getValue();

for ($i = 0; $i <= 5; ++$i) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Php73/Php73Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public static function arrayKeyFirstDataProvider()
['a', ['a' => 'aaa', 'A' => 'AAA', 'c' => 'ccc', 'd' => 'ddd', 'e' => 'eee']],
[1, ['1' => 'one', '2' => 'two', '3' => 'three', '4' => 'four', '5' => 'five']],
[1, [1 => 'one', 2 => 'two', 3 => 7, 4 => 'four', 5 => 'five']],
['f', ['f' => 'fff', '1' => 'one', 4 => 6, '' => 'blank', 24 => 'float', 'F' => 'FFF', 'blank' => '', 3 => 3.7, 5 => 7, 6 => 8.6, '5' => 'Five', '4name' => 'jonny', 'a' => null, null => 3]],
['f', ['f' => 'fff', '1' => 'one', 4 => 6, '' => 'blank', 24 => 'float', 'F' => 'FFF', 'blank' => '', 3 => 3.7, 5 => 7, 6 => 8.6, '5' => 'Five', '4name' => 'jonny', 'a' => null, '' => 3]],
[0, [12, 'name', 'age', '45']],
[0, [['oNe', 'tWo', 4], [10, 20, 30, 40, 50], []]],
['one', ['one' => 1, 'one' => 2, 'three' => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, 5 => 54, 5 => 57, '5.4' => 554, '5.7' => 557]],
Expand All @@ -158,7 +158,7 @@ public static function arrayKeyLastDataProvider()
['e', ['a' => 'aaa', 'A' => 'AAA', 'c' => 'ccc', 'd' => 'ddd', 'e' => 'eee']],
[5, ['1' => 'one', '2' => 'two', '3' => 'three', '4' => 'four', '5' => 'five']],
[5, [1 => 'one', 2 => 'two', 3 => 7, 4 => 'four', 5 => 'five']],
['a', ['f' => 'fff', '1' => 'one', 4 => 6, '' => 'blank', 2 => 'float', 'F' => 'FFF', 'blank' => '', 3 => 3.7, 5 => 7, 6 => 8.6, '5' => 'Five', '4name' => 'jonny', 'a' => null, null => 3]],
['a', ['f' => 'fff', '1' => 'one', 4 => 6, '' => 'blank', 2 => 'float', 'F' => 'FFF', 'blank' => '', 3 => 3.7, 5 => 7, 6 => 8.6, '5' => 'Five', '4name' => 'jonny', 'a' => null, '' => 3]],
[3, [12, 'name', 'age', '45']],
[2, [['oNe', 'tWo', 4], [10, 20, 30, 40, 50], []]],
['5.7', ['one' => 1, 'one' => 2, 'three' => 3, 3, 4, 3 => 33, 4 => 44, 5, 6, 5 => 54, 5 => 57, '5.4' => 554, '5.7' => 557]],
Expand Down
Loading