12 use PHPUnit_Framework_MockObject_MockObject as MockObject;
22 private $subjectReaderMock;
27 private $paymentDataObjectMock;
32 private $paymentInfoMock;
41 $this->subjectReaderMock = $this->getMockBuilder(SubjectReader::class)
42 ->disableOriginalConstructor()
43 ->setMethods([
'readPayment'])
46 $this->paymentDataObjectMock = $this->createMock(PaymentDataObjectInterface::class);
48 $this->paymentInfoMock = $this->createMock(InfoInterface::class);
59 public function testBuild(array $paymentData, array $expected)
62 'payment' => $this->paymentDataObjectMock,
65 $this->subjectReaderMock->expects(static::once())
66 ->method(
'readPayment')
68 ->willReturn($this->paymentDataObjectMock);
70 $this->paymentDataObjectMock->expects(static::once())
71 ->method(
'getPayment')
72 ->willReturn($this->paymentInfoMock);
74 $this->paymentInfoMock->expects(static::once())
75 ->method(
'getAdditionalInformation')
76 ->willReturn($paymentData);
78 $actual = $this->builder->build($subject);
79 static::assertEquals($expected, $actual);
91 'device_data' =>
'{correlation_id: 12s3jf9as}' 94 'deviceData' =>
'{correlation_id: 12s3jf9as}' 99 'device_data' =>
null,
105 'deviceData' =>
'{correlation_id: 12s3jf9as}',
testBuild(array $paymentData, array $expected)