Skip to content

Commit d448d51

Browse files
jderussenicolas-grekas
authored andcommitted
Use namespaced Phpunit classes
1 parent 520b637 commit d448d51

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

Tests/NumberFormatter/AbstractNumberFormatterTest.php

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

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

14+
use PHPUnit\Framework\Error\Warning;
1415
use PHPUnit\Framework\TestCase;
1516
use Symfony\Component\Intl\Globals\IntlGlobals;
1617
use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
@@ -323,13 +324,7 @@ public function formatTypeDoubleWithCurrencyStyleProvider()
323324
*/
324325
public function testFormatTypeCurrency($formatter, $value)
325326
{
326-
$exceptionCode = 'PHPUnit\Framework\Error\Warning';
327-
328-
if (class_exists('PHPUnit_Framework_Error_Warning')) {
329-
$exceptionCode = 'PHPUnit_Framework_Error_Warning';
330-
}
331-
332-
$this->expectException($exceptionCode);
327+
$this->expectException(Warning::class);
333328

334329
$formatter->format($value, NumberFormatter::TYPE_CURRENCY);
335330
}
@@ -706,13 +701,7 @@ public function parseProvider()
706701

707702
public function testParseTypeDefault()
708703
{
709-
$exceptionCode = 'PHPUnit\Framework\Error\Warning';
710-
711-
if (class_exists('PHPUnit_Framework_Error_Warning')) {
712-
$exceptionCode = 'PHPUnit_Framework_Error_Warning';
713-
}
714-
715-
$this->expectException($exceptionCode);
704+
$this->expectException(Warning::class);
716705

717706
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
718707
$formatter->parse('1', NumberFormatter::TYPE_DEFAULT);
@@ -832,13 +821,7 @@ public function parseTypeDoubleProvider()
832821

833822
public function testParseTypeCurrency()
834823
{
835-
$exceptionCode = 'PHPUnit\Framework\Error\Warning';
836-
837-
if (class_exists('PHPUnit_Framework_Error_Warning')) {
838-
$exceptionCode = 'PHPUnit_Framework_Error_Warning';
839-
}
840-
841-
$this->expectException($exceptionCode);
824+
$this->expectException(Warning::class);
842825

843826
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
844827
$formatter->parse('1', NumberFormatter::TYPE_CURRENCY);

0 commit comments

Comments
 (0)