File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Yaml \Tests ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Component \Yaml \Exception \ParseException ;
15
16
use Symfony \Component \Yaml \Inline ;
16
17
use Symfony \Component \Yaml \Yaml ;
17
18
@@ -651,10 +652,15 @@ public function getBinaryData()
651
652
652
653
/**
653
654
* @dataProvider getInvalidBinaryData
655
+ * @expectedException \Symfony\Component\Yaml\Exception\ParseException
654
656
*/
655
657
public function testParseInvalidBinaryData ($ data , $ expectedMessage )
656
658
{
657
- $ this ->setExpectedExceptionRegExp ('\Symfony\Component\Yaml\Exception\ParseException ' , $ expectedMessage );
659
+ if (method_exists ($ this , 'expectException ' )) {
660
+ $ this ->expectExceptionMessageRegExp ($ expectedMessage );
661
+ } else {
662
+ $ this ->setExpectedExceptionRegExp (ParseException::class, $ expectedMessage );
663
+ }
658
664
659
665
Inline::parse ($ data );
660
666
}
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \Yaml \Tests ;
13
13
14
14
use PHPUnit \Framework \TestCase ;
15
+ use Symfony \Component \Yaml \Exception \ParseException ;
15
16
use Symfony \Component \Yaml \Yaml ;
16
17
use Symfony \Component \Yaml \Parser ;
17
18
@@ -1314,10 +1315,15 @@ public function getBinaryData()
1314
1315
1315
1316
/**
1316
1317
* @dataProvider getInvalidBinaryData
1318
+ * @expectedException \Symfony\Component\Yaml\Exception\ParseException
1317
1319
*/
1318
1320
public function testParseInvalidBinaryData ($ data , $ expectedMessage )
1319
1321
{
1320
- $ this ->setExpectedExceptionRegExp ('\Symfony\Component\Yaml\Exception\ParseException ' , $ expectedMessage );
1322
+ if (method_exists ($ this , 'expectException ' )) {
1323
+ $ this ->expectExceptionMessageRegExp ($ expectedMessage );
1324
+ } else {
1325
+ $ this ->setExpectedExceptionRegExp (ParseException::class, $ expectedMessage );
1326
+ }
1321
1327
1322
1328
$ this ->parser ->parse ($ data );
1323
1329
}
You can’t perform that action at this time.
0 commit comments