@@ 63-78 (lines=16) @@ | ||
60 | $discovery->addBinding($binding2); |
|
61 | } |
|
62 | ||
63 | public function testRemoveBindingsDoesNotInitializeLoadedBindings() |
|
64 | { |
|
65 | $this->initializer->expects($this->never()) |
|
66 | ->method('acceptsBinding'); |
|
67 | ||
68 | $this->initializer->expects($this->never()) |
|
69 | ->method('initializeBinding'); |
|
70 | ||
71 | $discovery = $this->createDiscovery(); |
|
72 | $discovery->addBindingType(new BindingType(Foo::clazz, self::STRING_BINDING)); |
|
73 | $discovery->addBinding(new StringBinding('string1', Foo::clazz)); |
|
74 | $discovery->addBinding(new StringBinding('string2', Foo::clazz)); |
|
75 | ||
76 | $discovery = $this->loadDiscoveryFromStorage($discovery, array($this->initializer)); |
|
77 | $discovery->removeBindings(); |
|
78 | } |
|
79 | ||
80 | public function testRemoveBindingsWithTypeDoesNotInitializeLoadedBindings() |
|
81 | { |
|
@@ 80-95 (lines=16) @@ | ||
77 | $discovery->removeBindings(); |
|
78 | } |
|
79 | ||
80 | public function testRemoveBindingsWithTypeDoesNotInitializeLoadedBindings() |
|
81 | { |
|
82 | $this->initializer->expects($this->never()) |
|
83 | ->method('acceptsBinding'); |
|
84 | ||
85 | $this->initializer->expects($this->never()) |
|
86 | ->method('initializeBinding'); |
|
87 | ||
88 | $discovery = $this->createDiscovery(); |
|
89 | $discovery->addBindingType(new BindingType(Foo::clazz, self::STRING_BINDING)); |
|
90 | $discovery->addBinding(new StringBinding('string1', Foo::clazz)); |
|
91 | $discovery->addBinding(new StringBinding('string2', Foo::clazz)); |
|
92 | ||
93 | $discovery = $this->loadDiscoveryFromStorage($discovery, array($this->initializer)); |
|
94 | $discovery->removeBindings(Foo::clazz); |
|
95 | } |
|
96 | ||
97 | public function testRemoveBindingsWithTypeAndParameterWorksOnLoadedDiscovery() |
|
98 | { |
|
@@ 121-136 (lines=16) @@ | ||
118 | $this->assertEquals(array($binding3), $discovery->getBindings()); |
|
119 | } |
|
120 | ||
121 | public function testRemoveBindingTypeDoesNotInitializeLoadedBindings() |
|
122 | { |
|
123 | $this->initializer->expects($this->never()) |
|
124 | ->method('acceptsBinding'); |
|
125 | ||
126 | $this->initializer->expects($this->never()) |
|
127 | ->method('initializeBinding'); |
|
128 | ||
129 | $discovery = $this->createDiscovery(); |
|
130 | $discovery->addBindingType(new BindingType(Foo::clazz, self::STRING_BINDING)); |
|
131 | $discovery->addBinding(new StringBinding('string1', Foo::clazz)); |
|
132 | $discovery->addBinding(new StringBinding('string2', Foo::clazz)); |
|
133 | ||
134 | $discovery = $this->loadDiscoveryFromStorage($discovery, array($this->initializer)); |
|
135 | $discovery->removeBindingType(Foo::clazz); |
|
136 | } |
|
137 | ||
138 | public function testFindBindingsInitializesLoadedBindings() |
|
139 | { |