@@ -306,10 +306,17 @@ public function formatTypeDoubleWithCurrencyStyleProvider()
306
306
307
307
/**
308
308
* @dataProvider formatTypeCurrencyProvider
309
- * @expectedException \PHPUnit_Framework_Error_Warning
310
309
*/
311
310
public function testFormatTypeCurrency ($ formatter , $ value )
312
311
{
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
+
313
320
$ formatter ->format ($ value , NumberFormatter::TYPE_CURRENCY );
314
321
}
315
322
@@ -641,11 +648,16 @@ public function parseProvider()
641
648
);
642
649
}
643
650
644
- /**
645
- * @expectedException \PHPUnit_Framework_Error_Warning
646
- */
647
651
public function testParseTypeDefault ()
648
652
{
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
+
649
661
$ formatter = $ this ->getNumberFormatter ('en ' , NumberFormatter::DECIMAL );
650
662
$ formatter ->parse ('1 ' , NumberFormatter::TYPE_DEFAULT );
651
663
}
@@ -762,11 +774,16 @@ public function parseTypeDoubleProvider()
762
774
);
763
775
}
764
776
765
- /**
766
- * @expectedException \PHPUnit_Framework_Error_Warning
767
- */
768
777
public function testParseTypeCurrency ()
769
778
{
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
+
770
787
$ formatter = $ this ->getNumberFormatter ('en ' , NumberFormatter::DECIMAL );
771
788
$ formatter ->parse ('1 ' , NumberFormatter::TYPE_CURRENCY );
772
789
}
0 commit comments