Skip to content

Commit 2bf08e8

Browse files
peterrehmnicolas-grekas
authored andcommitted
Further refactorings to PHPUnit namespaces
1 parent cb20be7 commit 2bf08e8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Tests/ParserTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,10 +1084,12 @@ public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks()
10841084
*/
10851085
public function testParserThrowsExceptionWithCorrectLineNumber($lineNumber, $yaml)
10861086
{
1087-
$this->setExpectedException(
1088-
'\Symfony\Component\Yaml\Exception\ParseException',
1089-
sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber)
1090-
);
1087+
if (method_exists($this, 'expectException')) {
1088+
$this->expectException('\Symfony\Component\Yaml\Exception\ParseException');
1089+
$this->expectExceptionMessage(sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber));
1090+
} else {
1091+
$this->setExpectedException('\Symfony\Component\Yaml\Exception\ParseException', sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber));
1092+
}
10911093

10921094
$this->parser->parse($yaml);
10931095
}

0 commit comments

Comments
 (0)