AbstractInstructionTest.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\OfflinePayments\Test\Unit\Block\Form;
  7. class AbstractInstructionTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\OfflinePayments\Block\Form\AbstractInstruction
  11. */
  12. protected $_model;
  13. protected function setUp()
  14. {
  15. $context = $this->createMock(\Magento\Framework\View\Element\Template\Context::class);
  16. $this->_model = $this->getMockForAbstractClass(
  17. \Magento\OfflinePayments\Block\Form\AbstractInstruction::class,
  18. ['context' => $context]
  19. );
  20. }
  21. public function testGetInstructions()
  22. {
  23. $method = $this->getMockBuilder(\Magento\Payment\Model\MethodInterface::class)
  24. ->getMockForAbstractClass();
  25. $method->expects($this->once())
  26. ->method('getConfigData')
  27. ->willReturn('instructions');
  28. $this->_model->setData('method', $method);
  29. $this->assertEquals('instructions', $this->_model->getInstructions());
  30. }
  31. }