Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ public function testExecute()
$params = [
'order_success' => $url
];
$this->request->expects(static::once())
$this->request->expects($this->once())
->method('getParams')
->willReturn($params);

$this->coreRegistry->expects(static::once())
$this->coreRegistry->expects($this->once())
->method('register')
->with(Iframe::REGISTRY_KEY, []);

$this->view->expects(static::once())
$this->view->expects($this->once())
->method('addPageLayoutHandles');
$this->view->expects(static::once())
$this->view->expects($this->once())
->method('loadLayout')
->with(false)
->willReturnSelf();
$this->view->expects(static::once())
$this->view->expects($this->once())
->method('renderLayout');

$this->controller->execute();
Expand Down
74 changes: 37 additions & 37 deletions app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,26 +452,26 @@ public function testFetchVoidedTransactionInfo($transactionId, $resultStatus, $r
$paymentId = 36;
$orderId = 36;

$this->paymentMock->expects(static::once())
$this->paymentMock->expects($this->once())
->method('getId')
->willReturn($paymentId);

$orderMock = $this->getMockBuilder(\Magento\Sales\Model\Order::class)
->disableOriginalConstructor()
->setMethods(['getId', '__wakeup'])
->getMock();
$orderMock->expects(static::once())
$orderMock->expects($this->once())
->method('getId')
->willReturn($orderId);

$this->paymentMock->expects(static::once())
$this->paymentMock->expects($this->once())
->method('getOrder')
->willReturn($orderMock);

$transactionMock = $this->getMockBuilder(\Magento\Sales\Model\Order\Payment\Transaction::class)
->disableOriginalConstructor()
->getMock();
$this->transactionRepositoryMock->expects(static::once())
$this->transactionRepositoryMock->expects($this->once())
->method('getByTransactionId')
->with($transactionId, $paymentId, $orderId)
->willReturn($transactionMock);
Expand All @@ -483,19 +483,19 @@ public function testFetchVoidedTransactionInfo($transactionId, $resultStatus, $r
$responseStatus,
$responseCode
);
$this->transactionServiceMock->expects(static::once())
$this->transactionServiceMock->expects($this->once())
->method('getTransactionDetails')
->with($this->directpost, $transactionId)
->willReturn($document);

// transaction should be closed
$this->paymentMock->expects(static::once())
$this->paymentMock->expects($this->once())
->method('setIsTransactionDenied')
->with(true);
$this->paymentMock->expects(static::once())
$this->paymentMock->expects($this->once())
->method('setIsTransactionClosed')
->with(true);
$transactionMock->expects(static::once())
$transactionMock->expects($this->once())
->method('close');

$this->directpost->fetchTransactionInfo($this->paymentMock, $transactionId);
Expand All @@ -509,39 +509,39 @@ public function testSuccessRefund()
{
$card = 1111;

$this->paymentMock->expects(static::exactly(2))
$this->paymentMock->expects($this->exactly(2))
->method('getCcLast4')
->willReturn($card);
$this->paymentMock->expects(static::once())
$this->paymentMock->expects($this->once())
->method('decrypt')
->willReturn($card);
$this->paymentMock->expects(static::exactly(3))
$this->paymentMock->expects($this->exactly(3))
->method('getParentTransactionId')
->willReturn(self::TRANSACTION_ID . '-capture');
$this->paymentMock->expects(static::once())
$this->paymentMock->expects($this->once())
->method('getPoNumber')
->willReturn(self::INVOICE_NUM);
$this->paymentMock->expects(static::once())
$this->paymentMock->expects($this->once())
->method('setIsTransactionClosed')
->with(true)
->willReturnSelf();

$orderMock = $this->getOrderMock();

$this->paymentMock->expects(static::exactly(2))
$this->paymentMock->expects($this->exactly(2))
->method('getOrder')
->willReturn($orderMock);

$transactionMock = $this->getMockBuilder(Order\Payment\Transaction::class)
->disableOriginalConstructor()
->setMethods(['getAdditionalInformation'])
->getMock();
$transactionMock->expects(static::once())
$transactionMock->expects($this->once())
->method('getAdditionalInformation')
->with(Directpost::REAL_TRANSACTION_ID_KEY)
->willReturn(self::TRANSACTION_ID);

$this->transactionRepositoryMock->expects(static::once())
$this->transactionRepositoryMock->expects($this->once())
->method('getByTransactionId')
->willReturn($transactionMock);

Expand All @@ -550,18 +550,18 @@ public function testSuccessRefund()
Directpost::RESPONSE_REASON_CODE_APPROVED,
'Successful'
);
$this->httpClientMock->expects(static::once())
$this->httpClientMock->expects($this->once())
->method('getBody')
->willReturn($response);

$this->responseMock->expects(static::once())
$this->responseMock->expects($this->once())
->method('getXResponseCode')
->willReturn(Directpost::RESPONSE_CODE_APPROVED);
$this->responseMock->expects(static::once())
$this->responseMock->expects($this->once())
->method('getXResponseReasonCode')
->willReturn(Directpost::RESPONSE_REASON_CODE_APPROVED);

$this->dataHelperMock->expects(static::never())
$this->dataHelperMock->expects($this->never())
->method('wrapGatewayError');

$this->directpost->refund($this->paymentMock, self::TOTAL_AMOUNT);
Expand Down Expand Up @@ -606,34 +606,34 @@ private function initResponseFactoryMock()
->disableOriginalConstructor()
->getMock();

$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXResponseCode')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXResponseReasonCode')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXResponseReasonText')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXAvsCode')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXTransId')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXInvoiceNum')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXAmount')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXMethod')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setXType')
->willReturnSelf();
$this->responseMock->expects(static::any())
$this->responseMock->expects($this->any())
->method('setData')
->willReturnSelf();

