/** * @param CreatePoll $command */ public function handleCreatePoll(CreatePoll $command) { $id = $command->getPollId(); $name = $command->getTitle(); $poll = Poll::create($id, $name); $this->repository->add($poll); }
/** * @test * @group unit */ public function poll_title_is_returned() { $id = new PollId(); $command = new CreatePoll($id, 'Title'); $this->assertSame('Title', $command->getTitle()); }