Skip to content

Commit

Permalink
added the whole subtree removal test
Browse files Browse the repository at this point in the history
  • Loading branch information
franzose committed Feb 3, 2015
1 parent c8ba936 commit 507f94a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/EntityTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,15 @@ public function testForceDeleteDeepSubtree()
$this->assertEquals(1, ClosureTable::whereBetween('ancestor', [1, 9])->count());
}

public function testForceDeleteSubtreeWithSelf()
{
$entity = Entity::find(9);
$entity->deleteSubtree(true, true);

$this->assertEquals(0, Entity::whereBetween('id', [9, 15])->count());
$this->assertEquals(0, ClosureTable::whereBetween('ancestor', [9, 15])->count());
}

public function testCreateFromArray()
{
$array = [
Expand Down

0 comments on commit 507f94a

Please sign in to comment.