Ejemplo n.º 1
0
 public function testPrePersist()
 {
     $this->assertNull($this->entity->getCreatedAt());
     $this->assertNull($this->entity->getUpdatedAt());
     $this->entity->prePersist();
     $this->assertInstanceOf('\\DateTime', $this->entity->getCreatedAt());
     $this->assertInstanceOf('\\DateTime', $this->entity->getUpdatedAt());
     $expectedCreated = $this->entity->getCreatedAt();
     $expectedUpdated = $this->entity->getUpdatedAt();
     $this->entity->prePersist();
     $this->assertSame($expectedCreated, $this->entity->getCreatedAt());
     $this->assertSame($expectedUpdated, $this->entity->getUpdatedAt());
 }