public function testAncestorsByNode() { $category = $this->findCategory('apple'); $ancestors = all(Category::whereAncestorOf($category)->pluck('id')); $this->assertEquals([1, 2], $ancestors); }