public function testIsValidForArray()
{
$nestable = new \Nestable\Services\NestableService();
$nested = $nestable->make($this->categories);
$this->assertTrue($nested->isValidForArray());
$nested = $nested->isValidForArray(true);
$iteratorArray = new RecursiveArrayIterator($nested);
$iterator = new RecursiveIteratorIterator($iteratorArray);
$this->assertTrue($iterator->valid());
$this->assertFalse($nested == $this->categories);
$parent_id = $this->_get_random_parent_id($iteratorArray);
if ($parent_id) {
$result = $this->_helper_recursive($nested, $parent_id);
$this->assertGreaterThan(0, $result);
}
}