/** * @test */ public function itShouldBuildTheCommand() { $command = GameMoveCommand::create($this->gameId, $this->playerId, $this->move, $this->context); $this->assertEquals($this->playerId, $command->getPlayerId()); $this->assertEquals($this->gameId, $command->getGameId()); $this->assertEquals($this->move, $command->getMove()); $this->assertEquals($this->context, $command->getContext()); $this->assertEquals(GameMoveCommand::NAME, $command->getCommandName()); }
/** * @test */ public function itShouldFailPlayingIfGameDoesNotExist() { $command = GameMoveCommand::create($this->gameId, $this->playerId, $this->move, $this->context); $this->givenGameDoesNotExist(); $this->assertErrorWillBeHandled(); $this->assertGameStateWontChange(); $this->miniGameCommandHandler->handleGameMoveCommand($command); }