paymentDOMock = $this->createMock(PaymentDataObjectInterface::class); $this->paymentMock = $this->createMock(Payment::class); $this->paymentDOMock->method('getPayment') ->willReturn($this->paymentMock); $this->passthroughData = new PassthroughDataObject(); $this->builder = new SaleDataBuilder( new SubjectReader(), $this->passthroughData ); } public function testBuildWillAddTransactionType() { $expected = [ 'transactionRequest' => [ 'transactionType' => 'authCaptureTransaction' ] ]; $buildSubject = [ 'store_id' => 123, 'payment' => $this->paymentDOMock, ]; $this->assertEquals($expected, $this->builder->build($buildSubject)); $this->assertEquals('authCaptureTransaction', $this->passthroughData->getData('transactionType')); } }