예제 #1
0
 public function testGetMethodInstanceRequestedMethod()
 {
     $code = 'real_method';
     $this->info->setData('method', $code);
     $this->paymentHelperMock->expects($this->once())->method('getMethodInstance')->with($code)->will($this->returnValue($this->methodInstanceMock));
     $this->methodInstanceMock->expects($this->once())->method('setInfoInstance')->with($this->info);
     $this->assertSame($this->methodInstanceMock, $this->info->getMethodInstance());
     // as the method is already stored at Info, check that it's not initialized again
     $this->assertSame($this->methodInstanceMock, $this->info->getMethodInstance());
 }
예제 #2
0
 /**
  * Retrieve payment information block
  *
  * @param InfoInterface $info
  * @param \Magento\Framework\View\LayoutInterface $layout
  * @return Template
  */
 public function getInfoBlock(InfoInterface $info, LayoutInterface $layout = null)
 {
     $layout = $layout ?: $this->_layout;
     $blockType = $info->getMethodInstance()->getInfoBlockType();
     $block = $layout->createBlock($blockType);
     $block->setInfo($info);
     return $block;
 }
예제 #3
0
파일: main.php 프로젝트: mage2pro/core
/**
 * 2016-08-19
 * @see df_trans_is_my()
 * @param II|OP|QP $payment
 * @return bool
 */
function dfp_is_my(II $payment)
{
    return dfp_method_is_my($payment->getMethodInstance());
}