public function testNotBlankValidation() { $notBlank = array('title'); $this->validateNotBlanks($notBlank); $this->object->setTitle('test'); $this->validate(0); }
public function testNotNullValidation() { $notNulls = array('school'); $this->object->setTitle('test'); $this->validateNotNulls($notNulls); $this->object->setSchool(m::mock('Ilios\\CoreBundle\\Entity\\SchoolInterface')); $this->validate(0); }
public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.instructorGroup')->getAll(); foreach ($data as $arr) { $entity = new InstructorGroup(); $entity->setId($arr['id']); $entity->setTitle($arr['title']); foreach ($arr['users'] as $id) { $entity->addUser($this->getReference('users' . $id)); } $manager->persist($entity); $this->addReference('instructorGroups' . $arr['id'], $entity); } $manager->flush(); }