public function testNotBlankValidation() { $notBlank = array('shortTitle', 'duration'); $this->validateNotBlanks($notBlank); $this->object->setShortTitle('DVc'); $this->object->setDuration(30); $this->validate(0); }
public function testNotNullValidation() { $notNull = array('school'); $this->object->setTitle('DVc'); $this->object->setDuration(30); $this->validateNotNulls($notNull); $this->object->setSchool(m::mock('Ilios\\CoreBundle\\Entity\\SchoolInterface')); $this->validate(0); }
public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.program')->getAll(); foreach ($data as $arr) { $entity = new Program(); $entity->setId($arr['id']); $entity->setTitle($arr['title']); $entity->setShortTitle($arr['shortTitle']); $entity->setDuration($arr['duration']); $entity->setPublishedAsTbd($arr['publishedAsTbd']); $entity->setPublished($arr['published']); $entity->setSchool($this->getReference('schools' . $arr['school'])); $manager->persist($entity); $this->addReference('programs' . $arr['id'], $entity); } $manager->flush(); }