public function testGetStatusDropDownArray() { $statusDropDownArray = Campaign::getStatusDropDownArray(); $this->assertNotEmpty($statusDropDownArray); $this->assertEquals('Paused', $statusDropDownArray[1]); $this->assertEquals('Active', $statusDropDownArray[2]); $this->assertEquals('Processing', $statusDropDownArray[3]); $this->assertEquals('Completed', $statusDropDownArray[4]); }
public function populateModel(&$model) { assert('$model instanceof Campaign'); parent::populateModel($model); if (empty($this->seedData)) { $this->seedData = ZurmoRandomDataUtil::getRandomDataByModuleAndModelClassNames('CampaignsModule', 'Campaign'); } $statusKeys = array_keys(Campaign::getStatusDropDownArray()); $timestamp = time(); $model->name = $this->seedData['name'][$this->index]; $model->subject = $this->seedData['subject'][$this->index]; $model->status = RandomDataUtil::getRandomValueFromArray($statusKeys); if (!(rand() % 2)) { $timestamp += rand(500, 5000); } $model->sendOnDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime($timestamp); $model->supportsRichText = rand() % 2; $model->htmlContent = $this->seedData['htmlContent'][$this->index]; $model->textContent = $this->seedData['textContent'][$this->index]; $model->fromName = $this->seedData['fromName'][$this->index]; $model->fromAddress = $this->seedData['fromAddress'][$this->index]; $model->enableTracking = rand() % 2; $this->populateMarketingModelWithFiles($model); }
protected function getDropDownArray() { return Campaign::getStatusDropDownArray(); }
public function getDropDownArray() { return Campaign::getStatusDropDownArray(); }