public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     AllPermissionsOptimizationUtil::rebuild();
     SecurityTestHelper::createSuperAdmin();
     $everyoneGroup = Group::getByName(Group::EVERYONE_GROUP_NAME);
     assert($everyoneGroup->save());
     // Not Coding Standard
     $group1 = new Group();
     $group1->name = 'Group1';
     assert($group1->save());
     // Not Coding Standard
     $group2 = new Group();
     $group2->name = 'Group2';
     assert($group2->save());
     // Not Coding Standard
     $group3 = new Group();
     $group3->name = 'Group3';
     assert($group3->save());
     // Not Coding Standard
     $group4 = new Group();
     $group4->name = 'Group4';
     assert($group4->save());
     // Not Coding Standard
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $billy = UserTestHelper::createBasicUser('billy');
     EmailBox::resolveAndGetByName(EmailBox::NOTIFICATIONS_NAME);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     AllPermissionsOptimizationUtil::rebuild();
     $box = EmailBox::resolveAndGetByName(EmailBox::NOTIFICATIONS_NAME);
 }
 public function setUp()
 {
     parent::setUp();
     if (!EmailMessageTestHelper::isSetEmailAccountsTestConfiguration()) {
         $this->markTestSkipped('Please fix the test email settings');
     }
 }
Exemplo n.º 5
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = User::getByUsername('super');
     ReadPermissionsOptimizationUtil::rebuild();
     SecurityTestHelper::createUsers();
     $billy = User::getByUsername('billy');
     EmailMessageTestHelper::createEmailAccount($billy);
     $billy->setRight('ContactsModule', ContactsModule::RIGHT_ACCESS_CONTACTS);
     $billy->setRight('ContactsModule', ContactsModule::RIGHT_CREATE_CONTACTS);
     $billy->setRight('ContactsModule', ContactsModule::RIGHT_DELETE_CONTACTS);
     assert($billy->save());
     // Not Coding Standard
     $contact = ContactTestHelper::createContactByNameForOwner('sally', Yii::app()->user->userModel);
     $contact->primaryEmail = new Email();
     $contact->primaryEmail->emailAddress = '*****@*****.**';
     $contact->secondaryEmail->emailAddress = '*****@*****.**';
     $contact->addPermissions($billy, Permission::READ);
     $contact->addPermissions($billy, Permission::WRITE);
     $contact->save();
     $molly = ContactTestHelper::createContactByNameForOwner('molly', User::getByUsername('bobby'));
     $molly->primaryEmail = new Email();
     $molly->primaryEmail->emailAddress = '*****@*****.**';
     $molly->secondaryEmail->emailAddress = '*****@*****.**';
     $contact->save();
     ReadPermissionsOptimizationUtil::securableItemGivenPermissionsForUser($contact, $billy);
 }
 public function teardown()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     Account::deleteAll();
     parent::teardown();
 }
 public function teardown()
 {
     if ($this->freeze) {
         RedBeanDatabase::freeze();
     }
     parent::teardown();
 }
Exemplo n.º 8
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     UserTestHelper::createBasicUser('billy');
     UserTestHelper::createBasicUser('sally');
 }
 public function teardown()
 {
     $marketingLists = MarketingList::getAll();
     $this->assertCount(1, $marketingLists);
     $marketingLists[0]->delete();
     parent::teardown();
 }
 public function setUp()
 {
     parent::setUp();
     Yii::app()->user->userModel = User::getByUsername('super');
     EmailMessage::deleteAll();
     Notification::deleteAll();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = SecurityTestHelper::createSuperAdmin();
     $super->primaryEmail->emailAddress = '*****@*****.**';
     $super->save();
 }
