File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -64,25 +64,23 @@ public function testGetDoesNotMemoize()
64
64
$ this ->assertSame (2 , $ i );
65
65
}
66
66
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
- */
71
67
public function testThrowsOnUndefinedInternalService ()
72
68
{
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
+ }
73
73
$ locator = $ this ->getServiceLocator ([
74
74
'foo ' => function () use (&$ locator ) { return $ locator ->get ('bar ' ); },
75
75
]);
76
76
77
77
$ locator ->get ('foo ' );
78
78
}
79
79
80
- /**
81
- * @expectedException \Psr\Container\ContainerExceptionInterface
82
- * @expectedExceptionMessage Circular reference detected for service "bar", path: "bar -> baz -> bar".
83
- */
84
80
public function testThrowsOnCircularReference ()
85
81
{
82
+ $ this ->expectException ('Psr\Container\ContainerExceptionInterface ' );
83
+ $ this ->expectExceptionMessage ('Circular reference detected for service "bar", path: "bar -> baz -> bar". ' );
86
84
$ locator = $ this ->getServiceLocator ([
87
85
'foo ' => function () use (&$ locator ) { return $ locator ->get ('bar ' ); },
88
86
'bar ' => function () use (&$ locator ) { return $ locator ->get ('baz ' ); },
Original file line number Diff line number Diff line change @@ -158,10 +158,10 @@ public function testReturnMessageIfExactlyOneStandardRuleIsGiven()
158
158
159
159
/**
160
160
* @dataProvider getNonMatchingMessages
161
- * @expectedException \InvalidArgumentException
162
161
*/
163
162
public function testThrowExceptionIfMatchingMessageCannotBeFound ($ id , $ number )
164
163
{
164
+ $ this ->expectException ('InvalidArgumentException ' );
165
165
$ translator = $ this ->getTranslator ();
166
166
167
167
$ translator ->trans ($ id , ['%count% ' => $ number ]);
You can’t perform that action at this time.
0 commit comments