File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
src/Symfony/Component/DependencyInjection Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ public function __construct()
74
74
$ this ->beforeRemovingPasses = [
75
75
-100 => [
76
76
new ResolvePrivatesPass (),
77
+ new CheckExceptionOnInvalidReferenceBehaviorPass (),
77
78
],
78
79
];
79
80
@@ -88,7 +89,6 @@ public function __construct()
88
89
]];
89
90
90
91
$ this ->afterRemovingPasses = [[
91
- new CheckExceptionOnInvalidReferenceBehaviorPass (),
92
92
new ResolveHotPathPass (),
93
93
]];
94
94
}
Original file line number Diff line number Diff line change @@ -1316,6 +1316,28 @@ public function testNoClassFromNsSeparatorId()
1316
1316
$ container ->compile ();
1317
1317
}
1318
1318
1319
+ public function testGetThrownServiceNotFoundExceptionWithCorrectServiceId ()
1320
+ {
1321
+ $ this ->expectException (ServiceNotFoundException::class);
1322
+ $ this ->expectExceptionMessage ('The service "child_service" has a dependency on a non-existent service "non_existent_service". ' );
1323
+
1324
+ $ container = new ContainerBuilder ();
1325
+ $ container ->register ('child_service ' , \stdClass::class)
1326
+ ->setPublic (false )
1327
+ ->addArgument ([
1328
+ 'non_existent ' => new Reference ('non_existent_service ' ),
1329
+ ])
1330
+ ;
1331
+ $ container ->register ('parent_service ' , \stdClass::class)
1332
+ ->setPublic (true )
1333
+ ->addArgument ([
1334
+ 'child_service ' => new Reference ('child_service ' ),
1335
+ ])
1336
+ ;
1337
+
1338
+ $ container ->compile ();
1339
+ }
1340
+
1319
1341
public function testServiceLocator ()
1320
1342
{
1321
1343
$ container = new ContainerBuilder ();
You can’t perform that action at this time.
0 commit comments