/** * 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(); }
/** * @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); }