public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = User::getByUsername('super');
     $super = User::getByUsername('super');
     $super->primaryEmail = new Email();
     $super->primaryEmail->emailAddress = '*****@*****.**';
     assert($super->save());
     // Not Coding Standard
     $bobby = UserTestHelper::createBasicUserWithEmailAddress('bobby');
     $sarah = UserTestHelper::createBasicUserWithEmailAddress('sarah');
     self::$superUserId = $super->id;
     self::$bobbyUserId = $bobby->id;
     self::$sarahUserId = $sarah->id;
     $emailTemplate = new EmailTemplate();
     $emailTemplate->modelClassName = 'WorkflowModelTestItem';
     $emailTemplate->type = 1;
     $emailTemplate->name = 'some template';
     $emailTemplate->subject = 'some subject [[LAST^NAME]]';
     $emailTemplate->htmlContent = 'html content [[STRING]]';
     $emailTemplate->textContent = 'text content [[PHONE]]';
     $saved = $emailTemplate->save();
     if (!$saved) {
         throw new FailedToSaveModelException();
     }
     self::$emailTemplate = $emailTemplate;
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = User::getByUsername('super');
     $super = User::getByUsername('super');
     $super->primaryEmail = new Email();
     $super->primaryEmail->emailAddress = '*****@*****.**';
     assert($super->save());
     // Not Coding Standard
     //Create alpha group
     $group = new Group();
     $group->name = 'Alpha';
     $saved = $group->save();
     assert($saved);
     // Not Coding Standard
     self::$alphaGroup = $group;
     //Now set default permissions to owner and users in group Alpha
     $form = UserConfigurationFormAdapter::makeFormFromUserConfigurationByUser($super);
     $form->defaultPermissionSetting = UserConfigurationForm::DEFAULT_PERMISSIONS_SETTING_OWNER_AND_USERS_IN_GROUP;
     $form->defaultPermissionGroupSetting = $group->id;
     UserConfigurationFormAdapter::setConfigurationFromForm($form, $super);
     $bobby = UserTestHelper::createBasicUserWithEmailAddress('bobby');
     $sarah = UserTestHelper::createBasicUserWithEmailAddress('sarah');
     self::$superUserId = $super->id;
     self::$bobbyUserId = $bobby->id;
     self::$sarahUserId = $sarah->id;
     $file = ZurmoTestHelper::createFileModel();
     $emailTemplate = new EmailTemplate();
     $emailTemplate->builtType = EmailTemplate::BUILT_TYPE_PASTED_HTML;
     $emailTemplate->modelClassName = 'WorkflowModelTestItem';
     $emailTemplate->type = 1;
     $emailTemplate->name = 'some template';
     $emailTemplate->subject = 'some subject [[LAST^NAME]]';
     $emailTemplate->htmlContent = 'html content [[STRING]]';
     $emailTemplate->textContent = 'text content [[PHONE]]';
     $emailTemplate->files->add($file);
     $saved = $emailTemplate->save();
     if (!$saved) {
         throw new FailedToSaveModelException();
     }
     self::$emailTemplate = $emailTemplate;
     $everyoneGroup = Group::getByName(Group::EVERYONE_GROUP_NAME);
     assert($everyoneGroup->save());
     // Not Coding Standard
 }