Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractInstructionTest.php
Go to the documentation of this file.
1 <?php
7 
8 class AbstractInstructionTest extends \PHPUnit\Framework\TestCase
9 {
13  protected $_model;
14 
15  protected function setUp()
16  {
17  $context = $this->createMock(\Magento\Framework\View\Element\Template\Context::class);
18  $this->_model = $this->getMockForAbstractClass(
19  \Magento\OfflinePayments\Block\Form\AbstractInstruction::class,
20  ['context' => $context]
21  );
22  }
23 
24  public function testGetInstructions()
25  {
26  $method = $this->getMockBuilder(\Magento\Payment\Model\MethodInterface::class)
27  ->getMockForAbstractClass();
28 
29  $method->expects($this->once())
30  ->method('getConfigData')
31  ->willReturn('instructions');
32  $this->_model->setData('method', $method);
33 
34  $this->assertEquals('instructions', $this->_model->getInstructions());
35  }
36 }
$method
Definition: info.phtml:13