/** * {@inheritdoc} */ public function createBlockView(RawLayout $rawLayout, ContextInterface $context, $rootId = null) { $this->initializeState($rawLayout, $context); try { $rootId = $rootId ? $this->rawLayout->resolveId($rootId) : $this->rawLayout->getRootId(); $this->buildBlocks($rootId); $this->layoutManipulator->applyChanges($this->context, true); $rootView = $this->buildBlockViews($rootId); $this->clearState(); return $rootView; } catch (\Exception $e) { $this->clearState(); throw $e; } }
public function testAddAliasDuplicate() { // prepare test data $this->rawLayout->add('root', null, 'root'); $this->rawLayout->addAlias('test', 'root'); // do test $this->rawLayout->addAlias('test', 'root'); $this->assertTrue($this->rawLayout->hasAlias('test')); $this->assertEquals('root', $this->rawLayout->resolveId('test')); }