本文整理汇总了PHP中MarketingList::deleteAll方法的典型用法代码示例。如果您正苦于以下问题:PHP MarketingList::deleteAll方法的具体用法?PHP MarketingList::deleteAll怎么用?PHP MarketingList::deleteAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarketingList
的用法示例。
在下文中一共展示了MarketingList::deleteAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->user = User::getByUsername('super');
Yii::app()->user->userModel = $this->user;
Campaign::deleteAll();
CampaignItem::deleteAll();
Contact::deleteAll();
MarketingList::deleteAll();
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:CampaignQueueMessagesInOutboxJobBenchmarkTest.php
示例2: testRunWithCampaignPausedAfterAllItemsGeneratedAndThenUnpaused
public function testRunWithCampaignPausedAfterAllItemsGeneratedAndThenUnpaused()
{
// Cleanup
Campaign::deleteAll();
$this->assertEquals(0, Campaign::getCount());
$this->assertEquals(0, CampaignItem::getCount());
$this->assertEquals(0, CampaignItemActivity::getCount());
MarketingList::deleteAll();
$this->assertEquals(0, MarketingList::getCount());
$this->assertEquals(0, MarketingListMember::getCount());
EmailMessage::deleteAll();
$this->assertEquals(0, EmailMessage::getCount());
$this->assertEquals(0, EmailMessageContent::getCount());
$this->assertEquals(0, EmailMessageSender::getCount());
$this->assertEquals(0, EmailMessageRecipient::getCount());
Contact::deleteAll();
$this->assertEquals(0, Contact::getCount());
// setup an email address for contacts
$email = new Email();
$email->emailAddress = 'demo@zurmo.com';
// create a marketing list with 5 members
$marketingList = MarketingListTestHelper::createMarketingListByName('marketingList 05');
$marketingListId = $marketingList->id;
for ($i = 1; $i <= 5; $i++) {
$contact = ContactTestHelper::createContactByNameForOwner('campaignContact 0' . $i, $this->user);
$contact->primaryEmail = $email;
$this->assertTrue($contact->save());
MarketingListMemberTestHelper::createMarketingListMember(0, $marketingList, $contact);
}
$marketingList->forgetAll();
// create a due campaign with that marketing list
$campaign = CampaignTestHelper::createCampaign('campaign 04', 'subject', 'text Content', 'Html Content', null, null, null, null, null, null, MarketingList::getById($marketingListId));
$campaignId = $campaign->id;
/*
* Run 1:
* CampaignGenerateDueCampaignItemsJob
* status == processing
* items generated but unprocessed
*
* CampaignQueueMessagesInOutboxJob
* status == processing
* items processed with email messages generated and queued
*
* ProcessOutboundEmailJob
* status == processing
* email items attempted to be sent
*
* Run 2:
* Pause the campaign
* items are processed and still present
*
* Unpause the campaign
* status == active
* items are processed and still present
*
* CampaignGenerateDueCampaignItemsJob
* status == processing
* ensure all items are present and processed
*
* CampaignQueueMessagesInOutboxJob
* status == processing
* ensure all items are present and processed
* ensure all email messages are present with correct folder type
*
* ProcessOutboundEmailJob
* ensure all email messages are present with correct folder type
* status == processing
*
*
* Run 3:
* Mark Campaign as Completed
* status == completed
*/
// we have to do this to ensure when we retrieve the data status is updated from db.
$campaign->forgetAll();
$this->assertEmpty(CampaignItem::getAll());
// Run 1 starts here
// Run CampaignGenerateDueCampaignItemsJob
$job = new CampaignGenerateDueCampaignItemsJob();
$this->assertTrue($job->run());
$campaign = Campaign::getById($campaignId);
// ensure status is processing
$this->assertEquals(Campaign::STATUS_PROCESSING, $campaign->status);
// ensure 5 campaign items have been generated
$this->assertEquals(5, CampaignItem::getCount());
// ensure all 5 campaign items are unprocessed
$campaignItems = CampaignItem::getByProcessedAndCampaignId(0, $campaignId);
$this->assertNotEmpty($campaignItems);
$this->assertCount(5, $campaignItems);
// Run CampaignQueueMessagesInOutboxJob
$job = new CampaignQueueMessagesInOutboxJob();
$this->assertTrue($job->run());
// Ensure campaign status
$campaign = Campaign::getById($campaignId);
$this->assertEquals(Campaign::STATUS_PROCESSING, $campaign->status);
// ensure all 5 campaign items are processed
$campaignItems = CampaignItem::getByProcessedAndCampaignId(1, $campaignId);
$this->assertNotEmpty($campaignItems);
$this->assertCount(5, $campaignItems);
// Ensure 5 new email messages
//.........这里部分代码省略.........