function testTermChildren() { $parent_id = $this->factory->term->create(array('name' => 'News', 'taxonomy' => 'category')); $local = $this->factory->term->create(array('name' => 'Local', 'parent' => $parent_id, 'taxonomy' => 'category')); $int = $this->factory->term->create(array('name' => 'International', 'parent' => $parent_id, 'taxonomy' => 'category')); $term = new TimberTerm($parent_id); $children = $term->children(); $this->assertEquals(2, count($children)); $this->assertEquals('Local', $children[0]->name); }
public function children() { return $this->term->children(); }