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


PHP Mage_Payment_Model_Info::setMethodInstance方法代码示例

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


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

示例1: setUp

 protected function setUp()
 {
     $this->_method = new Varien_Object();
     $this->_info = new Mage_Payment_Model_Info();
     $this->_instructions = new Mage_Payment_Block_Info_Instructions();
     $this->_info->setMethodInstance($this->_method);
     $this->_instructions->setInfo($this->_info);
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:InstructionsTest.php

示例2: testSetInfoTemplate

 public function testSetInfoTemplate()
 {
     $block = $this->getMock('Mage_Payment_Block_Info_ContainerAbstract', array('getChildBlock', 'getPaymentInfo'));
     $paymentInfo = new Mage_Payment_Model_Info();
     $methodInstance = new Mage_Payment_Model_Method_Checkmo();
     $paymentInfo->setMethodInstance($methodInstance);
     $block->expects($this->atLeastOnce())->method('getPaymentInfo')->will($this->returnValue($paymentInfo));
     $childBlock = new Mage_Core_Block_Template();
     $block->expects($this->atLeastOnce())->method('getChildBlock')->with('payment.info.checkmo')->will($this->returnValue($childBlock));
     $template = 'any_template.phtml';
     $this->assertNotEquals($template, $childBlock->getTemplate());
     $block->setInfoTemplate('checkmo', $template);
     $this->assertEquals($template, $childBlock->getTemplate());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:14,代码来源:ContainerAbstractTest.php

示例3: testGetChildPdfAsArray

 /**
  * @magentoConfigFixture current_store payment/banktransfer/title Bank Method Title
  * @magentoConfigFixture current_store payment/checkmo/title Checkmo Title Of The Method
  */
 public function testGetChildPdfAsArray()
 {
     $block = new Mage_Payment_Block_Info();
     $layout = new Mage_Core_Model_Layout();
     $layout->addBlock($block, 'block');
     $paymentInfoBank = new Mage_Payment_Model_Info();
     $paymentInfoBank->setMethodInstance(new Mage_Payment_Model_Method_Banktransfer());
     $childBank = $layout->addBlock('Mage_Payment_Block_Info_Instructions', 'child.one', 'block');
     $childBank->setInfo($paymentInfoBank)->setArea('adminhtml');
     $nonExpectedHtml = 'non-expected html';
     $childHtml = $layout->addBlock('Mage_Core_Block_Text', 'child.html', 'block');
     $childHtml->setText($nonExpectedHtml);
     $paymentInfoCheckmo = new Mage_Payment_Model_Info();
     $paymentInfoCheckmo->setMethodInstance(new Mage_Payment_Model_Method_Checkmo());
     $childCheckmo = $layout->addBlock('Mage_Payment_Block_Info_Checkmo', 'child.just.another', 'block');
     $childCheckmo->setInfo($paymentInfoCheckmo)->setArea('adminhtml');
     $pdfArray = $block->getChildPdfAsArray();
     $this->assertInternalType('array', $pdfArray);
     $this->assertCount(2, $pdfArray);
     $text = implode('', $pdfArray);
     $this->assertContains('Bank Method Title', $text);
     $this->assertContains('Checkmo Title Of The Method', $text);
     $this->assertNotContains($nonExpectedHtml, $text);
 }
开发者ID:nemphys,项目名称:magento2,代码行数:28,代码来源:InfoTest.php


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