Skip to content

Commit 3cd78bb

Browse files
Merge branch '3.4' into 4.3
* 3.4: Fix tests Fix deprecated phpunit annotation
1 parent 80e2979 commit 3cd78bb

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Test/ServiceLocatorTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,23 @@ public function testGetDoesNotMemoize()
6464
$this->assertSame(2, $i);
6565
}
6666

67-
/**
68-
* @expectedException \Psr\Container\NotFoundExceptionInterface
69-
* @expectedExceptionMessage The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.
70-
*/
7167
public function testThrowsOnUndefinedInternalService()
7268
{
69+
if (!$this->getExpectedException()) {
70+
$this->expectException('Psr\Container\NotFoundExceptionInterface');
71+
$this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');
72+
}
7373
$locator = $this->getServiceLocator([
7474
'foo' => function () use (&$locator) { return $locator->get('bar'); },
7575
]);
7676

7777
$locator->get('foo');
7878
}
7979

80-
/**
81-
* @expectedException \Psr\Container\ContainerExceptionInterface
82-
* @expectedExceptionMessage Circular reference detected for service "bar", path: "bar -> baz -> bar".
83-
*/
8480
public function testThrowsOnCircularReference()
8581
{
82+
$this->expectException('Psr\Container\ContainerExceptionInterface');
83+
$this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".');
8684
$locator = $this->getServiceLocator([
8785
'foo' => function () use (&$locator) { return $locator->get('bar'); },
8886
'bar' => function () use (&$locator) { return $locator->get('baz'); },

0 commit comments

Comments
 (0)