Exemplo n.º 12
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
     SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = User::getByUsername('super');
 }
 public function setUp()
 {
     parent::setUp();
     if (!SendGridTestHelper::isSetSendGridAccountTestConfiguration()) {
         $this->markTestSkipped(Zurmo::t('SendGridModule', 'Email test settings are missing.'));
     }
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $super = SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = $super;
     AccountTestHelper::createAccountByNameForOwner('anAccount', $super);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     ContactsModule::loadStartingData();
     //Need to instantiate a controller so the clipWidget can work properly in elements that utilize it.
     $controller = Yii::app()->createController('reports/default');
     list($controller, $actionId) = $controller;
     Yii::app()->setController($controller);
     $values = array('Test1', 'Test2', 'Test3', 'Sample', 'Demo');
     $customFieldData = CustomFieldData::getByName('ReportTestDropDown');
     $customFieldData->serializedData = serialize($values);
     $saved = $customFieldData->save();
     assert($saved);
     // Not Coding Standard
     $values = array('Multi 1', 'Multi 2', 'Multi 3');
     $customFieldData = CustomFieldData::getByName('ReportTestMultiDropDown');
     $customFieldData->serializedData = serialize($values);
     $saved = $customFieldData->save();
     assert($saved);
     // Not Coding Standard
     $values = array('Radio 1', 'Radio 2', 'Radio 3');
     $customFieldData = CustomFieldData::getByName('ReportTestRadioDropDown');
     $customFieldData->serializedData = serialize($values);
     $saved = $customFieldData->save();
     assert($saved);
     // Not Coding Standard
     $values = array('Cloud 1', 'Cloud 2', 'Cloud 3');
     $customFieldData = CustomFieldData::getByName('ReportTestTagCloud');
     $customFieldData->serializedData = serialize($values);
     $saved = $customFieldData->save();
     assert($saved);
     // Not Coding Standard
 }
Exemplo n.º 16
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $user = SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = $user;
     $loaded = ContactsModule::loadStartingData();
     assert($loaded);
     // Not Coding Standard
     $contactData = array('Sam', 'Sally', 'Sarah', 'Jason', 'James', 'Roger');
     $contactStates = ContactState::getAll();
     $lastContactState = $contactStates[count($contactStates) - 1];
     foreach ($contactData as $key => $firstName) {
         $contact = new Contact();
         $contact->title->value = 'Mr.';
         $contact->firstName = $firstName;
         $contact->lastName = $firstName . 'son';
         $contact->owner = $user;
         $contact->state = $lastContactState;
         $contact->primaryEmail = new Email();
         $contact->primaryEmail->emailAddress = $key . '@zurmoland.com';
         $contact->secondaryEmail = new Email();
         $contact->secondaryEmail->emailAddress = 'a' . $key . $firstName . '@zurmoworld.com';
         assert($contact->save());
         // Not Coding Standard
     }
 }
Exemplo n.º 17
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
     SecurityTestHelper::createSuperAdmin();
     SecurityTestHelper::createUsers();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     ContactsModule::loadStartingData();
     SecurityTestHelper::createSuperAdmin();
     $sally = UserTestHelper::createBasicUser('sally');
     $sally->setRight('AccountsModule', AccountsModule::RIGHT_ACCESS_ACCOUNTS);
     $sally->setRight('ContactsModule', ContactsModule::RIGHT_ACCESS_CONTACTS);
     $sally->setRight('MeetingsModule', MeetingsModule::RIGHT_ACCESS_MEETINGS);
     $sally->setRight('OpportunitiesModule', OpportunitiesModule::RIGHT_ACCESS_OPPORTUNITIES);
     $sally->setRight('ReportsTestModule', ReportsTestModule::RIGHT_ACCESS_REPORTS_TESTS);
     if (!$sally->save()) {
         throw new FailedToSaveModelException();
     }
     $sarah = UserTestHelper::createBasicUser('sarah');
     $sarah->setRight('AccountsModule', AccountsModule::RIGHT_ACCESS_ACCOUNTS);
     $sarah->setRight('LeadsModule', LeadsModule::RIGHT_ACCESS_LEADS);
     $sarah->setRight('MeetingsModule', MeetingsModule::RIGHT_ACCESS_MEETINGS);
     $sarah->setRight('OpportunitiesModule', OpportunitiesModule::RIGHT_ACCESS_OPPORTUNITIES);
     $sarah->setRight('ReportsTestModule', ReportsTestModule::RIGHT_ACCESS_REPORTS_TESTS);
     if (!$sarah->save()) {
         throw new FailedToSaveModelException();
     }
     $nobody = UserTestHelper::createBasicUser('nobody');
     if (!$nobody->save()) {
         throw new FailedToSaveModelException();
     }
 }
 public function setUp()
 {
     parent::setUp();
     Yii::app()->user->userModel = User::getByUsername('super');
     DisplayAttributeForReportForm::resetCount();
     DrillDownDisplayAttributeForReportForm::resetCount();
 }
