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 }