/** * @see BaseJob::run() */ public function run() { // we need either this or need to call forget() on each campaign we are processing inside tests Campaign::forgetAll(); $util = new CampaignItemsUtil(); return $util->generateCampaignItemsForDueCampaigns(); }
/** * @depends testCreateAndGetCampaignListById */ public function testHtmlContentGetsSavedCorrectly() { $randomData = ZurmoRandomDataUtil::getRandomDataByModuleAndModelClassNames('EmailTemplatesModule', 'EmailTemplate'); $htmlContent = $randomData['htmlContent'][count($randomData['htmlContent']) - 1]; $campaign = new Campaign(); $campaign->name = 'Another Test Campaign Name'; $campaign->supportsRichText = 0; $campaign->status = Campaign::STATUS_ACTIVE; $campaign->fromName = 'Another From Name'; $campaign->fromAddress = '*****@*****.**'; $campaign->fromName = 'From Name2'; $campaign->fromAddress = '*****@*****.**'; $campaign->subject = 'Another Test subject'; $campaign->textContent = 'Text Content'; $campaign->htmlContent = $htmlContent; $campaign->marketingList = self::$marketingList; $this->assertTrue($campaign->save()); $campaignId = $campaign->id; $campaign->forgetAll(); $campaign = Campaign::getById($campaignId); $this->assertEquals($htmlContent, $campaign->htmlContent); }