PaymentDataObjectTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Payment\Test\Unit\Gateway\Data;
  7. use Magento\Payment\Gateway\Data\PaymentDataObject;
  8. use Magento\Payment\Gateway\Data\OrderAdapterInterface;
  9. use Magento\Payment\Model\InfoInterface;
  10. /**
  11. * Class PaymentDataObjectTest
  12. */
  13. class PaymentDataObjectTest extends \PHPUnit\Framework\TestCase
  14. {
  15. /** @var PaymentDataObject */
  16. protected $model;
  17. /**
  18. * @var OrderAdapterInterface|\PHPUnit_Framework_MockObject_MockObject
  19. */
  20. protected $orderMock;
  21. /**
  22. * @var InfoInterface|\PHPUnit_Framework_MockObject_MockObject
  23. */
  24. protected $paymentMock;
  25. protected function setUp()
  26. {
  27. $this->orderMock = $this->getMockBuilder(\Magento\Payment\Gateway\Data\OrderAdapterInterface::class)
  28. ->getMockForAbstractClass();
  29. $this->paymentMock = $this->getMockBuilder(\Magento\Payment\Model\InfoInterface::class)
  30. ->getMockForAbstractClass();
  31. $this->model = new PaymentDataObject($this->orderMock, $this->paymentMock);
  32. }
  33. public function testGetOrder()
  34. {
  35. $this->assertSame($this->orderMock, $this->model->getOrder()) ;
  36. }
  37. public function testGetPayment()
  38. {
  39. $this->assertSame($this->paymentMock, $this->model->getPayment()) ;
  40. }
  41. }