Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SubstitutionTest.php
Go to the documentation of this file.
1 <?php
8 
9 class SubstitutionTest extends \PHPUnit\Framework\TestCase
10 {
14  protected $objectManager;
15 
19  protected $model;
20 
21  protected function setUp()
22  {
23  $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
24  $this->model = $this->objectManager->getObject(\Magento\Payment\Model\Method\Substitution::class);
25  }
26 
27  public function testGetTitle()
28  {
29  $infoMock = $this->getMockBuilder(
30  \Magento\Payment\Model\Info::class
31  )->disableOriginalConstructor()->setMethods(
32  []
33  )->getMock();
34 
35  $this->model->setInfoInstance($infoMock);
36  $expectedResult = 'StringTitle';
37  $infoMock->expects(
38  $this->once()
39  )->method(
40  'getAdditionalInformation'
41  )->with(
43  )->will(
44  $this->returnValue(
45  $expectedResult
46  )
47  );
48 
49  $this->assertEquals($expectedResult, $this->model->getTitle());
50  }
51 }