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