예제 #1
0
 public function persist(PrivateMessage $msg)
 {
     if (!$msg->getSender()->isEqual($this->getAuthor())) {
         throw new AccessDeniedException("You cannot save this message because you're not the sender");
     }
     $this->repository->persist($msg);
 }
예제 #2
0
 public function testTimestamp()
 {
     $this->assertInstanceOf('DateTime', $this->sut->getSentAt());
 }