/** * @test */ public function itShouldBuildTheCommand() { $command = StartGameCommand::create($this->gameId, $this->playerId, $this->context); $this->assertEquals($this->playerId, $command->getPlayerId()); $this->assertEquals($this->gameId, $command->getGameId()); $this->assertEquals($this->context, $command->getContext()); $this->assertEquals(StartGameCommand::NAME, $command->getCommandName()); }
/** * @test */ public function itShouldFailStartingGame() { $command = StartGameCommand::create($this->gameId, $this->playerId, $this->context); $this->givenGameExists(); $this->givenItCanNotStartTheGame(); $this->assertErrorWillBeHandled(); $this->assertGameStateWontChange(); $this->miniGameCommandHandler->handleStartGameCommand($command); }