From 26dd39eb06840357d9f26263a70d0b756c646fc0 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 13 Aug 2020 16:16:26 +0200 Subject: [PATCH] use expectWarning() when possible --- .../AbstractNumberFormatterTest.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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);