/** * Deals the stones to the players and starts the game. */ public function deal() { $stones = []; for ($top = 0; $top < 7; ++$top) { for ($bottom = $top; $bottom < 7; ++$bottom) { $stones[] = new Stone($top, $bottom); } } shuffle($stones); foreach ($this->players as $player) { $player->addStones(array_splice($stones, 0, 7)); } $this->setFirstTurn(); $this->state->start(); }
/** * @dataProvider provideStartedStates * @expectedException \Llvdl\Domino\Domain\Exception\LogicException */ public function testSetStateToStartIfNotReadyThrowsLogicException(State $state) { $state->start(); }