/** * @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"))]); }
/** * @param GameStart $command */ public function handleGameStart(GameStart $command) { $game = Game::gameStart($command->getGameId(), $command->getWord()); $this->repository->save($game); }