File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff 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 ' ); },
You can’t perform that action at this time.
0 commit comments