diff --git a/Tests/Fixtures/DummyManager.php b/Tests/Fixtures/DummyManager.php new file mode 100644 index 00000000..04e5a2ac --- /dev/null +++ b/Tests/Fixtures/DummyManager.php @@ -0,0 +1,69 @@ +register('foo', \stdClass::class)->setPublic(true); - $container->getDefinition('foo')->setLazy(true)->addTag('proxy', ['interface' => \stdClass::class]); + $container->register('foo', DummyManager::class)->setPublic(true); + $container->getDefinition('foo')->setLazy(true)->addTag('proxy', ['interface' => ObjectManager::class]); $container->compile(); $dumper = new PhpDumper($container); @@ -46,8 +48,8 @@ public function testResetService() $registry->resetManager(); $this->assertSame($foo, $container->get('foo')); - $this->assertInstanceOf(\stdClass::class, $foo); - $this->assertFalse(property_exists($foo, 'bar')); + $this->assertInstanceOf(ObjectManager::class, $foo); + $this->assertFalse(isset($foo->bar)); } /** @@ -79,7 +81,7 @@ public function testResetServiceWillNotNestFurtherLazyServicesWithinEachOther() $service = $container->get('foo'); - self::assertInstanceOf(\stdClass::class, $service); + self::assertInstanceOf(ObjectManager::class, $service); self::assertInstanceOf(LazyObjectInterface::class, $service); self::assertFalse($service->isLazyObjectInitialized()); @@ -92,7 +94,7 @@ public function testResetServiceWillNotNestFurtherLazyServicesWithinEachOther() $service->initializeLazyObject(); $wrappedValue = $service->initializeLazyObject(); - self::assertInstanceOf(\stdClass::class, $wrappedValue); + self::assertInstanceOf(DummyManager::class, $wrappedValue); self::assertNotInstanceOf(LazyObjectInterface::class, $wrappedValue); } @@ -104,10 +106,10 @@ private function dumpLazyServiceDoctrineBridgeContainerAsFiles() $container = new ContainerBuilder(); - $container->register('foo', \stdClass::class) + $container->register('foo', DummyManager::class) ->setPublic(true) ->setLazy(true) - ->addTag('proxy', ['interface' => \stdClass::class]); + ->addTag('proxy', ['interface' => ObjectManager::class]); $container->compile(); $fileSystem = new Filesystem();