public function testGettersAndSetters() { $entity = new Revision(); $this->assertLessThanOrEqual(new \DateTime(), $entity->getTimestamp()); $userClass = \SoliantEntityAudit\Module::getModuleOptions()->getUserEntityClassName(); $user = new $userClass(); $this->assertEquals($entity, $entity->setUser($user)); $this->assertEquals($user, $entity->getUser()); $entity->setComment('Test revision entity setter and getter'); $this->assertEquals('Test revision entity setter and getter', $entity->getComment()); }
private function buildRevision() { if ($this->revision) { return; } $revision = new RevisionEntity(); $moduleOptions = Module::getModuleOptions(); if ($moduleOptions->getUser()) { $revision->setUser($moduleOptions->getUser()); } $comment = $moduleOptions->getAuditService()->getComment(); $revision->setComment($comment); $this->revision = $revision; }