コード例 #1
0
 /** @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);
 }
コード例 #2
0
ファイル: PlayerStub.php プロジェクト: JavierCane/mpwar
 public static function identified(PlayerId $id)
 {
     return self::create($id, PlayerNameStub::random());
 }
コード例 #3
0
 public static function identified($id)
 {
     return self::create($id, DateTimeStub::random(), PlayerNameStub::random()->value());
 }