Ejemplo n.º 1
0
 /**
  * @test
  */
 public function it_can_start_a_game()
 {
     $id = $this->generator->generate();
     $this->scenario->when(function () use($id) {
         return Game::gameStart($id, "puppy");
     })->then([new GameStarted($id, "puppy", new \DateTime("now"))]);
 }
Ejemplo n.º 2
0
 /**
  * @param GameStart $command
  */
 public function handleGameStart(GameStart $command)
 {
     $game = Game::gameStart($command->getGameId(), $command->getWord());
     $this->repository->save($game);
 }