orderMock = $this->getMockBuilder(\Magento\Payment\Gateway\Data\OrderAdapterInterface::class) ->getMockForAbstractClass(); $this->paymentMock = $this->getMockBuilder(\Magento\Payment\Model\InfoInterface::class) ->getMockForAbstractClass(); $this->model = new PaymentDataObject($this->orderMock, $this->paymentMock); } public function testGetOrder() { $this->assertSame($this->orderMock, $this->model->getOrder()) ; } public function testGetPayment() { $this->assertSame($this->paymentMock, $this->model->getPayment()) ; } }