@@ -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
}
@@ -782,11 +794,16 @@ public function parseTypeDoubleProvider()
782
794
);
783
795
}
784
796
785
- /**
786
- * @expectedException \PHPUnit_Framework_Error_Warning
787
- */
788
797
public function testParseTypeCurrency ()
789
798
{
799
+ $ exceptionCode = 'PHPUnit\Framework\Error\Warning ' ;
800
+
801
+ if (class_exists ('PHPUnit_Framework_Error_Warning ' )) {
802
+ $ exceptionCode = 'PHPUnit_Framework_Error_Warning ' ;
803
+ }
804
+
805
+ $ this ->{method_exists ($ this , $ _ = 'expectException ' ) ? $ _ : 'setExpectedException ' }($ exceptionCode );
806
+
790
807
$ formatter = $ this ->getNumberFormatter ('en ' , NumberFormatter::DECIMAL );
791
808
$ formatter ->parse ('1 ' , NumberFormatter::TYPE_CURRENCY );
792
809
}
0 commit comments