Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 /**
  * Sets a single answer
  *
  * @return $this
  */
 protected function selectChoice()
 {
     $this->answers = [$this->choices[$this->cursor->getPosition()]];
     return $this;
 }