Esempio n. 1
0
 public function setUp()
 {
     parent::setUp();
     $this->factory = new BlockFactory();
     $this->sm = new ServiceManager();
     $this->factory->setServiceLocator($this->sm);
 }
Esempio n. 2
0
 public function setUp()
 {
     parent::setUp();
     $this->layoutStructure = (include __DIR__ . '/_files/layout-structure.php');
     $this->updaterMock = $this->getMockBuilder(LayoutUpdaterInterface::class)->getMock();
     $this->updaterMock->method('getLayoutStructure')->willReturn(new Config($this->layoutStructure));
     $this->blockFactory = new BlockFactory([], new BlockManager(), new ServiceManager());
 }
Esempio n. 3
0
 public function setUp()
 {
     if (!class_exists('ZendDeveloperTools\\Collector\\AbstractCollector')) {
         $this->markTestSkipped('ZDT not available');
     }
     parent::setUp();
     $resolver = new AggregateResolver();
     $resolver->attach($this->getResolver());
     $this->collector = new LayoutCollector($this->layout, $this->layoutUpdater, $resolver);
 }
Esempio n. 4
0
 public function setUp()
 {
     parent::setUp();
     $this->blockRenderer = Bootstrap::getServiceManager()->create('ConLayout\\View\\Renderer\\BlockRenderer');
     $this->blockRenderer = new BlockRenderer();
     $this->resolver = new TemplatePathStack();
     $this->resolver->addPath(__DIR__ . '/_view');
     $this->blockRenderer->setResolver($this->resolver);
     $this->blockRenderer->setHelperPluginManager(Bootstrap::getServiceManager()->get('ViewHelperManager'));
 }
Esempio n. 5
0
 public function setUp()
 {
     parent::setUp();
     $this->updater = new LayoutUpdater();
     $this->em = new EventManager(new SharedEventManager());
     $this->updater->setEventManager($this->em);
     $instructions = [['default', 'frontend', new Config(['blocks' => ['header' => [], 'footer' => []]], true)], ['another-handle', 'frontend', new Config(['blocks' => ['widget1' => []]], true)], ['handle/with-include', 'frontend', new Config(['blocks' => ['do.not.override' => ['remove' => false]], LayoutUpdaterInterface::INSTRUCTION_INCLUDE => ['included/handle']], true)], ['included/handle', 'frontend', new Config(['blocks' => ['some.included.block' => ['template' => 'some/tpl'], 'do.not.override' => ['remove' => true]], LayoutUpdaterInterface::INSTRUCTION_INCLUDE => ['included/handle/no2']], true)], ['included/handle/no2', 'frontend', new Config(['blocks' => ['some.included.block.2' => []]])]];
     $this->em->getSharedManager()->clearListeners(LayoutUpdater::class);
     $collectorMock = $this->getMockBuilder(CollectorInterface::class)->getMock();
     $collectorMock->method('collect')->will($this->returnValueMap($instructions));
     $this->updater->attachCollector('mock', $collectorMock);
 }
Esempio n. 6
0
 public function setUp()
 {
     parent::setUp();
     $this->updater = new LayoutUpdater();
     $this->em = new EventManager();
     $instructions = ['default' => ['blocks' => ['header' => [], 'footer' => []]], 'another-handle' => ['blocks' => ['widget1' => []]]];
     $this->em->getSharedManager()->clearListeners('ConLayout\\Updater\\LayoutUpdater');
     $this->em->getSharedManager()->attach('ConLayout\\Updater\\LayoutUpdater', 'getLayoutStructure.pre', function (UpdateEvent $e) use($instructions) {
         $handles = $e->getHandles();
         $this->layoutStructure = $e->getLayoutStructure();
         foreach ($handles as $handle) {
             if (isset($instructions[$handle])) {
                 $instructionsConfig = new Config($instructions[$handle]);
                 $this->layoutStructure->merge($instructionsConfig);
             }
         }
     });
 }
Esempio n. 7
0
 public function setUp()
 {
     parent::setUp();
     $this->sm = new ServiceManager();
     $this->factory = new BlockFactory([], new BlockManager(), $this->sm);
 }
Esempio n. 8
0
 public function setUp()
 {
     parent::setUp();
     $this->blockHelper = new Block($this->blockPool);
     $this->blockHelper->setView(new PhpRenderer());
 }
Esempio n. 9
0
 public function setUp()
 {
     parent::setUp();
     $this->blockManager = new BlockManager();
 }
 public function setUp()
 {
     parent::setUp();
     $this->collector = new FilesystemCollector([LayoutUpdaterInterface::AREA_GLOBAL => [__DIR__ . '/_files/global'], 'frontend' => [__DIR__ . '/_files/frontend']]);
 }
Esempio n. 11
0
 public function setUp()
 {
     parent::setUp();
     $this->strategy = Bootstrap::getServiceManager()->create('ConLayout\\View\\Strategy\\BlockRendererStrategy');
     $this->em = Bootstrap::getServiceManager()->create('EventManager');
 }
 public function setUp()
 {
     parent::setUp();
     $this->prepareActionViewModelListener = new PrepareActionViewModelListener($this->blockPool);
     $this->mvcEvent = new MvcEvent();
 }
Esempio n. 13
0
 public function setUp()
 {
     parent::setUp();
     $this->blockPool->add('test-block', (new ViewModel())->setTemplate('widget1'));
     $this->layoutManager = new LayoutManager($this->layout, $this->layoutUpdater, $this->blockPool);
 }
 public function setUp()
 {
     parent::setUp();
     $this->listener = new LayoutUpdateListener([LayoutUpdaterInterface::AREA_GLOBAL => [__DIR__ . '/_files/module1', __DIR__ . '/_files/module2'], 'area1' => [__DIR__ . '/_files/module1/area1'], 'area2' => [__DIR__ . '/_files/module1/area2']]);
     $this->layoutStructure = new Config([], true);
 }
Esempio n. 15
0
 public function setUp()
 {
     parent::setUp();
     $config = [LayoutUpdaterInterface::AREA_GLOBAL => ['default' => ['blocks' => ['root' => [], 'global.block' => ['template' => 'lorem/ipsum']]]], 'frontend' => ['default' => ['blocks' => ['my.block' => [], 'global.block' => ['template' => 'tpl/for/frontend']]]], 'backend' => ['app/index' => ['blocks' => ['some.block' => []]]]];
     $this->collector = new ConfigCollector($config);
 }
Esempio n. 16
0
 public function setUp()
 {
     parent::setUp();
     $this->collector = new LayoutCollector($this->layout, $this->layoutUpdater);
 }