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); }
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); }