public function testFactory() { $serviceManager = new ServiceManager(); $serviceManager->setAllowOverride(true); $serviceManager->setService('ConLayout\\Block\\Factory\\BlockFactoryInterface', new BlockFactory()); $serviceManager->setService('ConLayout\\Updater\\LayoutUpdaterInterface', new LayoutUpdater()); $serviceManager->setService('ConLayout\\Options\\ModuleOptions', new ModuleOptions()); $factory = new LayoutFactory(); $instance = $factory->createService($serviceManager); $this->assertInstanceOf('ConLayout\\Layout\\LayoutInterface', $instance); }
public function testFactory() { $serviceManager = new ServiceManager(); $serviceManager->setAllowOverride(true); $serviceManager->setService(BlockPoolInterface::class, new BlockPool()); $serviceManager->setService(LayoutUpdaterInterface::class, new LayoutUpdater()); $serviceManager->setService(ModuleOptions::class, new ModuleOptions()); $factory = new LayoutFactory(); $instance = $factory->createService($serviceManager); $this->assertInstanceOf(LayoutInterface::class, $instance); }