/** * test for _buildBasicRequest (BDCODE) and catch exception of response */ public function testFetchTransactionInfoForBNException() { $this->_configFactory->expects($this->once())->method('create')->will($this->returnSelf()); $this->_configFactory->expects($this->once())->method('getBuildNotationCode')->will($this->returnValue('BNCODE')); $payment = $this->getMock('Magento\\Payment\\Model\\Info', [], [], '', false); $this->setExpectedException('Magento\\Framework\\Model\\Exception', 'User authentication failed'); $this->_model->fetchTransactionInfo($payment, 'AD49G8N825'); }
/** * test for _buildBasicRequest (BDCODE) */ public function testFetchTransactionInfoForBN() { $this->_configFactory->expects($this->once())->method('create')->will($this->returnSelf()); $this->_configFactory->expects($this->once())->method('getBuildNotationCode')->will($this->returnValue('BNCODE')); $payment = $this->getMock('Magento\\Payment\\Model\\Info', ['setTransactionId', '__wakeup'], [], '', false); $payment->expects($this->once())->method('setTransactionId')->will($this->returnSelf()); $this->_model->fetchTransactionInfo($payment, 'AD49G8N825'); }