Expand Down Expand Up @@ -706,7 +706,7 @@ private function getRequestFactoryMock()
->disableOriginalConstructor()
->setMethods(['__wakeup'])
->getMock();
$requestFactory->expects(static::any())
$requestFactory->expects($this->any())
->method('create')
->willReturn($request);
return $requestFactory;
Expand All @@ -726,19 +726,19 @@ private function getOrderMock()
])
->getMock();

$orderMock->expects(static::once())
$orderMock->expects($this->once())
->method('getId')
->willReturn(1);

$orderMock->expects(static::exactly(2))
$orderMock->expects($this->exactly(2))
->method('getIncrementId')
->willReturn(self::INVOICE_NUM);

$orderMock->expects(static::once())
$orderMock->expects($this->once())
->method('getStoreId')
->willReturn(1);

$orderMock->expects(static::once())
$orderMock->expects($this->once())
->method('getBaseCurrencyCode')
->willReturn('USD');
return $orderMock;
Expand All @@ -755,7 +755,7 @@ private function getHttpClientFactoryMock()
->setMethods(['request', 'getBody', '__wakeup'])
->getMock();

$this->httpClientMock->expects(static::any())
$this->httpClientMock->expects($this->any())
->method('request')
->willReturnSelf();

Expand All @@ -764,7 +764,7 @@ private function getHttpClientFactoryMock()
->setMethods(['create'])
->getMock();

$httpClientFactoryMock->expects(static::any())
$httpClientFactoryMock->expects($this->any())
->method('create')
->willReturn($this->httpClientMock);
return $httpClientFactoryMock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ public function testLoadVoidedTransactionDetails($transactionId, $resultStatus,
$responseStatus,
$responseCode
);
$this->httpClientMock->expects(static::once())
$this->httpClientMock->expects($this->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);
$this->assertEquals($responseCode, (string)$result->transaction->responseCode);
$this->assertEquals($responseCode, (string)$result->transaction->responseReasonCode);
$this->assertEquals($responseStatus, (string)$result->transaction->transactionStatus);
}

