Esempio n. 1
0
 public function testValidMoves()
 {
     foreach ($this->getValidMoves() as $move) {
         $moveObject = new Move($move[0], $move[1]);
         $this->assertEquals($move[0], $moveObject->getX());
         $this->assertEquals($move[1], $moveObject->getY());
     }
 }
Esempio n. 2
0
 private function validateMove(Move $move)
 {
     if ($this->board[$move->getX()][$move->getY()] !== 0) {
         throw new InvalidMoveException($move->getX(), $move->getY());
     }
     if (!isset($this->board[$move->getX()][$move->getY()])) {
         throw new InvalidMoveException($move->getX(), $move->getY());
     }
 }