/** @test */ public function it_should_throw_an_exception_finding_a_player_that_does_not_exists() { $this->setExpectedException(PlayerNotExistsException::class); $query = PlayerFindStub::random(); $playerId = PlayerIdStub::create($query->playerId()); $this->shouldSearchPlayer($playerId); $this->handler->handle($query); }
/** @test */ public function it_should_not_allow_register_a_player_with_the_same_identifier() { $this->setExpectedException(PlayerAlreadyExistsException::class); $command = PlayerRegistrationStub::random(); $playerId = PlayerIdStub::create($command->id()); $this->shouldSearchPlayer($playerId, PlayerStub::identified($playerId)); $this->handler->handle($command); }