Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PaymentDataObjectTest.php
Go to the documentation of this file.
1 <?php
7 
11 
15 class PaymentDataObjectTest extends \PHPUnit\Framework\TestCase
16 {
18  protected $model;
19 
23  protected $orderMock;
24 
28  protected $paymentMock;
29 
30  protected function setUp()
31  {
32  $this->orderMock = $this->getMockBuilder(\Magento\Payment\Gateway\Data\OrderAdapterInterface::class)
33  ->getMockForAbstractClass();
34 
35  $this->paymentMock = $this->getMockBuilder(\Magento\Payment\Model\InfoInterface::class)
36  ->getMockForAbstractClass();
37 
38  $this->model = new PaymentDataObject($this->orderMock, $this->paymentMock);
39  }
40 
41  public function testGetOrder()
42  {
43  $this->assertSame($this->orderMock, $this->model->getOrder()) ;
44  }
45 
46  public function testGetPayment()
47  {
48  $this->assertSame($this->paymentMock, $this->model->getPayment()) ;
49  }
50 }