@@ -324,7 +324,11 @@ public function formatTypeDoubleWithCurrencyStyleProvider()
324
324
*/
325
325
public function testFormatTypeCurrency ($ formatter , $ value )
326
326
{
327
- $ this ->expectException (Warning::class);
327
+ if (method_exists ($ this , 'expectWarning ' )) {
328
+ $ this ->expectWarning ();
329
+ } else {
330
+ $ this ->expectException (Warning::class);
331
+ }
328
332
329
333
$ formatter ->format ($ value , NumberFormatter::TYPE_CURRENCY );
330
334
}
@@ -699,7 +703,11 @@ public function parseProvider()
699
703
700
704
public function testParseTypeDefault ()
701
705
{
702
- $ this ->expectException (Warning::class);
706
+ if (method_exists ($ this , 'expectWarning ' )) {
707
+ $ this ->expectWarning ();
708
+ } else {
709
+ $ this ->expectException (Warning::class);
710
+ }
703
711
704
712
$ formatter = $ this ->getNumberFormatter ('en ' , NumberFormatter::DECIMAL );
705
713
$ formatter ->parse ('1 ' , NumberFormatter::TYPE_DEFAULT );
@@ -819,7 +827,11 @@ public function parseTypeDoubleProvider()
819
827
820
828
public function testParseTypeCurrency ()
821
829
{
822
- $ this ->expectException (Warning::class);
830
+ if (method_exists ($ this , 'expectWarning ' )) {
831
+ $ this ->expectWarning ();
832
+ } else {
833
+ $ this ->expectException (Warning::class);
834
+ }
823
835
824
836
$ formatter = $ this ->getNumberFormatter ('en ' , NumberFormatter::DECIMAL );
825
837
$ formatter ->parse ('1 ' , NumberFormatter::TYPE_CURRENCY );
0 commit comments