26 $context = $this->createMock(\
Magento\Framework\View\Element\Template\Context::class);
27 $this->_instructions = new \Magento\Payment\Block\Info\Instructions($context);
28 $this->_info = $this->createMock(\
Magento\Payment\Model\Info::class);
29 $this->_instructions->setData(
'info', $this->_info);
34 $this->_info->expects($this->once())
35 ->method(
'getAdditionalInformation')
36 ->with(
'instructions')
37 ->willReturn(
'get the instruction here');
38 $this->assertEquals(
'get the instruction here', $this->_instructions->getInstructions());
41 $this->assertEquals(
'get the instruction here', $this->_instructions->getInstructions());
46 $methodInstance = $this->getMockBuilder(
47 \
Magento\Payment\Model\MethodInterface::class
48 )->getMockForAbstractClass();
49 $methodInstance->expects($this->once())
50 ->method(
'getConfigData')
51 ->with(
'instructions')
52 ->willReturn(
'get the instruction here');
53 $this->_info->expects($this->once())
54 ->method(
'getAdditionalInformation')
55 ->with(
'instructions')
57 $this->_info->expects($this->once())
58 ->method(
'getMethodInstance')
59 ->willReturn($methodInstance);
60 $this->assertEquals(
'get the instruction here', $this->_instructions->getInstructions());
testGetInstructionAdditionalInformation()