Пример #1
0
 public function testFactory()
 {
     $serviceManager = new ServiceManager();
     $serviceManager->setService(LayoutInterface::class, $this->layout);
     $serviceManager->setService(LayoutUpdaterInterface::class, $this->layoutUpdater);
     $serviceManager->setService(BlockPoolInterface::class, $this->blockPool);
     $controllerPluginManager = new PluginManager();
     $controllerPluginManager->setServiceLocator($serviceManager);
     $factory = new LayoutManagerFactory();
     $instance = $factory->createService($controllerPluginManager);
     $this->assertInstanceOf(LayoutManager::class, $instance);
 }
Пример #2
0
 public function testFactory()
 {
     $serviceManager = new ServiceManager();
     $serviceManager->setService('ConLayout\\Layout\\LayoutInterface', $this->layout);
     $serviceManager->setService('ConLayout\\Updater\\LayoutUpdaterInterface', $this->updater);
     $serviceManager->setService('ConLayout\\View\\Renderer\\BlockRenderer', $this->renderer);
     $controllerPluginManager = new PluginManager();
     $controllerPluginManager->setServiceLocator($serviceManager);
     $factory = new LayoutManagerFactory();
     $instance = $factory->createService($controllerPluginManager);
     $this->assertInstanceOf('ConLayout\\Controller\\Plugin\\LayoutManager', $instance);
 }