Example #1
0
 public function testUnsetChild()
 {
     $this->_populateSampleStructure();
     // specify element by name
     $this->_structure->unsetChild('five');
     $this->assertFalse($this->_structure->getParentId('five'));
     $this->assertArrayNotHasKey(Magento_Data_Structure::CHILDREN, $this->_structure->getElement('six'));
     // specify element by parent and alias
     $this->_structure->unsetChild('four', 'tw');
     $this->assertFalse($this->_structure->getChildId('four', 'tw'));
     $this->assertFalse($this->_structure->getParentId('two'));
 }