/**
  * @covers \Magento\Authorizenet\Model\TransactionService::loadTransactionDetails
  * @param $transactionId
  * @param $resultStatus
  * @param $responseStatus
  * @param $responseCode
  * @return void
  *
  * @dataProvider dataProviderTransaction
  */
 public function testLoadVoidedTransactionDetails($transactionId, $resultStatus, $responseStatus, $responseCode)
 {
     $document = $this->getResponseBody($transactionId, TransactionService::PAYMENT_UPDATE_STATUS_CODE_SUCCESS, $resultStatus, $responseStatus, $responseCode);
     $this->httpClientMock->expects(static::once())->method('getBody')->willReturn($document);
     $result = $this->transactionService->getTransactionDetails($this->authorizenetMock, $transactionId);
     static::assertEquals($responseCode, (string) $result->transaction->responseCode);
     static::assertEquals($responseCode, (string) $result->transaction->responseReasonCode);
     static::assertEquals($responseStatus, (string) $result->transaction->transactionStatus);
 }
 /**
  * @covers       \Magento\Authorizenet\Model\Directpost::fetchTransactionInfo
  *
  * @param $transactionId
  * @param $resultStatus
  * @param $responseStatus
  * @param $responseCode
  * @return void
  *
  * @dataProvider dataProviderTransaction
  */
 public function testFetchVoidedTransactionInfo($transactionId, $resultStatus, $responseStatus, $responseCode)
 {
     $paymentId = 36;
     $orderId = 36;
     $this->paymentMock->expects(static::once())->method('getId')->willReturn($paymentId);
     $orderMock = $this->getMockBuilder('Magento\\Sales\\Model\\Order')->disableOriginalConstructor()->setMethods(['getId', '__wakeup'])->getMock();
     $orderMock->expects(static::once())->method('getId')->willReturn($orderId);
     $this->paymentMock->expects(static::once())->method('getOrder')->willReturn($orderMock);
     $transactionMock = $this->getMockBuilder('Magento\\Sales\\Model\\Order\\Payment\\Transaction')->disableOriginalConstructor()->getMock();
     $this->transactionRepositoryMock->expects(static::once())->method('getByTransactionId')->with($transactionId, $paymentId, $orderId)->willReturn($transactionMock);
     $document = $this->getTransactionXmlDocument($transactionId, TransactionService::PAYMENT_UPDATE_STATUS_CODE_SUCCESS, $resultStatus, $responseStatus, $responseCode);
     $this->transactionServiceMock->expects(static::once())->method('getTransactionDetails')->with($this->directpost, $transactionId)->willReturn($document);
     // transaction should be closed
     $this->paymentMock->expects(static::once())->method('setIsTransactionDenied')->with(true);
     $this->paymentMock->expects(static::once())->method('setIsTransactionClosed')->with(true);
     $transactionMock->expects(static::once())->method('close');
     $this->directpost->fetchTransactionInfo($this->paymentMock, $transactionId);
 }