diff --git a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php index ac317d21bf..0f2a7c4b53 100644 --- a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php @@ -324,7 +324,11 @@ abstract class AbstractNumberFormatterTest extends TestCase */ public function testFormatTypeCurrency($formatter, $value) { - $this->expectException(Warning::class); + if (method_exists($this, 'expectWarning')) { + $this->expectWarning(); + } else { + $this->expectException(Warning::class); + } $formatter->format($value, NumberFormatter::TYPE_CURRENCY); } @@ -701,7 +705,11 @@ abstract class AbstractNumberFormatterTest extends TestCase public function testParseTypeDefault() { - $this->expectException(Warning::class); + if (method_exists($this, 'expectWarning')) { + $this->expectWarning(); + } else { + $this->expectException(Warning::class); + } $formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL); $formatter->parse('1', NumberFormatter::TYPE_DEFAULT); @@ -821,7 +829,11 @@ abstract class AbstractNumberFormatterTest extends TestCase public function testParseTypeCurrency() { - $this->expectException(Warning::class); + if (method_exists($this, 'expectWarning')) { + $this->expectWarning(); + } else { + $this->expectException(Warning::class); + } $formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL); $formatter->parse('1', NumberFormatter::TYPE_CURRENCY);