Esempio n. 1
0
 public function testIncludedHandleDoesNotOverride()
 {
     $this->updater->setHandles([new Handle('handle/with-include', 10)]);
     $layoutStructure = $this->updater->getLayoutStructure();
     $block = $layoutStructure->blocks->get('do.not.override');
     $includedBlock = $layoutStructure->blocks->get('some.included.block');
     $this->assertEquals('some/tpl', $includedBlock->get('template'));
     $this->assertFalse($block->remove);
 }
Esempio n. 2
0
 /**
  *
  * @param array $handles
  * @return LayoutManager
  */
 public function setHandles(array $handles)
 {
     $newHandles = [];
     foreach ($handles as $handle => $priority) {
         if (is_string($handle) && !$priority instanceof HandleInterface) {
             $handle = new Handle($handle, $priority);
         } elseif ($priority instanceof HandleInterface) {
             $handle = $priority;
         }
         $newHandles[] = $handle;
     }
     $this->updater->setHandles($newHandles);
     return $this;
 }