Skip to content

Commit c2202bb

Browse files
Merge branch '2.7' into 2.8
* 2.7: Further refactorings to PHPUnit namespaces resolve parameters in definition classes
2 parents 57b1bcf + 596ca65 commit c2202bb

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
@@ -659,7 +659,7 @@ public function testExtension()
659659
$container->registerExtension($extension = new \ProjectExtension());
660660
$this->assertTrue($container->getExtension('project') === $extension, '->registerExtension() registers an extension');
661661

662-
$this->setExpectedException('LogicException');
662+
$this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('LogicException');
663663
$container->getExtension('no_registered');
664664
}
665665

Tests/DefinitionTest.php

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

6969
$def = new Definition('stdClass');
70-
$this->setExpectedException('InvalidArgumentException', 'The decorated service inner name for "foo" must be different than the service name itself.');
70+
71+
if (method_exists($this, 'expectException')) {
72+
$this->expectException('InvalidArgumentException');
73+
$this->expectExceptionMessage('The decorated service inner name for "foo" must be different than the service name itself.');
74+
} else {
75+
$this->setExpectedException('InvalidArgumentException', 'The decorated service inner name for "foo" must be different than the service name itself.');
76+
}
77+
7178
$def->setDecoratedService('foo', 'foo');
7279
}
7380

0 commit comments

Comments
 (0)