public static function setUpBeforeClass() { parent::setUpBeforeClass(); SecurityTestHelper::createSuperAdmin(); $super = User::getByUsername('super'); Yii::app()->user->userModel = $super; //Setup test data owned by the super user. $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super); AccountTestHelper::createAccountByNameForOwner('superAccount2', $super); ContactTestHelper::createContactWithAccountByNameForOwner('superContact', $super, $account); ContactTestHelper::createContactWithAccountByNameForOwner('superContact2', $super, $account); ContractTestHelper::createContractStagesIfDoesNotExist(); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp2', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp3', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp4', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp5', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp6', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp7', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp8', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp9', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp10', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp11', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp12', $super, $account); //Setup default dashboard. Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super); }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); SecurityTestHelper::createSuperAdmin(); $super = User::getByUsername('super'); Yii::app()->user->userModel = $super; //Setup test data owned by the super user. $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super); AccountTestHelper::createAccountByNameForOwner('superAccount2', $super); ContractTestHelper::createContractStagesIfDoesNotExist(); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp', $super, $account); }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); SecurityTestHelper::createSuperAdmin(); $super = User::getByUsername('super'); Yii::app()->user->userModel = $super; UserTestHelper::createBasicUser('jim'); AllPermissionsOptimizationUtil::rebuild(); ContractTestHelper::createContractStagesIfDoesNotExist(); ContractTestHelper::createContractSourcesIfDoesNotExist(); $currencies = Currency::getAll(); //Make Contracts for testing chart data. $currencyValue = new CurrencyValue(); $currencyValue->value = 200; $currencyValue->currency = $currencies[0]; $contract = new Contract(); $contract->owner = $super; $contract->name = 'abc1'; $contract->amount = $currencyValue; $contract->closeDate = '2011-01-01'; $contract->stage->value = 'Negotiating'; $contract->source->value = 'Outbound'; assert($contract->save()); // Not Coding Standard $currencyValue = new CurrencyValue(); $currencyValue->value = 350; $currencyValue->currency = $currencies[0]; $contract = new Contract(); $contract->owner = $super; $contract->name = 'abc2'; $contract->amount = $currencyValue; $contract->closeDate = '2011-01-01'; $contract->stage->value = 'Negotiating'; $contract->source->value = 'Trade Show'; assert($contract->save()); // Not Coding Standard $currencyValue = new CurrencyValue(); $currencyValue->value = 100; $currencyValue->currency = $currencies[0]; $contract = new Contract(); $contract->owner = $super; $contract->name = 'abc2'; $contract->amount = $currencyValue; $contract->closeDate = '2011-01-01'; $contract->stage->value = 'Verbal'; $contract->source->value = 'Trade Show'; assert($contract->save()); // Not Coding Standard }
public static function setUpBeforeClass() { parent::setUpBeforeClass(); $super = Yii::app()->user->userModel; //Setup test data owned by the super user. $account = AccountTestHelper::createAccountByNameForOwner('superAccount', $super); AccountTestHelper::createAccountByNameForOwner('superAccount2', $super); ContactTestHelper::createContactWithAccountByNameForOwner('superContact', $super, $account); ContactTestHelper::createContactWithAccountByNameForOwner('superContact2', $super, $account); ContractTestHelper::createContractStagesIfDoesNotExist(); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp2', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp3', $super, $account); ContractTestHelper::createContractWithAccountByNameForOwner('superOpp4', $super, $account); //Setup default dashboard. Dashboard::getByLayoutIdAndUser(Dashboard::DEFAULT_USER_LAYOUT_ID, $super); AllPermissionsOptimizationUtil::rebuild(); }