public function testPositionChange() { $steps = mt_rand(1, 10); $cursor = new Cursor(); $cursor->moveDown($steps); $this->assertEquals(1, $cursor->getPosition()); $cursor->moveUp($steps); $this->assertEquals(0, $cursor->getPosition()); $cursor->moveUp($steps); $this->assertEquals($steps - 1, $cursor->getPosition()); }
/** * Sets a single answer * * @return $this */ protected function selectChoice() { $this->answers = [$this->choices[$this->cursor->getPosition()]]; return $this; }