本文整理汇总了PHP中Varien_Event::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Event::setData方法的具体用法?PHP Varien_Event::setData怎么用?PHP Varien_Event::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Event
的用法示例。
在下文中一共展示了Varien_Event::setData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGoogleAnonymizationDisabled
/**
* @test
* @loadFixture testGoogleAnonymizationDisabled
*/
public function testGoogleAnonymizationDisabled()
{
$block = $this->app()->getLayout()->createBlock('googleanalytics/ga')->setTemplate('googleanalytics/ga.phtml');
$transport = new Varien_Object();
$transport->setHtml($block->toHtml());
$event = new Varien_Event();
$event->setData('block', $block);
$event->setData('transport', $transport);
$observer = new Varien_Event_Observer();
$observer->setEvent($event);
$this->_model->setGAAnonymizerCode($observer);
$this->assertNotContains('_anonymizeIp', $observer->getEvent()->getTransport()->getHtml());
}
示例2: setRowUrl
/**
* @test
* @loadFixture ~FireGento_AdminMonitoring/default
*/
public function setRowUrl()
{
$history = Mage::getModel('firegento_adminmonitoring/history')->load(8);
$transport = new Varien_Object();
$observer = new Varien_Event_Observer();
$event = new Varien_Event();
$event->setData('history', $history);
$event->setData('transport', $transport);
$observer->setEvent($event);
$observer->setData('history', $history);
$observer->setData('transport', $transport);
$this->_model->setRowUrl($observer);
$this->assertContains('sales_order/view/order_id/1/', $transport->getRowUrl());
}
示例3: buildObserver
/**
* Build correct observer structure
*
* @param $data array
*/
protected function buildObserver(array $data)
{
$observer = new Varien_Event_Observer();
$event = new Varien_Event();
$event->setData($data);
$data['event'] = $event;
$observer->setData($data);
return $observer;
}
示例4: testPaymentMethodIsActive
/**
* @test
* @loadFixture testPaymentMethodIsActive
*/
public function testPaymentMethodIsActive()
{
$model = Mage::getModel('debit/debit');
$checkResult = new StdClass();
$checkResult->isAvailable = true;
$observer = new Varien_Event_Observer();
$event = new Varien_Event();
$event->setData('method_instance', $model);
$event->setData('result', $checkResult);
$observer->setData('method_instance', $model);
$observer->setData('result', $checkResult);
$observer->setEvent($event);
$this->_model->paymentMethodIsActive($observer);
$this->assertTrue($observer->getEvent()->getResult()->isAvailable);
}