Ejemplo n.º 1
0
 /**
  * Auto play game
  * @return string
  */
 public function autoPlay()
 {
     while ($this->getWinner() === null) {
         $this->getTurn();
         $helper = new TableHelper($this->table);
         if (count($helper->getPossibleMoves()) == null) {
             return $this->getWinner();
         }
     }
     return $this->getWinner();
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider getTestGetPossibleMovesData()
  * @param array $table
  * @param array $expected
  */
 public function testGetPossibleMoves($table, $expected)
 {
     $utility = new TableHelper($table);
     $actual = $utility->getPossibleMoves();
     sort($actual);
     sort($expected);
     $this->assertEquals($actual, $expected);
 }