You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -51,9 +53,9 @@ public function testDefinitions()
51
53
52
54
try {
53
55
$builder->getDefinition('baz');
54
-
$this->fail('->getDefinition() throws an InvalidArgumentException if the service definition does not exist');
55
-
} catch (\InvalidArgumentException$e) {
56
-
$this->assertEquals('The service definition "baz" does not exist.', $e->getMessage(), '->getDefinition() throws an InvalidArgumentException if the service definition does not exist');
56
+
$this->fail('->getDefinition() throws a ServiceNotFoundException if the service definition does not exist');
57
+
} catch (ServiceNotFoundException$e) {
58
+
$this->assertEquals('You have requested a non-existent service "baz".', $e->getMessage(), '->getDefinition() throws a ServiceNotFoundException if the service definition does not exist');
57
59
}
58
60
}
59
61
@@ -80,9 +82,9 @@ public function testGet()
80
82
$builder = newContainerBuilder();
81
83
try {
82
84
$builder->get('foo');
83
-
$this->fail('->get() throws an InvalidArgumentException if the service does not exist');
84
-
} catch (\InvalidArgumentException$e) {
85
-
$this->assertEquals('The service definition "foo" does not exist.', $e->getMessage(), '->get() throws an InvalidArgumentException if the service does not exist');
85
+
$this->fail('->get() throws a ServiceNotFoundException if the service does not exist');
86
+
} catch (ServiceNotFoundException$e) {
87
+
$this->assertEquals('You have requested a non-existent service "foo".', $e->getMessage(), '->get() throws a ServiceNotFoundException if the service does not exist');
86
88
}
87
89
88
90
$this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE), '->get() returns null if the service does not exist and NULL_ON_INVALID_REFERENCE is passed as a second argument');
0 commit comments