本文整理汇总了PHP中Mage_Newsletter_Model_Queue::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Newsletter_Model_Queue::load方法的具体用法?PHP Mage_Newsletter_Model_Queue::load怎么用?PHP Mage_Newsletter_Model_Queue::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Newsletter_Model_Queue
的用法示例。
在下文中一共展示了Mage_Newsletter_Model_Queue::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSendPerSubscriberProblem
/**
* @magentoDataFixture Mage/Newsletter/_files/queue.php
* @magentoAppIsolation enabled
*/
public function testSendPerSubscriberProblem()
{
$mail = $this->getMock('Zend_Mail', array('send'), array('utf-8'));
$brokenMail = $this->getMock('Zend_Mail', array('send'), array('utf-8'));
$errorMsg = md5(microtime());
$brokenMail->expects($this->any())->method('send')->will($this->throwException(new Exception($errorMsg, 99)));
$template = $this->getMock('Mage_Core_Model_Email_Template', array('_getMail'));
$template->expects($this->any())->method('_getMail')->will($this->onConsecutiveCalls($mail, $brokenMail));
$queue = new Mage_Newsletter_Model_Queue(array('email_template' => $template));
$queue->load('Subject', 'newsletter_subject');
// fixture
$problem = new Mage_Newsletter_Model_Problem();
$problem->load($queue->getId(), 'queue_id');
$this->assertEmpty($problem->getId());
$queue->sendPerSubscriber();
$problem->load($queue->getId(), 'queue_id');
$this->assertNotEmpty($problem->getId());
$this->assertEquals(99, $problem->getProblemErrorCode());
$this->assertEquals($errorMsg, $problem->getProblemErrorText());
}