本文整理汇总了PHP中ZurmoBaseTest::setUpBeforeClass方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoBaseTest::setUpBeforeClass方法的具体用法?PHP ZurmoBaseTest::setUpBeforeClass怎么用?PHP ZurmoBaseTest::setUpBeforeClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoBaseTest
的用法示例。
在下文中一共展示了ZurmoBaseTest::setUpBeforeClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
UserTestHelper::createBasicUser('billy');
UserTestHelper::createBasicUser('sally');
}
示例2: setUpBeforeClass
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
}
}
示例3: setUpBeforeClass
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();
}
}
示例4: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
UserTestHelper::createBasicUser('normal');
$emailBox = EmailBoxUtil::getDefaultEmailBoxByUser(User::getByUsername('super'));
}
示例5: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
}
示例6: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
SecurityTestHelper::createGroups();
SecurityTestHelper::createRoles();
RedBeanModel::forgetAll();
//do the rebuild to ensure the tables get created properly.
ReadPermissionsOptimizationUtil::rebuild();
//Manually build the test model munge tables.
ReadPermissionsOptimizationUtil::recreateTable(ReadPermissionsOptimizationUtil::getMungeTableName('OwnedSecurableTestItem'));
ReadPermissionsOptimizationUtil::recreateTable(ReadPermissionsOptimizationUtil::getMungeTableName('OwnedSecurableTestItem2'));
$benny = User::getByUsername('benny');
$model = new OwnedSecurableTestItem();
$model->member = 'test';
assert($model->save());
// Not Coding Standard
$model = new OwnedSecurableTestItem();
$model->member = 'test2';
assert($model->save());
// Not Coding Standard
$model = new OwnedSecurableTestItem();
$model->member = 'test3';
$model->owner = $benny;
assert($model->save());
// Not Coding Standard
assert(OwnedSecurableTestItem::getCount() == 3);
// Not Coding Standard
$model = new OwnedSecurableTestItem2();
$model->member = 'test5';
assert($model->save());
// Not Coding Standard
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:35,代码来源:OwnedSecurableItemReadPermissionOptimizationTest.php
示例7: setUpBeforeClass
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
}
示例8: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
SavedReportTestHelper::makeSummationWithDrillDownReport();
SavedReportTestHelper::makeSimpleContactRowsAndColumnsReport();
}
示例9: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
$user1 = new User();
$user1->username = 'user1';
$user1->firstName = 'abel';
$user1->lastName = 'zitabina';
$user1->setPassword('myuser');
$user1->save();
$user2 = new User();
$user2->username = 'user2';
$user2->firstName = 'zitabina';
$user2->lastName = 'abel';
$user2->setPassword('myuser');
$user2->save();
$user3 = new User();
$user3->username = 'user3';
$user3->firstName = 'abel';
$user3->lastName = 'abel';
$user3->setPassword('myuser');
$user3->save();
}
示例10: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
AllPermissionsOptimizationUtil::rebuild();
$everyoneGroup = Group::getByName(Group::EVERYONE_GROUP_NAME);
$everyoneGroup->save();
$super = User::getByUsername('super');
//Steven have access to missions module
$steven = UserTestHelper::createBasicUser('steven');
$steven->setRight('MissionsModule', MissionsModule::RIGHT_ACCESS_MISSIONS);
$steven->save();
//Jack dont have acess to missions module
$jack = UserTestHelper::createBasicUser('jack');
$mission = new Mission();
$mission->owner = $super;
$mission->takenByUser = $steven;
$mission->description = 'My test description';
$mission->reward = 'My test reward';
$mission->status = Mission::STATUS_AVAILABLE;
$mission->addPermissions($everyoneGroup, Permission::READ_WRITE);
assert($mission->save());
// Not Coding Standard
AllPermissionsOptimizationUtil::securableItemGivenPermissionsForGroup($mission, $everyoneGroup);
}
示例11: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$billy = UserTestHelper::createBasicUser('billy');
EmailBox::resolveAndGetByName(EmailBox::NOTIFICATIONS_NAME);
}
示例12: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
AllPermissionsOptimizationUtil::rebuild();
$box = EmailBox::resolveAndGetByName(EmailBox::NOTIFICATIONS_NAME);
}
示例13: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
SecurityTestHelper::createUsers();
self::$marketingList = MarketingListTestHelper::createMarketingListByName('a new list');
}
示例14: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$super = SecurityTestHelper::createSuperAdmin();
Yii::app()->user->userModel = $super;
AccountTestHelper::createAccountByNameForOwner('anAccount', $super);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:7,代码来源:TaskStatusDropDownRedBeanModelAttributeValueToExportValueAdapterTest.php
示例15: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
SecurityTestHelper::createSuperAdmin();
$user = UserTestHelper::createBasicUser('steve');
$user->primaryEmail->emailAddress = 'steve@example.com';
$user->setRight('ContactsModule', ContactsModule::RIGHT_ACCESS_CONTACTS);
assert($user->save());
// Not Coding Standard
$contact1 = ContactTestHelper::createContactByNameForOwner('peter', $user);
$contact1->primaryEmail->emailAddress = 'peter@example.com';
$contact1->secondaryEmail->emailAddress = 'peter2@example.com';
assert($contact1->save());
// Not Coding Standard
$contactsOrLeads = ContactSearch::getContactsByAnyEmailAddress('peter@example.com', null, null);
$contact2 = ContactTestHelper::createContactByNameForOwner('jim', $user);
$contact2->primaryEmail->emailAddress = 'jim@example.com';
assert($contact2->save());
// Not Coding Standard
$nonExistingUserEmail = 'jill@example.com';
self::$user = $user;
self::$contact1 = $contact1;
self::$contact2 = $contact2;
self::$nonExistingUserEmail = $nonExistingUserEmail;
Yii::app()->imap->imapUsername = 'dropbox@example.com';
}