Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  use expectWarning() when possible
  • Loading branch information
fabpot committed Aug 13, 2020
2 parents 98aadcf + 31bf359 commit a25271d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Tests/NumberFormatter/AbstractNumberFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ public function formatTypeDoubleWithCurrencyStyleProvider()
*/
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);
}
Expand Down Expand Up @@ -699,7 +703,11 @@ public function parseProvider()

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);
Expand Down Expand Up @@ -819,7 +827,11 @@ public function parseTypeDoubleProvider()

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);
Expand Down

0 comments on commit a25271d

Please sign in to comment.