Skip to content

Commit 5247d5c

Browse files
Merge branch '2.8' into 3.2
* 2.8: Use PHPUnit 6.0 on PHP 7.* test lines
2 parents d19eb3e + 707f112 commit 5247d5c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Tests/InlineTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Yaml\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\Yaml\Exception\ParseException;
1516
use Symfony\Component\Yaml\Inline;
1617
use Symfony\Component\Yaml\Yaml;
1718

@@ -651,10 +652,15 @@ public function getBinaryData()
651652

652653
/**
653654
* @dataProvider getInvalidBinaryData
655+
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
654656
*/
655657
public function testParseInvalidBinaryData($data, $expectedMessage)
656658
{
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+
}
658664

659665
Inline::parse($data);
660666
}

Tests/ParserTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Yaml\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\Yaml\Exception\ParseException;
1516
use Symfony\Component\Yaml\Yaml;
1617
use Symfony\Component\Yaml\Parser;
1718

@@ -1314,10 +1315,15 @@ public function getBinaryData()
13141315

13151316
/**
13161317
* @dataProvider getInvalidBinaryData
1318+
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
13171319
*/
13181320
public function testParseInvalidBinaryData($data, $expectedMessage)
13191321
{
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+
}
13211327

13221328
$this->parser->parse($data);
13231329
}

0 commit comments

Comments
 (0)