public function testPrePersist() { $this->assertNull($this->entity->getCreatedAt()); $this->entity->prePersist(); $this->assertInstanceOf('DateTime', $this->entity->getCreatedAt()); $this->assertLessThan(3, $this->entity->getCreatedAt()->diff(new \DateTime())->s); }