/** @test */ public function it_should_register_a_player() { $command = PlayerRegistrationStub::random(); $playerId = PlayerIdStub::create($command->id()); $playerName = PlayerNameStub::create($command->name()); $player = PlayerStub::create($playerId, $playerName); $playerRegistered = PlayerRegisteredStub::from($player); $this->shouldSearchPlayer($playerId); $this->shouldPersistPlayer($player); $this->shouldHandleEvent($playerRegistered); $this->handler->handle($command); }
/** * @test * @dataProvider invalidAccountOwners */ public function it_should_throw_an_exception_registering_a_player_with_an_invalid_identifier($owner) { $this->setExpectedException(AccountOwnerNotValidException::class); $event = PlayerRegisteredStub::identified($owner); $this->subscriber->notify($event); }