コード例 #1
0
 /**
  * @depends testCreateAndGetAutoresponderById
  */
 public function testHtmlContentGetsSavedCorrectly()
 {
     $randomData = ZurmoRandomDataUtil::getRandomDataByModuleAndModelClassNames('EmailTemplatesModule', 'EmailTemplate');
     $htmlContent = $randomData['htmlContent'][count($randomData['htmlContent']) - 1];
     $autoresponder = new Autoresponder();
     $autoresponder->subject = 'Another Test subject';
     $autoresponder->textContent = 'Text Content';
     $autoresponder->htmlContent = $htmlContent;
     $autoresponder->fromOperationDurationInterval = '1';
     $autoresponder->fromOperationDurationType = TimeDurationUtil::DURATION_TYPE_MONTH;
     $autoresponder->operationType = Autoresponder::OPERATION_UNSUBSCRIBE;
     $autoresponder->enableTracking = 1;
     $this->assertTrue($autoresponder->save());
     $autoresponderId = $autoresponder->id;
     $autoresponder->forgetAll();
     $autoresponder = Autoresponder::getById($autoresponderId);
     $this->assertEquals($htmlContent, $autoresponder->htmlContent);
     $this->assertEquals(4, Autoresponder::getCount());
 }