@@ -56,54 +56,6 @@ public function the_container_is_compiled_once_and_never_recompiled_after()
5656 self ::assertEquals ('bar ' , $ container ->get ('foo ' ));
5757 }
5858
59- /** @test */
60- public function the_compiled_container_is_idempotent ()
61- {
62- $ compiledContainerClass1 = self ::generateCompiledClassName ();
63- $ compiledContainerClass2 = self ::generateCompiledClassName ();
64-
65- $ definitions = [
66- 'foo ' => 'barFromFoo ' ,
67- 'fooReference ' => \DI \get ('foo ' ),
68- 'factory ' => function () {
69- return 'barFromFactory ' ;
70- },
71- 'factoryReference ' => \DI \get ('factory ' ),
72- 'array ' => [
73- 1 ,
74- 2 ,
75- 3 ,
76- 'fooBar ' ,
77- ],
78- 'arrayValue ' => \DI \value ('array ' ),
79- CompiledContainerTest \AllKindsOfInjections::class => create ()
80- ->constructor (create ('stdClass ' ))
81- ->property ('property ' , autowire (CompiledContainerTest \Autowireable::class))
82- ->method ('method ' , \DI \factory (
83- function () {
84- return new \stdClass ;
85- }
86- )
87- ),
88- CompiledContainerTest \Autowireable::class => \DI \autowire (),
89- ];
90-
91- // Create a compiled container in a specific file
92- $ builder1 = new ContainerBuilder ;
93- $ builder1 ->addDefinitions ($ definitions );
94- $ builder1 ->enableCompilation (self ::COMPILATION_DIR , $ compiledContainerClass1 );
95- $ builder1 ->build ();
96-
97- // Create a second compiled container with the same configuration but in a different file
98- $ builder2 = new ContainerBuilder ;
99- $ builder2 ->addDefinitions ($ definitions );
100- $ builder2 ->enableCompilation (self ::COMPILATION_DIR , $ compiledContainerClass2 );
101- $ builder2 ->build ();
102-
103- // The method mapping of the resulting CompiledContainers should be equal
104- self ::assertEquals ($ compiledContainerClass1 ::METHOD_MAPPING , $ compiledContainerClass2 ::METHOD_MAPPING );
105- }
106-
10759 /**
10860 * @test
10961 * @expectedException \DI\Definition\Exception\InvalidDefinition
@@ -320,29 +272,3 @@ public function __construct(AbstractClass $param)
320272abstract class AbstractClass
321273{
322274}
323-
324- class AllKindsOfInjections
325- {
326- public $ property ;
327- public $ constructorParameter ;
328- public $ methodParameter ;
329- public function __construct ($ constructorParameter )
330- {
331- $ this ->constructorParameter = $ constructorParameter ;
332- }
333- public function method ($ methodParameter )
334- {
335- $ this ->methodParameter = $ methodParameter ;
336- }
337- }
338- class Autowireable
339- {
340- private $ dependency ;
341- public function __construct (AutowireableDependency $ dependency )
342- {
343- $ this ->dependency = $ dependency ;
344- }
345- }
346- class AutowireableDependency
347- {
348- }
0 commit comments