public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.meshDescriptor')->getAll(); foreach ($data as $arr) { $entity = new MeshDescriptor(); $entity->setId($arr['id']); $entity->setName($arr['name']); $entity->setAnnotation($arr['annotation']); $this->addReference('meshDescriptors' . $arr['id'], $entity); $manager->persist($entity); } $manager->flush(); }
/** * @covers Ilios\CoreBundle\Entity\MeshDescriptor::stampUpdate */ public function testStampUpdate() { $now = new \DateTime(); $this->object->stampUpdate(); $updatedAt = $this->object->getUpdatedAt(); $this->assertTrue($updatedAt instanceof \DateTime); $diff = $now->diff($updatedAt); $this->assertTrue($diff->s < 2); }