Exemplo n.º 20
0
 public function setUp()
 {
     parent::setUp();
     $this->user = User::getByUsername('super');
     Yii::app()->user->userModel = $this->user;
     $this->purgeAllCampaigns();
 }
Exemplo n.º 21
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
     $super = SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = User::getByUsername('super');
     $headquarters = AccountTestHelper::createAccountByNameForOwner('Headquarters', $super);
     $division1 = AccountTestHelper::createAccountByNameForOwner('Division1', $super);
     $division2 = AccountTestHelper::createAccountByNameForOwner('Division2', $super);
     $ceo = ContactTestHelper::createContactWithAccountByNameForOwner('ceo', $super, $headquarters);
     $div1President = ContactTestHelper::createContactWithAccountByNameForOwner('div1 President', $super, $division1);
     $div2President = ContactTestHelper::createContactWithAccountByNameForOwner('div2 President', $super, $division2);
     $opportunity = OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('big opp', $super, $headquarters);
     $opportunityDiv1 = OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('div1 small opp', $super, $division1);
     $opportunityDiv2 = OpportunityTestHelper::createOpportunityWithAccountByNameForOwner('div2 small opp', $super, $division2);
     //attach divisions to headquarters
     $headquarters->accounts->add($division1);
     $headquarters->accounts->add($division2);
     assert($headquarters->save());
     // Not Coding Standard
     //attach opportunities to contacts
     $opportunity->contacts->add($ceo);
     assert($opportunity->save());
     // Not Coding Standard
     //Forget models to ensure relations are known on the next retrieval
     $headquarters->forget();
     $division1->forget();
     $division2->forget();
     $ceo->forget();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
 }
Exemplo n.º 23
0
 public static function tearDownAfterClass()
 {
     $contents = file_get_contents(INSTANCE_ROOT . '/protected/config/perInstanceTest.php');
     $contents = preg_replace('/\\$maintenanceMode\\s*=\\s*true;/', '$maintenanceMode = false;', $contents);
     file_put_contents(INSTANCE_ROOT . '/protected/config/perInstanceTest.php', $contents);
     parent::tearDownAfterClass();
 }
Exemplo n.º 24
0
 public function setUp()
 {
     EmailMessageTestHelper::purgeAllMessages();
     parent::setUp();
     $this->user = User::getByUsername('super');
     Yii::app()->user->userModel = $this->user;
 }
 public function setup()
 {
     parent::setUp();
     Yii::app()->user->userModel = User::getByUsername('super');
     Yii::app()->user->userModel->timeZone = 'America/Chicago';
     DisplayAttributeForReportForm::resetCount();
 }
 public static function tearDownAfterClass()
 {
     $contents = file_get_contents(static::$perInstanceTestFilePath);
     $contents = preg_replace('/\\$maintenanceMode\\s*=\\s*true;/', '$maintenanceMode = false;', $contents);
     file_put_contents(static::$perInstanceTestFilePath, $contents);
     parent::tearDownAfterClass();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     $loaded = ContactsModule::loadStartingData();
 }
Exemplo n.º 28
0
 public function setUp()
 {
     parent::setUp();
     Yii::app()->user->userModel = User::getByUsername('super');
     $file = ZurmoTestHelper::createImageFileModel();
     $this->imageFile1Id = $file->id;
     $file->forget();
 }
Exemplo n.º 29
0
 public static function tearDownAfterClass()
 {
     ZurmoRedBean::$writer->dropTableByTableName('testimporttable');
     ZurmoRedBean::$writer->dropTableByTableName('testimporttable2');
     ZurmoRedBean::$writer->dropTableByTableName('testimporttable3');
     ZurmoRedBean::$writer->dropTableByTableName('testimporttable4');
     parent::tearDownAfterClass();
 }
 public function setup()
 {
     parent::setUp();
     Yii::app()->user->userModel = User::getByUsername('super');
     ModelRelationsAndAttributesToSummableReportAdapter::forgetAll();
     ModelRelationsAndAttributesToRowsAndColumnsReportAdapter::forgetAll();
     ModelRelationsAndAttributesToMatrixReportAdapter::forgetAll();
 }