Skip to content

Commit a4f1701

Browse files
Merge branch '2.8' into 3.2
* 2.8: Refactored other PHPUnit method calls to work with namespaced PHPUnit 6 Further refactorings to PHPUnit namespaces resolve parameters in definition classes
2 parents 0ad1f01 + f9e3c68 commit a4f1701

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

Tests/NumberFormatter/AbstractNumberFormatterTest.php

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,17 @@ public function formatTypeDoubleWithCurrencyStyleProvider()
306306

307307
/**
308308
* @dataProvider formatTypeCurrencyProvider
309-
* @expectedException \PHPUnit_Framework_Error_Warning
310309
*/
311310
public function testFormatTypeCurrency($formatter, $value)
312311
{
312+
$exceptionCode = 'PHPUnit\Framework\Error\Warning';
313+
314+
if (class_exists('PHPUnit_Framework_Error_Warning')) {
315+
$exceptionCode = 'PHPUnit_Framework_Error_Warning';
316+
}
317+
318+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}($exceptionCode);
319+
313320
$formatter->format($value, NumberFormatter::TYPE_CURRENCY);
314321
}
315322

@@ -641,11 +648,16 @@ public function parseProvider()
641648
);
642649
}
643650

644-
/**
645-
* @expectedException \PHPUnit_Framework_Error_Warning
646-
*/
647651
public function testParseTypeDefault()
648652
{
653+
$exceptionCode = 'PHPUnit\Framework\Error\Warning';
654+
655+
if (class_exists('PHPUnit_Framework_Error_Warning')) {
656+
$exceptionCode = 'PHPUnit_Framework_Error_Warning';
657+
}
658+
659+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}($exceptionCode);
660+
649661
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
650662
$formatter->parse('1', NumberFormatter::TYPE_DEFAULT);
651663
}
@@ -762,11 +774,16 @@ public function parseTypeDoubleProvider()
762774
);
763775
}
764776

765-
/**
766-
* @expectedException \PHPUnit_Framework_Error_Warning
767-
*/
768777
public function testParseTypeCurrency()
769778
{
779+
$exceptionCode = 'PHPUnit\Framework\Error\Warning';
780+
781+
if (class_exists('PHPUnit_Framework_Error_Warning')) {
782+
$exceptionCode = 'PHPUnit_Framework_Error_Warning';
783+
}
784+
785+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}($exceptionCode);
786+
770787
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
771788
$formatter->parse('1', NumberFormatter::TYPE_CURRENCY);
772789
}

0 commit comments

Comments
 (0)