/** @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); }
public static function identified(PlayerId $id) { return self::create($id, PlayerNameStub::random()); }
public static function identified($id) { return self::create($id, DateTimeStub::random(), PlayerNameStub::random()->value()); }