Пример #1
0
 /**
  * @dataProvider getCcTypeNameDataProvider
  */
 public function testGetCcTypeName($configCcTypes, $ccType, $expected)
 {
     $this->paymentConfig->expects($this->any())->method('getCcTypes')->will($this->returnValue($configCcTypes));
     $paymentInfo = $this->getMock('Magento\\Payment\\Model\\Info', ['getCcType'], [], '', false);
     $paymentInfo->expects($this->any())->method('getCcType')->will($this->returnValue($ccType));
     $this->model->setData('info', $paymentInfo);
     $this->assertEquals($expected, $this->model->getCcTypeName());
 }
Пример #2
0
 /**
  * Don't show CC type for non-CC methods
  *
  * @return string|null
  */
 public function getCcTypeName()
 {
     if (\Magento\Paypal\Model\Config::getIsCreditCardMethod($this->getInfo()->getMethod())) {
         return parent::getCcTypeName();
     }
 }