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); }
/** * Check node children * * @return bool */ public function hasChildren() { return $this->_childNodes->count() > 0; }