public function testNotBlankValidation()
 {
     $notBlank = array('title', 'childSequenceOrder', 'orderInSequence', 'minimum', 'maximum', 'startDate', 'endDate', 'duration');
     $this->validateNotBlanks($notBlank);
     $this->object->setTitle('test title for the block max 200');
     $this->object->setChildSequenceOrder(true);
     // this fails when a False is passed I have noticed
     $this->object->setOrderInSequence(2);
     $this->object->setMinimum(1);
     $this->object->setMaximum(521);
     $this->object->setStartDate(new \DateTime());
     $this->object->setEndDate(new \DateTime());
     $this->object->setDuration(60);
     $this->validate(0);
 }
 public function load(ObjectManager $manager)
 {
     $data = $this->container->get('ilioscore.dataloader.curriculumInventorySequenceBlock')->getAll();
     foreach ($data as $arr) {
         $entity = new CurriculumInventorySequenceBlock();
         $entity->setId($arr['id']);
         $entity->setTitle($arr['title']);
         $entity->setTrack($arr['track']);
         $entity->setChildSequenceOrder($arr['childSequenceOrder']);
         $entity->setOrderInSequence($arr['orderInSequence']);
         $entity->setMinimum($arr['minimum']);
         $entity->setMaximum($arr['maximum']);
         $entity->setDuration($arr['duration']);
         $entity->setRequired($arr['required']);
         $entity->setStartDate(new \DateTime($arr['startDate']));
         $entity->setEndDate(new \DateTime($arr['endDate']));
         $entity->setAcademicLevel($this->getReference('curriculumInventoryAcademicLevels' . $arr['academicLevel']));
         $entity->setReport($this->getReference('curriculumInventoryReports' . $arr['report']));
         if (!empty($arr['parent'])) {
             $entity->setParent($this->getReference('curriculumInventorySequenceBlocks' . $arr['parent']));
         }
         foreach ($arr['sessions'] as $sessionId) {
             $entity->addSession($this->getReference('sessions' . $sessionId));
         }
         $manager->persist($entity);
         $this->addReference('curriculumInventorySequenceBlocks' . $arr['id'], $entity);
     }
     $manager->flush();
 }
 /**
  * @return array
  */
 public function testCompareSequenceBlocksWithOrderedStrategyProvider()
 {
     $rhett = [];
     $blockA = new CurriculumInventorySequenceBlock();
     $blockA->setId(1);
     $blockA->setOrderInSequence(1);
     // same as A but different order
     $blockB = new CurriculumInventorySequenceBlock();
     $blockB->setId(1);
     $blockB->setOrderInSequence(2);
     // same as B but different id
     $blockC = new CurriculumInventorySequenceBlock();
     $blockC->setId(2);
     $blockC->setOrderInSequence(2);
     $rhett[] = [$blockA, $blockA, 0];
     $rhett[] = [$blockA, $blockB, -1];
     $rhett[] = [$blockB, $blockA, 1];
     $rhett[] = [$blockB, $blockC, 0];
     $rhett[] = [$blockC, $blockB, 0];
     $rhett[] = [$blockA, $blockC, -1];
     $rhett[] = [$blockC, $blockA, 1];
     return $rhett;
 }