14 use PHPUnit_Framework_MockObject_MockObject as MockObject;
37 private $paymentDOMock;
42 private $subjectReaderMock;
52 protected function setUp()
54 $this->paymentDOMock = $this->createMock(PaymentDataObjectInterface::class);
55 $this->paymentMock = $this->getMockBuilder(Payment::class)
56 ->disableOriginalConstructor()
58 $this->subjectReaderMock = $this->getMockBuilder(SubjectReader::class)
59 ->disableOriginalConstructor()
61 $this->orderMock = $this->createMock(OrderAdapterInterface::class);
64 $config = $this->getMockBuilder(Config::class)
65 ->disableOriginalConstructor()
79 $this->subjectReaderMock->expects(self::once())
80 ->method(
'readPayment')
82 ->willThrowException(
new \InvalidArgumentException());
84 $this->builder->build($buildSubject);
94 'payment' => $this->paymentDOMock,
98 $this->subjectReaderMock->expects(self::once())
99 ->method(
'readPayment')
100 ->with($buildSubject)
101 ->willReturn($this->paymentDOMock);
102 $this->subjectReaderMock->expects(self::once())
103 ->method(
'readAmount')
104 ->with($buildSubject)
105 ->willThrowException(
new \InvalidArgumentException());
107 $this->builder->build($buildSubject);
129 'payment' => $this->paymentDOMock,
133 $this->paymentMock->expects(self::exactly(count($additionalData)))
134 ->method(
'getAdditionalInformation')
135 ->willReturnMap($additionalData);
137 $this->paymentDOMock->expects(self::once())
138 ->method(
'getPayment')
139 ->willReturn($this->paymentMock);
141 $this->paymentDOMock->expects(self::once())
143 ->willReturn($this->orderMock);
145 $this->subjectReaderMock->expects(self::once())
146 ->method(
'readPayment')
147 ->with($buildSubject)
148 ->willReturn($this->paymentDOMock);
149 $this->subjectReaderMock->expects(self::once())
150 ->method(
'readAmount')
151 ->with($buildSubject)
154 $this->orderMock->expects(self::once())
155 ->method(
'getOrderIncrementId')
156 ->willReturn(
'000000101');
160 $this->builder->build($buildSubject)
testBuildReadAmountException()
testBuildReadPaymentException()
const PAYMENT_METHOD_NONCE
const PAYMENT_METHOD_NONCE
const PAYMENT_METHOD_NONCE