Пример #1
0
 public function testGetElementProperty()
 {
     $name = 'test';
     $this->_layout->addContainer($name, 'Test', array('option1' => 1, 'option2' => 2));
     $this->assertEquals('Test', $this->_layout->getElementProperty($name, Mage_Core_Model_Layout::CONTAINER_OPT_LABEL));
     $this->assertEquals(Mage_Core_Model_Layout::TYPE_CONTAINER, $this->_layout->getElementProperty($name, 'type'));
     $this->assertSame(2, $this->_layout->getElementProperty($name, 'option2'));
     $this->_layout->addBlock('Mage_Core_Block_Text', 'text', $name);
     $this->assertEquals(Mage_Core_Model_Layout::TYPE_BLOCK, $this->_layout->getElementProperty('text', 'type'));
     $this->assertSame(array('text' => 'text'), $this->_layout->getElementProperty($name, Magento_Data_Structure::CHILDREN));
 }