/** * @covers \Ilios\CoreBundle\Entity\Competency::setParent */ public function testRemoveParent() { $obj = m::mock('Ilios\\CoreBundle\\Entity\\Competency'); $this->object->setParent($obj); $this->assertSame($obj, $this->object->getParent()); $this->object->setParent(null); $this->assertNull($this->object->getParent()); }
public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.competency')->getAll(); foreach ($data as $arr) { $entity = new Competency(); $entity->setId($arr['id']); $entity->setTitle($arr['title']); $entity->setActive($arr['active']); foreach ($arr['aamcPcrses'] as $id) { $entity->addAamcPcrs($this->getReference('aamcPcrs' . $id)); } if (isset($arr['parent'])) { $entity->setParent($this->getReference('competencies' . $arr['parent'])); } $entity->setSchool($this->getReference('schools' . $arr['school'])); $manager->persist($entity); $this->addReference('competencies' . $arr['id'], $entity); } $manager->flush(); }
/** * @covers Ilios\CoreBundle\Entity\Competency::__construct */ public function testConstructor() { $this->assertEmpty($this->object->getAamcPcrses()); $this->assertEmpty($this->object->getProgramYears()); }