|
1 | 1 | <?php |
2 | 2 | namespace Tests; |
3 | 3 |
|
4 | | -use Bigcommerce\Injector\Adapter\ArrayContainerAdapter; |
5 | 4 | use Bigcommerce\Injector\Exception\InjectorInvocationException; |
6 | 5 | use Bigcommerce\Injector\Injector; |
7 | 6 | use Bigcommerce\Injector\Reflection\ClassInspector; |
@@ -246,42 +245,6 @@ public function testAutoCreate() |
246 | 245 | $this->assertEquals(25, $instance->getAge()); |
247 | 246 | } |
248 | 247 |
|
249 | | - public function testResolvesDependencyFromFindableContainer() |
250 | | - { |
251 | | - $dep = new DummySubDependency(); |
252 | | - $this->mockDummyDependencySignature(); |
253 | | - |
254 | | - $injector = new Injector( |
255 | | - new ArrayContainerAdapter([DummySubDependency::class => $dep]), |
256 | | - $this->inspector->reveal() |
257 | | - ); |
258 | | - |
259 | | - $instance = $injector->create(DummyDependency::class); |
260 | | - $this->assertSame($dep, $instance->getDependency()); |
261 | | - } |
262 | | - |
263 | | - public function testFindableContainerAutoCreatesWhenDependencyAbsent() |
264 | | - { |
265 | | - $this->mockDummyDependencySignature(); |
266 | | - $this->mockDummySubDependencySignature(); |
267 | | - |
268 | | - $injector = new Injector(new ArrayContainerAdapter([]), $this->inspector->reveal()); |
269 | | - $injector->addAutoCreate(".*DummySubDependency"); |
270 | | - |
271 | | - $instance = $injector->create(DummyDependency::class); |
272 | | - $this->assertInstanceOf(DummySubDependency::class, $instance->getDependency()); |
273 | | - } |
274 | | - |
275 | | - public function testFindableContainerThrowsForMissingRequiredDependency() |
276 | | - { |
277 | | - $this->mockDummyDependencySignature(); |
278 | | - |
279 | | - $injector = new Injector(new ArrayContainerAdapter([]), $this->inspector->reveal()); |
280 | | - |
281 | | - $this->expectException(InjectorInvocationException::class); |
282 | | - $injector->create(DummyDependency::class); |
283 | | - } |
284 | | - |
285 | 248 | /** |
286 | 249 | * Injector fails to create a sub-dependency. Should provided a wrapped stack exception message guiding |
287 | 250 | * developers where to find the issue. |
|
0 commit comments