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); }
public function testTimestamp() { $this->assertInstanceOf('DateTime', $this->sut->getSentAt()); }