13 use PHPUnit_Framework_MockObject_MockObject as MockObject;
23 private $subjectReaderMock;
28 private $paymentDataObjectMock;
33 private $paymentInfoMock;
42 $this->paymentDataObjectMock = $this->createMock(PaymentDataObjectInterface::class);
44 $this->paymentInfoMock = $this->createMock(InfoInterface::class);
46 $this->subjectReaderMock = $this->getMockBuilder(SubjectReader::class)
47 ->disableOriginalConstructor()
48 ->setMethods([
'readPayment'])
60 public function testBuild(array $additionalInfo, array $expected)
63 'payment' => $this->paymentDataObjectMock,
66 $this->subjectReaderMock->expects(static::once())
67 ->method(
'readPayment')
69 ->willReturn($this->paymentDataObjectMock);
71 $this->paymentDataObjectMock->expects(static::once())
72 ->method(
'getPayment')
73 ->willReturn($this->paymentInfoMock);
75 $this->paymentInfoMock->expects(static::once())
76 ->method(
'getAdditionalInformation')
77 ->willReturn($additionalInfo);
79 $actual = $this->builder->build($subject);
80 static::assertEquals($expected, $actual);
96 'storeInVaultOnSuccess' => true
101 'additionalInfo' => [
107 'additionalInfo' => [],
testBuild(array $additionalInfo, array $expected)