/** * @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()); }
/** * 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(); } }