/** * @covers Ilios\CoreBundle\Entity\MeshQualifier::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); }
public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.meshQualifier')->getAll(); foreach ($data as $arr) { $entity = new MeshQualifier(); $entity->setId($arr['id']); $entity->setName($arr['name']); foreach ($arr['descriptors'] as $id) { $entity->addDescriptor($this->getReference('meshDescriptors' . $id)); } $this->addReference('meshQualifiers' . $arr['id'], $entity); $manager->persist($entity); } $manager->flush(); }