当前位置: 首页>>代码示例>>PHP>>正文


PHP EmailTemplate::getCount方法代码示例

本文整理汇总了PHP中EmailTemplate::getCount方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::getCount方法的具体用法?PHP EmailTemplate::getCount怎么用?PHP EmailTemplate::getCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmailTemplate的用法示例。


在下文中一共展示了EmailTemplate::getCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDeleteAction

 /**
  * @depends testDetailsActionForMarketing
  * @depends testDetailsActionForWorkflow
  */
 public function testDeleteAction()
 {
     $initialCount = EmailTemplate::getCount();
     $emailTemplateId = self::getModelIdByModelNameAndName('EmailTemplate', 'marketing 01');
     // Delete an emailTemplate.
     $this->setGetArray(array('id' => $emailTemplateId));
     $this->resetPostArray();
     $redirectUrl = $this->runControllerWithRedirectExceptionAndGetUrl('emailTemplates/default/delete');
     $compareRedirectUrl = Yii::app()->createUrl('emailTemplates/default/listForMarketing');
     $this->assertEquals($compareRedirectUrl, $redirectUrl);
     $this->assertEquals($initialCount - 1, EmailTemplate::getCount());
     $emailTemplateId = self::getModelIdByModelNameAndName('EmailTemplate', 'workflow 01');
     $this->setGetArray(array('id' => $emailTemplateId));
     $this->resetPostArray();
     $redirectUrl = $this->runControllerWithRedirectExceptionAndGetUrl('emailTemplates/default/delete');
     $compareRedirectUrl = Yii::app()->createUrl('emailTemplates/default/listForWorkflow');
     $this->assertEquals($compareRedirectUrl, $redirectUrl);
     $this->assertEquals($initialCount - 2, EmailTemplate::getCount());
 }
开发者ID:spiogit,项目名称:cna-seed-project,代码行数:23,代码来源:EmailTemplatesSuperUserWalkthroughTest.php

示例2: testDummyHtmlContentThrowsValidationErrorWhenTextContentIsEmpty

 /**
  * @depends testCreateAndGetEmailTemplateById
  */
 public function testDummyHtmlContentThrowsValidationErrorWhenTextContentIsEmpty()
 {
     $emailTemplate = new EmailTemplate();
     $emailTemplate->type = EmailTemplate::TYPE_CONTACT;
     $emailTemplate->builtType = EmailTemplate::BUILT_TYPE_PASTED_HTML;
     $emailTemplate->subject = 'Another Test subject';
     $emailTemplate->name = 'Another Test Email Template';
     $emailTemplate->textContent = '';
     $emailTemplate->htmlContent = "<html>\n<head>\n</head>\n<body>\n</body>\n</html>";
     $emailTemplate->modelClassName = 'Contact';
     $validated = $emailTemplate->validate(null, false, true);
     $this->assertFalse($validated);
     $errorMessages = $emailTemplate->getErrors();
     $this->assertEquals(1, count($errorMessages));
     $this->assertTrue(array_key_exists('textContent', $errorMessages));
     $this->assertEquals(1, count($errorMessages['textContent']));
     $this->assertEquals('Please provide at least one of the contents field.', $errorMessages['textContent'][0]);
     $emailTemplate->textContent = 'Text Content';
     $validated = $emailTemplate->validate(null, false, true);
     $this->assertTrue($validated);
     $this->assertTrue($emailTemplate->save());
     $this->assertEquals(6, EmailTemplate::getCount());
     $id = $emailTemplate->id;
     unset($emailTemplate);
     $emailTemplate = EmailTemplate::getById($id);
     $this->assertEquals(EmailTemplate::TYPE_CONTACT, $emailTemplate->type);
     $this->assertEquals('Another Test subject', $emailTemplate->subject);
     $this->assertEquals('Another Test Email Template', $emailTemplate->name);
     $this->assertEquals(null, $emailTemplate->htmlContent);
     $this->assertEquals('Text Content', $emailTemplate->textContent);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:34,代码来源:EmailTemplateTest.php


注:本文中的EmailTemplate::getCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。