public static function setUpBeforeClass() { parent::setUpBeforeClass(); SecurityTestHelper::createSuperAdmin(); $super = User::getByUsername('super'); Yii::app()->user->userModel = $super; UserTestHelper::createBasicUser('jim'); AllPermissionsOptimizationUtil::rebuild(); OpportunityTestHelper::createOpportunityStagesIfDoesNotExist(); OpportunityTestHelper::createOpportunitySourcesIfDoesNotExist(); $currencies = Currency::getAll(); //Make opportunities for testing chart data. $currencyValue = new CurrencyValue(); $currencyValue->value = 200; $currencyValue->currency = $currencies[0]; $opportunity = new Opportunity(); $opportunity->owner = $super; $opportunity->name = 'abc1'; $opportunity->amount = $currencyValue; $opportunity->closeDate = '2011-01-01'; $opportunity->stage->value = 'Negotiating'; $opportunity->source->value = 'Outbound'; assert($opportunity->save()); // Not Coding Standard $currencyValue = new CurrencyValue(); $currencyValue->value = 350; $currencyValue->currency = $currencies[0]; $opportunity = new Opportunity(); $opportunity->owner = $super; $opportunity->name = 'abc2'; $opportunity->amount = $currencyValue; $opportunity->closeDate = '2011-01-01'; $opportunity->stage->value = 'Negotiating'; $opportunity->source->value = 'Trade Show'; assert($opportunity->save()); // Not Coding Standard $currencyValue = new CurrencyValue(); $currencyValue->value = 100; $currencyValue->currency = $currencies[0]; $opportunity = new Opportunity(); $opportunity->owner = $super; $opportunity->name = 'abc2'; $opportunity->amount = $currencyValue; $opportunity->closeDate = '2011-01-01'; $opportunity->stage->value = 'Verbal'; $opportunity->source->value = 'Trade Show'; assert($opportunity->save()); // Not Coding Standard }