Skip to content

Commit 3d9f598

Browse files
peterrehmnicolas-grekas
authored andcommitted
Further refactorings to PHPUnit namespaces
1 parent f1d7384 commit 3d9f598

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tests/Encoder/XmlEncoderTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,12 @@ public function testPreventsComplexExternalEntities()
450450

451451
public function testDecodeEmptyXml()
452452
{
453-
$this->setExpectedException('Symfony\Component\Serializer\Exception\UnexpectedValueException', 'Invalid XML data, it can not be empty.');
453+
if (method_exists($this, 'expectException')) {
454+
$this->expectException('Symfony\Component\Serializer\Exception\UnexpectedValueException');
455+
$this->expectExceptionMessage('Invalid XML data, it can not be empty.');
456+
} else {
457+
$this->setExpectedException('Symfony\Component\Serializer\Exception\UnexpectedValueException', 'Invalid XML data, it can not be empty.');
458+
}
454459
$this->encoder->decode(' ', 'xml');
455460
}
456461

0 commit comments

Comments
 (0)