Skip to content

Commit 13ab635

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix assertInternalType deprecation in phpunit 9 Micro-typo fix
2 parents 1ecbac9 + a71ad4f commit 13ab635

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

Tests/Data/Bundle/Reader/JsonBundleReaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testReadReturnsArray()
3636
{
3737
$data = $this->reader->read(__DIR__.'/Fixtures/json', 'en');
3838

39-
$this->assertInternalType('array', $data);
39+
$this->assertIsArray($data);
4040
$this->assertSame('Bar', $data['Foo']);
4141
$this->assertArrayNotHasKey('ExistsNot', $data);
4242
}

Tests/Data/Bundle/Reader/PhpBundleReaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testReadReturnsArray()
3636
{
3737
$data = $this->reader->read(__DIR__.'/Fixtures/php', 'en');
3838

39-
$this->assertInternalType('array', $data);
39+
$this->assertIsArray($data);
4040
$this->assertSame('Bar', $data['Foo']);
4141
$this->assertArrayNotHasKey('ExistsNot', $data);
4242
}

Tests/Data/Provider/AbstractCurrencyDataProviderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,15 +711,15 @@ function ($currency) { return [$currency]; },
711711
*/
712712
public function testGetFractionDigits($currency)
713713
{
714-
$this->assertInternalType('numeric', $this->dataProvider->getFractionDigits($currency));
714+
$this->assertIsNumeric($this->dataProvider->getFractionDigits($currency));
715715
}
716716

717717
/**
718718
* @dataProvider provideCurrencies
719719
*/
720720
public function testGetRoundingIncrement($currency)
721721
{
722-
$this->assertInternalType('numeric', $this->dataProvider->getRoundingIncrement($currency));
722+
$this->assertIsNumeric($this->dataProvider->getRoundingIncrement($currency));
723723
}
724724

725725
public function provideCurrenciesWithNumericEquivalent()

Tests/NumberFormatter/AbstractNumberFormatterTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,11 @@ public function testParseTypeInt64With32BitIntegerInPhp32Bit()
748748
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
749749

750750
$parsedValue = $formatter->parse('2,147,483,647', NumberFormatter::TYPE_INT64);
751-
$this->assertInternalType('integer', $parsedValue);
751+
$this->assertIsInt($parsedValue);
752752
$this->assertEquals(2147483647, $parsedValue);
753753

754754
$parsedValue = $formatter->parse('-2,147,483,648', NumberFormatter::TYPE_INT64);
755-
$this->assertInternalType('int', $parsedValue);
755+
$this->assertIsInt($parsedValue);
756756
$this->assertEquals(-2147483648, $parsedValue);
757757
}
758758

@@ -763,11 +763,11 @@ public function testParseTypeInt64With32BitIntegerInPhp64Bit()
763763
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
764764

765765
$parsedValue = $formatter->parse('2,147,483,647', NumberFormatter::TYPE_INT64);
766-
$this->assertInternalType('integer', $parsedValue);
766+
$this->assertIsInt($parsedValue);
767767
$this->assertEquals(2147483647, $parsedValue);
768768

769769
$parsedValue = $formatter->parse('-2,147,483,648', NumberFormatter::TYPE_INT64);
770-
$this->assertInternalType('integer', $parsedValue);
770+
$this->assertIsInt($parsedValue);
771771
$this->assertEquals(-2147483647 - 1, $parsedValue);
772772
}
773773

@@ -782,11 +782,11 @@ public function testParseTypeInt64With64BitIntegerInPhp32Bit()
782782

783783
// int 64 using only 32 bit range strangeness
784784
$parsedValue = $formatter->parse('2,147,483,648', NumberFormatter::TYPE_INT64);
785-
$this->assertInternalType('float', $parsedValue);
785+
$this->assertIsFloat($parsedValue);
786786
$this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range.');
787787

788788
$parsedValue = $formatter->parse('-2,147,483,649', NumberFormatter::TYPE_INT64);
789-
$this->assertInternalType('float', $parsedValue);
789+
$this->assertIsFloat($parsedValue);
790790
$this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range.');
791791
}
792792

@@ -800,12 +800,12 @@ public function testParseTypeInt64With64BitIntegerInPhp64Bit()
800800
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
801801

802802
$parsedValue = $formatter->parse('2,147,483,648', NumberFormatter::TYPE_INT64);
803-
$this->assertInternalType('integer', $parsedValue);
803+
$this->assertIsInt($parsedValue);
804804

805805
$this->assertEquals(2147483648, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
806806

807807
$parsedValue = $formatter->parse('-2,147,483,649', NumberFormatter::TYPE_INT64);
808-
$this->assertInternalType('integer', $parsedValue);
808+
$this->assertIsInt($parsedValue);
809809

810810
$this->assertEquals(-2147483649, $parsedValue, '->parse() TYPE_INT64 uses true 64 bit integers (PHP >= 5.3.14 and PHP >= 5.4.4).');
811811
}

Tests/NumberFormatter/NumberFormatterTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Intl\Tests\NumberFormatter;
1313

14+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1415
use Symfony\Component\Intl\Globals\IntlGlobals;
1516
use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
1617

@@ -20,6 +21,8 @@
2021
*/
2122
class NumberFormatterTest extends AbstractNumberFormatterTest
2223
{
24+
use ForwardCompatTestTrait;
25+
2326
/**
2427
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
2528
*/

0 commit comments

Comments
 (0)