public function testUnsetElement() { $this->_populateSampleStructure(); // non-recursively $this->assertTrue($this->_structure->unsetElement('six', false)); $this->assertFalse($this->_structure->unsetElement('six', false)); $this->assertSame(array(5), $this->_structure->getElement('five')); // recursively $this->assertTrue($this->_structure->unsetElement('four')); $this->assertSame(array('one' => array(), 'five' => array(5)), $this->_structure->exportElements()); }
/** * Remove block from registry * * @param string $name * @return Mage_Core_Model_Layout */ public function unsetElement($name) { if (isset($this->_blocks[$name])) { $this->_blocks[$name] = null; unset($this->_blocks[$name]); } $this->_structure->unsetElement($name); return $this; }