Skip to content

Commit bf599ab

Browse files
committed
eagerLoadingAncestorsWithScope | add failing test
1 parent 2d5c99f commit bf599ab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/ScopedNodeTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,12 @@ public function testInsertingBeforeAnotherScopeFails()
219219

220220
$a->insertAfterNode($b);
221221
}
222+
223+
public function testEagerLoadingAncestorsWithScope()
224+
{
225+
$filteredNodes = MenuItem::where('title', 'menu item 3')->with(['ancestors'])->get();
226+
227+
$this->assertEquals(2, $filteredNodes->find(5)->ancestors[0]->id);
228+
$this->assertEquals(4, $filteredNodes->find(6)->ancestors[0]->id);
229+
}
222230
}

0 commit comments

Comments
 (0)