コード例 #1
0
 public function testNullifyParentColumnOnNewNodes()
 {
     $node = new Cluster(['name' => 'Root 3']);
     $node->parent_id = null;
     $node->save();
     $node->reload();
     $this->assertNull($node->parent()->first());
     $this->assertEquals(0, $node->getLevel());
     $this->assertEquals(13, $node->getLeft());
     $this->assertEquals(14, $node->getRight());
     $this->assertTrue(Cluster::isValidNestedSet());
 }