/**
Expand Down Expand Up @@ -109,7 +109,7 @@ private function getHttpClientFactoryMock()
->setMethods(['request', 'getBody', '__wakeup'])
->getMock();

$this->httpClientMock->expects(static::once())
$this->httpClientMock->expects($this->once())
->method('request')
->willReturnSelf();

Expand All @@ -118,7 +118,7 @@ private function getHttpClientFactoryMock()
->setMethods(['create'])
->getMock();

$httpClientFactoryMock->expects(static::once())
$httpClientFactoryMock->expects($this->once())
->method('create')
->willReturn($this->httpClientMock);
return $httpClientFactoryMock;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Test/Unit/Model/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,6 @@ public function testGetSecretKeyGenerationWithRouteNameInForwardInfo()
public function testGetUrlWithUrlInRoutePath()
{
$routePath = 'https://localhost/index.php/catalog/product/view/id/100/?foo=bar#anchor';
static::assertEquals($routePath, $this->_model->getUrl($routePath));
$this->assertEquals($routePath, $this->_model->getUrl($routePath));
}
}
22 changes: 11 additions & 11 deletions app/code/Magento/Braintree/Test/Unit/Block/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,22 @@ protected function setUp()
*/
public function testGetCcAvailableTypes($countryId, array $availableTypes, array $expected)
{
$this->sessionQuoteMock->expects(static::once())
$this->sessionQuoteMock->expects($this->once())
->method('getCountryId')
->willReturn($countryId);

$this->gatewayConfigMock->expects(static::once())
$this->gatewayConfigMock->expects($this->once())
->method('getAvailableCardTypes')
->with($this->storeId)
->willReturn(self::$configCardTypes);

$this->gatewayConfigMock->expects(static::once())
$this->gatewayConfigMock->expects($this->once())
->method('getCountryAvailableCardTypes')
->with($countryId, $this->storeId)
->willReturn($availableTypes);

$result = $this->block->getCcAvailableTypes();
static::assertEquals($expected, array_values($result));
$this->assertEquals($expected, array_values($result));
}

/**
Expand All @@ -133,17 +133,17 @@ public function countryCardTypesDataProvider()
public function testIsVaultEnabled()
{
$vaultPayment = $this->getMockForAbstractClass(VaultPaymentInterface::class);
$this->paymentDataHelperMock->expects(static::once())
$this->paymentDataHelperMock->expects($this->once())
->method('getMethodInstance')
->with(ConfigProvider::CC_VAULT_CODE)
->willReturn($vaultPayment);

$vaultPayment->expects(static::once())
$vaultPayment->expects($this->once())
->method('isActive')
->with($this->storeId)
->willReturn(true);

static::assertTrue($this->block->isVaultEnabled());
$this->assertTrue($this->block->isVaultEnabled());
}

/**
Expand All @@ -156,7 +156,7 @@ private function initCcTypeMock()
->setMethods(['getCcTypeLabelMap'])
->getMock();

$this->ccTypeMock->expects(static::any())
$this->ccTypeMock->expects($this->any())
->method('getCcTypeLabelMap')
->willReturn(self::$baseCardTypes);
}
Expand All @@ -171,13 +171,13 @@ private function initSessionQuoteMock()
->setMethods(['getQuote', 'getBillingAddress', 'getCountryId', '__wakeup', 'getStoreId'])
->getMock();

$this->sessionQuoteMock->expects(static::any())
$this->sessionQuoteMock->expects($this->any())
->method('getQuote')
->willReturnSelf();
$this->sessionQuoteMock->expects(static::any())
$this->sessionQuoteMock->expects($this->any())
->method('getBillingAddress')
->willReturnSelf();
$this->sessionQuoteMock->expects(static::any())
$this->sessionQuoteMock->expects($this->any())
->method('getStoreId')
->willReturn($this->storeId);
}
Expand Down
Loading