|
11 | 11 |
|
12 | 12 | namespace Symfony\Component\Intl\Tests\NumberFormatter;
|
13 | 13 |
|
| 14 | +use PHPUnit\Framework\Error\Warning; |
14 | 15 | use PHPUnit\Framework\TestCase;
|
15 | 16 | use Symfony\Component\Intl\Globals\IntlGlobals;
|
16 | 17 | use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
|
@@ -323,13 +324,7 @@ public function formatTypeDoubleWithCurrencyStyleProvider()
|
323 | 324 | */
|
324 | 325 | public function testFormatTypeCurrency($formatter, $value)
|
325 | 326 | {
|
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); |
333 | 328 |
|
334 | 329 | $formatter->format($value, NumberFormatter::TYPE_CURRENCY);
|
335 | 330 | }
|
@@ -706,13 +701,7 @@ public function parseProvider()
|
706 | 701 |
|
707 | 702 | public function testParseTypeDefault()
|
708 | 703 | {
|
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); |
716 | 705 |
|
717 | 706 | $formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
|
718 | 707 | $formatter->parse('1', NumberFormatter::TYPE_DEFAULT);
|
@@ -832,13 +821,7 @@ public function parseTypeDoubleProvider()
|
832 | 821 |
|
833 | 822 | public function testParseTypeCurrency()
|
834 | 823 | {
|
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); |
842 | 825 |
|
843 | 826 | $formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
|
844 | 827 | $formatter->parse('1', NumberFormatter::TYPE_CURRENCY);
|
|
0 commit comments