/** @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);
 }
Exemple #2
0
 /** @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);
 }
Exemple #3
0
 public static function random()
 {
     return self::create(PlayerIdStub::random()->value());
 }
Exemple #4
0
 public static function random()
 {
     return self::create(PlayerIdStub::random(), PlayerNameStub::random());
 }
 public static function named($name)
 {
     return self::create(PlayerIdStub::random()->value(), $name);
 }