Пример #1
0
 public function testIsNotUpdatedFlags()
 {
     $user = null;
     $date = null;
     $note = new Note();
     $note->setUpdatedBy($user);
     $note->setUpdatedAt($date);
     $this->assertFalse($note->isUpdatedBySet());
     $this->assertFalse($note->isUpdatedAtSet());
 }
Пример #2
0
 public function testGettersSetters()
 {
     $note = new Note();
     $this->assertNull($note->getMessage());
     $this->assertNull($note->getId());
     $now = new \DateTime();
     $note->setCreatedAt($now)->setUpdatedAt($now)->setMessage('test');
     $this->assertEquals($now, $note->getCreatedAt());
     $this->assertEquals($now, $note->getUpdatedAt());
     $this->assertEquals('test', $note->getMessage());
     $user = new User();
     $note->setUpdatedBy($user)->setOwner($user);
     $this->assertSame($user, $note->getUpdatedBy());
     $this->assertEquals($user, $note->getOwner());
     $organization = new Organization();
     $this->assertNull($note->getOrganization());
     $note->setOrganization($organization);
     $this->assertSame($organization, $note->getOrganization());
 }
Пример #3
0
 /**
  * @param Note          $note
  * @param EntityManager $entityManager
  */
 protected function setCreatedProperties(Note $note, EntityManager $entityManager)
 {
     $note->setCreatedAt(new \DateTime('now', new \DateTimeZone('UTC')));
     $note->setUpdatedBy($this->getUser($entityManager));
 }