public function testMoveDown()
 {
     $item1 = new SortableItem();
     $item1->save();
     $item2 = new SortableItem();
     $item2->save();
     $this->assertTrue($item1->position < $item2->position);
     $item1->moveDown();
     $this->assertTrue($item1->position > $item2->refresh()->position);
 }
Exemplo n.º 2
0
 public function testMoveDownLastDoesNothing()
 {
     $item1 = new SortableItem();
     $item1->save();
     $item2 = new SortableItem();
     $item2->save();
     $this->assertTrue($item1->position < $item2->position);
     $item2->moveDown();
     $this->assertTrue($item1->position < $item2->position);
 }