Exemplo n.º 1
0
 public function testNotBlankValidation()
 {
     $notBlank = array('tableRowId', 'tableName');
     $this->validateNotBlanks($notBlank);
     $this->object->setTableRowId(3215);
     $this->object->setTableName('zippeedee doo dah');
     $this->validate(0);
 }
Exemplo n.º 2
0
 public function load(ObjectManager $manager)
 {
     $data = $this->container->get('ilioscore.dataloader.alert')->getAll();
     foreach ($data as $arr) {
         $entity = new Alert();
         $entity->setId($arr['id']);
         $entity->setTableName($arr['tableName']);
         $entity->setTableRowId($arr['tableRowId']);
         $entity->setDispatched($arr['dispatched']);
         foreach ($arr['changeTypes'] as $id) {
             $entity->addChangeType($this->getReference('alertChangeTypes' . $id));
         }
         foreach ($arr['instigators'] as $id) {
             $entity->addInstigator($this->getReference('users' . $id));
         }
         foreach ($arr['recipients'] as $id) {
             $entity->addRecipient($this->getReference('schools' . $id));
         }
         $manager->persist($entity);
         $this->addReference('alerts' . $arr['id'], $entity);
     }
     $manager->flush();
 }
 /**
  * @return array
  */
 public function testExecuteDeletedOfferingProvider()
 {
     $course = new Course();
     $session = new Session();
     $session->setCourse($course);
     $offeringA = new Offering();
     $offeringA->setId(1);
     $offeringA->setSession($session);
     $alertA = new Alert();
     $alertA->setTableName('offering');
     $alertA->setTableRowId($offeringA->getId());
     $session = new Session();
     $offeringB = new Offering();
     $offeringB->setId(1);
     $offeringB->setSession($session);
     $alertB = new Alert();
     $alertB->setTableName('offering');
     $alertB->setTableRowId($offeringB->getId());
     $offeringC = new Offering();
     $offeringC->setId(1);
     $alertC = new Alert();
     $alertC->setTableName('offering');
     $alertC->setTableRowId($offeringC->getId());
     return [[$alertA, $offeringA], [$alertB, $offeringB], [$alertC, $offeringC]];
 }