12 use PHPUnit_Framework_MockObject_MockObject as MockObject;
32 private $paymentDOMock;
37 private $subjectReaderMock;
41 $this->paymentDOMock = $this->createMock(PaymentDataObjectInterface::class);
42 $this->paymentMock = $this->getMockBuilder(Payment::class)
43 ->disableOriginalConstructor()
45 $this->subjectReaderMock = $this->getMockBuilder(SubjectReader::class)
46 ->disableOriginalConstructor()
61 'payment' => $this->paymentDOMock,
65 $this->paymentMock->expects(self::once())
66 ->method(
'getCcTransId')
69 $this->paymentDOMock->expects(self::once())
70 ->method(
'getPayment')
71 ->willReturn($this->paymentMock);
73 $this->subjectReaderMock->expects(self::once())
74 ->method(
'readPayment')
76 ->willReturn($this->paymentDOMock);
78 $this->builder->build($buildSubject);
86 $transactionId =
'b3b99d';
90 'transaction_id' => $transactionId,
95 'payment' => $this->paymentDOMock,
99 $this->paymentMock->expects(self::once())
100 ->method(
'getCcTransId')
101 ->willReturn($transactionId);
103 $this->paymentDOMock->expects(self::once())
104 ->method(
'getPayment')
105 ->willReturn($this->paymentMock);
107 $this->subjectReaderMock->expects(self::once())
108 ->method(
'readPayment')
109 ->with($buildSubject)
110 ->willReturn($this->paymentDOMock);
111 $this->subjectReaderMock->expects(self::once())
112 ->method(
'readAmount')
113 ->with($buildSubject)
116 static::assertEquals($expected, $this->builder->build($buildSubject));