Ejemplo n.º 1
0
 public function testDelete()
 {
     $tree = new \Magento\Framework\Data\Tree();
     $this->assertSame($this->collection->count(), 0);
     $node = new \Magento\Framework\Data\Tree\Node(['id' => 'node1'], 'id', $tree);
     $this->collection->add($node);
     $this->assertSame($this->collection->count(), 1);
     $this->collection->delete($node);
     $this->assertSame($this->collection->count(), 0);
 }
Ejemplo n.º 2
0
 /**
  * Check node children
  *
  * @return bool
  */
 public function hasChildren()
 {
     return $this->_childNodes->count() > 0;
 }