objectManager->get('AuthorizenetAcceptjsCommandPool'); $command = $commandPool->get('void'); $order = $this->getOrderWithIncrementId('100000002'); $payment = $order->getPayment(); $paymentDO = $this->paymentFactory->create($payment); $expectedRequest = include __DIR__ . '/../../_files/expected_request/void.php'; $response = include __DIR__ . '/../../_files/response/void.php'; $this->clientMock->method('setRawData') ->with(json_encode($expectedRequest), 'application/json'); $this->responseMock->method('getBody') ->willReturn(json_encode($response)); $command->execute([ 'payment' => $paymentDO ]); /** @var Payment $payment */ $this->assertTrue($payment->getIsTransactionClosed()); $this->assertTrue($payment->getShouldCloseParentTransaction()); $this->assertEquals('1234', $payment->getTransactionAdditionalInfo()['real_transaction_id']); } }