public function testConstructorStructure() { $structure = new Magento_Data_Structure(); $structure->createElement('test.container', array()); $layout = new Mage_Core_Model_Layout(array('structure' => $structure)); $this->assertTrue($layout->hasElement('test.container')); }
/** * Import a sample structure, suitable for testing elements sort order */ protected function _populateSampleSortStructure() { $child = array(Magento_Data_Structure::PARENT => 'parent'); $this->_structure->importElements(array('parent' => array(Magento_Data_Structure::CHILDREN => array('one' => 'e1', 'two' => 'e2', 'three' => 'e3', 'four' => 'e4', 'five' => 'e5')), 'one' => $child, 'two' => $child, 'three' => $child, 'four' => $child, 'five' => $child, 'x' => array())); }
/** * Get element alias by name * * @param string $name * @return bool|string */ public function getElementAlias($name) { return $this->_structure->getChildAlias($this->_structure->getParentId($name), $name); }