Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30d8496

Browse files
committed
minor #37828 use expectWarning() when possible (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- use expectWarning() when possible | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 26dd39e use expectWarning() when possible
2 parents 6972bc2 + 26dd39e commit 30d8496

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,11 @@ public function formatTypeDoubleWithCurrencyStyleProvider()
324324
*/
325325
public function testFormatTypeCurrency($formatter, $value)
326326
{
327-
$this->expectException(Warning::class);
327+
if (method_exists($this, 'expectWarning')) {
328+
$this->expectWarning();
329+
} else {
330+
$this->expectException(Warning::class);
331+
}
328332

329333
$formatter->format($value, NumberFormatter::TYPE_CURRENCY);
330334
}
@@ -701,7 +705,11 @@ public function parseProvider()
701705

702706
public function testParseTypeDefault()
703707
{
704-
$this->expectException(Warning::class);
708+
if (method_exists($this, 'expectWarning')) {
709+
$this->expectWarning();
710+
} else {
711+
$this->expectException(Warning::class);
712+
}
705713

706714
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
707715
$formatter->parse('1', NumberFormatter::TYPE_DEFAULT);
@@ -821,7 +829,11 @@ public function parseTypeDoubleProvider()
821829

822830
public function testParseTypeCurrency()
823831
{
824-
$this->expectException(Warning::class);
832+
if (method_exists($this, 'expectWarning')) {
833+
$this->expectWarning();
834+
} else {
835+
$this->expectException(Warning::class);
836+
}
825837

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

0 commit comments

Comments
 (0)