Skip to content

Commit 596ca65

Browse files
peterrehmnicolas-grekas
authored andcommitted
Further refactorings to PHPUnit namespaces
1 parent 0cb8a51 commit 596ca65

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Tests/ContainerBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ public function testExtension()
621621
$container->registerExtension($extension = new \ProjectExtension());
622622
$this->assertTrue($container->getExtension('project') === $extension, '->registerExtension() registers an extension');
623623

624-
$this->setExpectedException('LogicException');
624+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('LogicException');
625625
$container->getExtension('no_registered');
626626
}
627627

Tests/DefinitionTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ public function testSetGetDecoratedService()
5959
$this->assertNull($def->getDecoratedService());
6060

6161
$def = new Definition('stdClass');
62-
$this->setExpectedException('InvalidArgumentException', 'The decorated service inner name for "foo" must be different than the service name itself.');
62+
63+
if (method_exists($this, 'expectException')) {
64+
$this->expectException('InvalidArgumentException');
65+
$this->expectExceptionMessage('The decorated service inner name for "foo" must be different than the service name itself.');
66+
} else {
67+
$this->setExpectedException('InvalidArgumentException', 'The decorated service inner name for "foo" must be different than the service name itself.');
68+
}
69+
6370
$def->setDecoratedService('foo', 'foo');
6471
}
6572

0 commit comments

Comments
 (0)