本文整理汇总了PHP中MarketingList::getByName方法的典型用法代码示例。如果您正苦于以下问题:PHP MarketingList::getByName方法的具体用法?PHP MarketingList::getByName怎么用?PHP MarketingList::getByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarketingList
的用法示例。
在下文中一共展示了MarketingList::getByName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSuperUserEditAction
/**
* @depends testSuperUserCreateAction
*/
public function testSuperUserEditAction()
{
$marketingListId = self::getModelIdByModelNameAndName('MarketingList', 'New MarketingListName using Create');
$this->setGetArray(array('id' => $marketingListId));
$content = $this->runControllerWithNoExceptionsAndGetContent('marketingLists/default/edit');
$this->assertContains('New MarketingListName using Create', $content);
$this->assertEquals(2, substr_count($content, 'New MarketingListName using Create'));
$this->assertContains('New MarketingList Description using Create', $content);
$this->assertContains('Zurmo Sales', $content);
$this->assertContains('sales@zurmo.com', $content);
$this->assertNotContains('Create Marketing List', $content);
$this->setPostArray(array('MarketingList' => array('name' => 'New MarketingListName', 'description' => 'New MarketingList Description', 'fromName' => 'Zurmo Support', 'fromAddress' => 'support@zurmo.com')));
$redirectUrl = $this->runControllerWithRedirectExceptionAndGetUrl('marketingLists/default/edit');
$marketingList = MarketingList::getByName('New MarketingListName');
$this->assertEquals(1, count($marketingList));
$this->assertTrue($marketingList[0]->id > 0);
$this->assertEquals('support@zurmo.com', $marketingList[0]->fromAddress);
$this->assertEquals('Zurmo Support', $marketingList[0]->fromName);
$this->assertEquals('New MarketingList Description', $marketingList[0]->description);
$compareRedirectUrl = Yii::app()->createUrl('marketingLists/default/details', array('id' => $marketingList[0]->id));
$this->assertEquals($compareRedirectUrl, $redirectUrl);
$marketingList = MarketingList::getAll();
$this->assertEquals(3, count($marketingList));
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:27,代码来源:MarketingListDefaultControllerSuperUserWalkthroughTest.php
示例2: testCountMembers
public function testCountMembers()
{
$marketingLists = MarketingList::getByName('MarketingList1');
$marketingListId = $marketingLists[0]->id;
$subscriberCount = 3;
$unsubscriberCount = 2;
$this->setGetArray(array('marketingListId' => $marketingListId));
$content = $this->runControllerWithNoExceptionsAndGetContent('marketingLists/defaultPortlet/countMembers');
$countArray = CJSON::decode($content);
$this->assertNotEmpty($countArray);
$this->assertArrayHasKey('subscriberCount', $countArray);
$this->assertArrayHasKey('unsubscriberCount', $countArray);
$this->assertEquals($subscriberCount, $countArray['subscriberCount']);
$this->assertEquals($unsubscriberCount, $countArray['unsubscriberCount']);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:15,代码来源:MarketingListDefaultPortletControllerSuperUserWalkthroughTest.php
示例3: testGetLabel
/**
* @depends testCreateAndGetMarketingListById
*/
public function testGetLabel()
{
$marketingLists = MarketingList::getByName('Test Marketing List');
$this->assertEquals(1, count($marketingLists));
$this->assertEquals('Marketing List', $marketingLists[0]::getModelLabelByTypeAndLanguage('Singular'));
$this->assertEquals('Marketing Lists', $marketingLists[0]::getModelLabelByTypeAndLanguage('Plural'));
}
示例4: testGetByProcessedAndAutoresponderIdAndTime
/**
* @depends testGetByProcessedAndAutoresponderId
*/
public function testGetByProcessedAndAutoresponderIdAndTime()
{
$intervals = array('hour', 'day');
$marketingList = MarketingList::getByName('marketingList 01');
$this->assertNotEmpty($marketingList);
$autoresponder3 = AutoresponderTestHelper::createAutoresponder('autoresponder 03', 'subject 03', 'text 03', 'html 03', 10, Autoresponder::OPERATION_UNSUBSCRIBE, $marketingList[0]);
$this->assertNotNull($autoresponder3);
$autoresponder4 = AutoresponderTestHelper::createAutoresponder('autoresponder 04', 'subject 04', 'text 04', 'html 04', 20, Autoresponder::OPERATION_SUBSCRIBE, $marketingList[0]);
$this->assertNotNull($autoresponder4);
for ($i = 0; $i < 10; $i++) {
if ($i % 3) {
$pastOrFuture = "-";
$processed = AutoresponderItem::PROCESSED;
} else {
$pastOrFuture = "+";
$processed = AutoresponderItem::NOT_PROCESSED;
}
if ($i % 2) {
$autoresponder = $autoresponder3;
$interval = $intervals[1];
} else {
$autoresponder = $autoresponder4;
$interval = $intervals[0];
}
$timestamp = strtotime($pastOrFuture . ($i + 1) . ' ' . $interval);
$time = DateTimeUtil::convertTimestampToDbFormatDateTime($timestamp);
$autoresponderItem = AutoresponderItemTestHelper::createAutoresponderItem($processed, $time, $autoresponder);
$this->assertNotNull($autoresponderItem);
}
$autoresponderItems = AutoresponderItem::getAll();
$this->assertCount(37, $autoresponderItems);
$autoresponder3ProcessedBeforeNow = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::PROCESSED, $autoresponder3->id);
$this->assertNotEmpty($autoresponder3ProcessedBeforeNow);
$this->assertCount(3, $autoresponder3ProcessedBeforeNow);
$autoresponder3ProcessedFiveDaysAgo = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::PROCESSED, $autoresponder3->id, strtotime("-5 day"));
$this->assertNotEmpty($autoresponder3ProcessedFiveDaysAgo);
$this->assertCount(2, $autoresponder3ProcessedFiveDaysAgo);
$autoresponder3NotProcessedBeforeNow = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::NOT_PROCESSED, $autoresponder3->id);
$this->assertEmpty($autoresponder3NotProcessedBeforeNow);
$autoresponder3NotProcessedFiveDaysFromNow = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::NOT_PROCESSED, $autoresponder3->id, strtotime("+5 day"));
$this->assertNotEmpty($autoresponder3NotProcessedFiveDaysFromNow);
$this->assertCount(1, $autoresponder3NotProcessedFiveDaysFromNow);
$autoresponder4ProcessedBeforeNow = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::PROCESSED, $autoresponder4->id);
$this->assertNotEmpty($autoresponder4ProcessedBeforeNow);
$this->assertCount(3, $autoresponder4ProcessedBeforeNow);
$autoresponder4ProcessedFiveDaysAgo = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::PROCESSED, $autoresponder4->id, strtotime("-5 day"));
$this->assertEmpty($autoresponder4ProcessedFiveDaysAgo);
$autoresponder4NotProcessedBeforeNow = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::NOT_PROCESSED, $autoresponder4->id);
$this->assertEmpty($autoresponder4NotProcessedBeforeNow);
$autoresponder4NotProcessedFiveDaysFromNow = AutoresponderItem::getByProcessedAndAutoresponderIdWithProcessDateTime(AutoresponderItem::NOT_PROCESSED, $autoresponder4->id, strtotime("+5 day"));
$this->assertNotEmpty($autoresponder4NotProcessedFiveDaysFromNow);
$this->assertCount(2, $autoresponder4NotProcessedFiveDaysFromNow);
}
示例5: testSubscribeActionAfterOptOutActionDisableOptOut
/**
* @depends testOptOutAction
*/
public function testSubscribeActionAfterOptOutActionDisableOptOut()
{
$this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
$marketingList = MarketingList::getByName('marketingList 04');
$this->assertNotEmpty($marketingList);
$marketingList = $marketingList[0];
$marketingListId = $marketingList->id;
$contact = Contact::getByName('contact 05 contact 05son');
$this->assertNotEmpty($contact);
$contact = $contact[0];
$this->assertEquals(1, $contact->primaryEmail->optOut);
$personId = $contact->getClassId('Person');
$member = MarketingListMember::getByMarketingListIdContactIdAndSubscribed($marketingList->id, $contact->id, 1);
$this->assertNotEmpty($member);
Yii::app()->user->userModel = null;
$hash = EmailMessageActivityUtil::resolveHashForUnsubscribeAndManageSubscriptionsUrls($personId, $marketingListId, 1, 'AutoresponderItem', false);
$this->setGetArray(array('hash' => $hash));
@$this->runControllerWithRedirectExceptionAndGetUrl($this->subscribeUrl);
$content = $this->runControllerWithNoExceptionsAndGetContent($this->manageSubscriptionsUrl);
$this->assertTrue(strpos($content, '<td>marketingList 01</td>') !== false);
$this->assertTrue(strpos($content, '<td>marketingList 03</td>') !== false);
$this->assertTrue(strpos($content, 'marketingLists/external/subscribe?hash=') !== false);
$this->assertTrue(strpos($content, 'id="marketingListsManage' . 'SubscriptionListView-toggleUnsubscribed_') !== false);
$this->assertTrue(strpos($content, 'id="marketingListsManage' . 'SubscriptionListView-toggleUnsubscribed_') !== false);
$this->assertTrue(strpos($content, 'type="radio" name="marketingListsManage' . 'SubscriptionListView-toggleUnsubscribed_') !== false);
$this->assertTrue(strpos($content, 'id="marketingListsManageSubscriptionListView-toggleUnsubscribed_' . $marketingListId . '_0" checked="checked" type="radio" name="marketingListsManage' . 'SubscriptionListView-toggleUnsubscribed_' . $marketingListId) !== false);
$this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
$contact = Contact::getByName('contact 05 contact 05son');
$this->assertNotEmpty($contact);
$contact = $contact[0];
$this->assertEquals(0, $contact->primaryEmail->optOut);
}