File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/Symfony/Component/DependencyInjection/Tests Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1310,6 +1310,24 @@ public function testArgumentsHaveHigherPriorityThanBindings()
1310
1310
$ this ->assertSame ('via-argument ' , $ container ->get ('foo ' )->class1 ->identifier );
1311
1311
$ this ->assertSame ('via-bindings ' , $ container ->get ('foo ' )->class2 ->identifier );
1312
1312
}
1313
+
1314
+ public function testIdCanBeAnObjectAsLongAsItCanBeCastToString ()
1315
+ {
1316
+ $ id = new Reference ('another_service ' );
1317
+ $ aliasId = new Reference ('alias_id ' );
1318
+
1319
+ $ container = new ContainerBuilder ();
1320
+ $ container ->set ($ id , new \stdClass ());
1321
+ $ container ->setAlias ($ aliasId , 'another_service ' );
1322
+
1323
+ $ this ->assertTrue ($ container ->has ('another_service ' ));
1324
+ $ this ->assertTrue ($ container ->has ($ id ));
1325
+ $ this ->assertTrue ($ container ->hasAlias ('alias_id ' ));
1326
+ $ this ->assertTrue ($ container ->hasAlias ($ aliasId ));
1327
+
1328
+ $ container ->removeAlias ($ aliasId );
1329
+ $ container ->removeDefinition ($ id );
1330
+ }
1313
1331
}
1314
1332
1315
1333
class FooClass
You can’t perform that action at this time.
0 commit comments