diff --git a/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/RedirectTest.php b/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/RedirectTest.php index 0801d3c020119..7d6e427dd2346 100644 --- a/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/RedirectTest.php +++ b/app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/RedirectTest.php @@ -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(); diff --git a/app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php b/app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php index 95c67f67852da..90ba85119f8d5 100644 --- a/app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php +++ b/app/code/Magento/Authorizenet/Test/Unit/Model/DirectpostTest.php @@ -452,7 +452,7 @@ public function testFetchVoidedTransactionInfo($transactionId, $resultStatus, $r $paymentId = 36; $orderId = 36; - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getId') ->willReturn($paymentId); @@ -460,18 +460,18 @@ public function testFetchVoidedTransactionInfo($transactionId, $resultStatus, $r ->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); @@ -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); @@ -509,26 +509,26 @@ 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); @@ -536,12 +536,12 @@ public function testSuccessRefund() ->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); @@ -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); @@ -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(); @@ -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; @@ -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; @@ -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(); @@ -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; diff --git a/app/code/Magento/Authorizenet/Test/Unit/Model/TransactionServiceTest.php b/app/code/Magento/Authorizenet/Test/Unit/Model/TransactionServiceTest.php index 092d633648482..112327f3f264e 100644 --- a/app/code/Magento/Authorizenet/Test/Unit/Model/TransactionServiceTest.php +++ b/app/code/Magento/Authorizenet/Test/Unit/Model/TransactionServiceTest.php @@ -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); } /** @@ -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(); @@ -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; diff --git a/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php b/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php index ad42108cb5eea..9f3d2a1da0aec 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/UrlTest.php @@ -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)); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php b/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php index fa5512ca2db9f..ee6ede4b6dc1c 100644 --- a/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Block/FormTest.php @@ -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)); } /** @@ -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()); } /** @@ -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); } @@ -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); } diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Adminhtml/Payment/GetClientTokenTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Adminhtml/Payment/GetClientTokenTest.php index 95ea2a07d4368..77a27f152fdc3 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Adminhtml/Payment/GetClientTokenTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Adminhtml/Payment/GetClientTokenTest.php @@ -56,7 +56,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['getResultFactory']) ->getMock(); - $context->expects(static::any()) + $context->expects($this->any()) ->method('getResultFactory') ->willReturn($this->resultFactoryMock); $this->configMock = $this->getMockBuilder(Config::class) @@ -88,17 +88,17 @@ public function testExecute() $responseMock = $this->getMockBuilder(ResultInterface::class) ->setMethods(['setHttpResponseCode', 'renderResult', 'setHeader', 'setData']) ->getMock(); - $responseMock->expects(static::once()) + $responseMock->expects($this->once()) ->method('setData') ->with(['clientToken' => $clientToken]) ->willReturn($responseMock); - $this->resultFactoryMock->expects(static::once()) + $this->resultFactoryMock->expects($this->once()) ->method('create') ->willReturn($responseMock); - $this->quoteSessionMock->expects(static::once()) + $this->quoteSessionMock->expects($this->once()) ->method('getStoreId') ->willReturn($storeId); - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('getMerchantAccountId') ->with($storeId) ->willReturn(null); @@ -106,10 +106,10 @@ public function testExecute() ->disableOriginalConstructor() ->setMethods(['generate']) ->getMock(); - $adapterMock->expects(static::once()) + $adapterMock->expects($this->once()) ->method('generate') ->willReturn($clientToken); - $this->adapterFactoryMock->expects(static::once()) + $this->adapterFactoryMock->expects($this->once()) ->method('create') ->willReturn($adapterMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php index 4af63a9c87151..1359aa03fc1fa 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php @@ -87,7 +87,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['getCustomerId', 'getStoreId']) ->getMock(); - $this->sessionMock->expects(static::once()) + $this->sessionMock->expects($this->once()) ->method('getStoreId') ->willReturn(null); @@ -96,10 +96,10 @@ protected function setUp() $context = $this->getMockBuilder(Context::class) ->disableOriginalConstructor() ->getMock(); - $context->expects(static::any()) + $context->expects($this->any()) ->method('getRequest') ->willReturn($this->requestMock); - $context->expects(static::any()) + $context->expects($this->any()) ->method('getResultFactory') ->willReturn($this->resultFactoryMock); @@ -117,28 +117,28 @@ protected function setUp() */ public function testExecuteWithException() { - $this->requestMock->expects(static::once()) + $this->requestMock->expects($this->once()) ->method('getParam') ->with('public_hash') ->willReturn(null); - $this->sessionMock->expects(static::once()) + $this->sessionMock->expects($this->once()) ->method('getCustomerId') ->willReturn(null); $exception = new \Exception('The "publicHash" field does not exists'); - $this->commandMock->expects(static::once()) + $this->commandMock->expects($this->once()) ->method('execute') ->willThrowException($exception); - $this->loggerMock->expects(static::once()) + $this->loggerMock->expects($this->once()) ->method('critical') ->with($exception); - $this->resultMock->expects(static::once()) + $this->resultMock->expects($this->once()) ->method('setHttpResponseCode') ->with(Exception::HTTP_BAD_REQUEST); - $this->resultMock->expects(static::once()) + $this->resultMock->expects($this->once()) ->method('setData') ->with(['message' => 'Sorry, but something went wrong']); @@ -154,32 +154,32 @@ public function testExecute() $publicHash = '65b7bae0dcb690d93'; $nonce = 'f1hc45'; - $this->requestMock->expects(static::once()) + $this->requestMock->expects($this->once()) ->method('getParam') ->with('public_hash') ->willReturn($publicHash); - $this->sessionMock->expects(static::once()) + $this->sessionMock->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $this->commandResultMock->expects(static::once()) + $this->commandResultMock->expects($this->once()) ->method('get') ->willReturn([ 'paymentMethodNonce' => $nonce ]); - $this->commandMock->expects(static::once()) + $this->commandMock->expects($this->once()) ->method('execute') ->willReturn($this->commandResultMock); - $this->resultMock->expects(static::once()) + $this->resultMock->expects($this->once()) ->method('setData') ->with(['paymentMethodNonce' => $nonce]); - $this->loggerMock->expects(static::never()) + $this->loggerMock->expects($this->never()) ->method('critical'); - $this->resultMock->expects(static::never()) + $this->resultMock->expects($this->never()) ->method('setHttpResponseCode'); $this->action->execute(); @@ -199,7 +199,7 @@ private function initResultFactoryMock() ->setMethods(['create']) ->getMock(); - $this->resultFactoryMock->expects(static::once()) + $this->resultFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->resultMock); } diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php index 9c25846e56da0..516397266c95d 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/PlaceOrderTest.php @@ -148,10 +148,10 @@ public function testExecute() $this->orderPlace->method('execute') ->with($quoteMock, [0]); - $this->messageManager->expects(self::never()) + $this->messageManager->expects($this->never()) ->method('addExceptionMessage'); - self::assertEquals($this->placeOrder->execute(), $resultMock); + $this->assertEquals($this->placeOrder->execute(), $resultMock); } /** @@ -186,16 +186,16 @@ public function testExecuteException() $this->checkoutSession->method('getQuote') ->willReturn($quote); - $this->orderPlace->expects(self::never()) + $this->orderPlace->expects($this->never()) ->method('execute'); $this->messageManager->method('addExceptionMessage') ->with( - self::isInstanceOf('\InvalidArgumentException'), + $this->isInstanceOf('\InvalidArgumentException'), 'The order #000000111 cannot be processed.' ); - self::assertEquals($this->placeOrder->execute(), $resultMock); + $this->assertEquals($this->placeOrder->execute(), $resultMock); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php index 609b7f21dbf87..6dfaa49004810 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/ReviewTest.php @@ -89,13 +89,13 @@ protected function setUp() $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getRequest') ->willReturn($this->requestMock); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getResultFactory') ->willReturn($this->resultFactoryMock); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getMessageManager') ->willReturn($this->messageManagerMock); @@ -117,50 +117,50 @@ public function testExecute() $quoteMock = $this->getQuoteMock(); $childBlockMock = $this->getChildBlockMock(); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getItemsCount') ->willReturn(1); - $this->requestMock->expects(self::once()) + $this->requestMock->expects($this->once()) ->method('getPostValue') ->with('result', '{}') ->willReturn($result); - $this->checkoutSessionMock->expects(self::once()) + $this->checkoutSessionMock->expects($this->once()) ->method('getQuote') ->willReturn($quoteMock); - $this->quoteUpdaterMock->expects(self::once()) + $this->quoteUpdaterMock->expects($this->once()) ->method('execute') ->with(['test-value'], ['test-value'], $quoteMock); - $this->resultFactoryMock->expects(self::once()) + $this->resultFactoryMock->expects($this->once()) ->method('create') ->with(ResultFactory::TYPE_PAGE) ->willReturn($resultPageMock); - $resultPageMock->expects(self::once()) + $resultPageMock->expects($this->once()) ->method('getLayout') ->willReturn($layoutMock); - $layoutMock->expects(self::once()) + $layoutMock->expects($this->once()) ->method('getBlock') ->with('braintree.paypal.review') ->willReturn($blockMock); - $blockMock->expects(self::once()) + $blockMock->expects($this->once()) ->method('setQuote') ->with($quoteMock); - $blockMock->expects(self::once()) + $blockMock->expects($this->once()) ->method('getChildBlock') ->with('shipping_method') ->willReturn($childBlockMock); - $childBlockMock->expects(self::once()) + $childBlockMock->expects($this->once()) ->method('setData') ->with('quote', $quoteMock); - self::assertEquals($this->review->execute(), $resultPageMock); + $this->assertEquals($this->review->execute(), $resultPageMock); } public function testExecuteException() @@ -169,40 +169,40 @@ public function testExecuteException() $quoteMock = $this->getQuoteMock(); $resultRedirectMock = $this->getResultRedirectMock(); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getItemsCount') ->willReturn(0); - $this->requestMock->expects(self::once()) + $this->requestMock->expects($this->once()) ->method('getPostValue') ->with('result', '{}') ->willReturn($result); - $this->checkoutSessionMock->expects(self::once()) + $this->checkoutSessionMock->expects($this->once()) ->method('getQuote') ->willReturn($quoteMock); - $this->quoteUpdaterMock->expects(self::never()) + $this->quoteUpdaterMock->expects($this->never()) ->method('execute'); - $this->messageManagerMock->expects(self::once()) + $this->messageManagerMock->expects($this->once()) ->method('addExceptionMessage') ->with( - self::isInstanceOf('\InvalidArgumentException'), + $this->isInstanceOf('\InvalidArgumentException'), 'Checkout failed to initialize. Verify and try again.' ); - $this->resultFactoryMock->expects(self::once()) + $this->resultFactoryMock->expects($this->once()) ->method('create') ->with(ResultFactory::TYPE_REDIRECT) ->willReturn($resultRedirectMock); - $resultRedirectMock->expects(self::once()) + $resultRedirectMock->expects($this->once()) ->method('setPath') ->with('checkout/cart') ->willReturnSelf(); - self::assertEquals($this->review->execute(), $resultRedirectMock); + $this->assertEquals($this->review->execute(), $resultRedirectMock); } public function testExecuteExceptionPaymentWithoutNonce() @@ -211,7 +211,7 @@ public function testExecuteExceptionPaymentWithoutNonce() $quoteMock = $this->getQuoteMock(); $resultRedirectMock = $this->getResultRedirectMock(); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getItemsCount') ->willReturn(1); @@ -219,37 +219,37 @@ public function testExecuteExceptionPaymentWithoutNonce() ->disableOriginalConstructor() ->getMock(); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getPayment') ->willReturn($paymentMock); - $this->requestMock->expects(self::once()) + $this->requestMock->expects($this->once()) ->method('getPostValue') ->with('result', '{}') ->willReturn($result); - $this->checkoutSessionMock->expects(self::once()) + $this->checkoutSessionMock->expects($this->once()) ->method('getQuote') ->willReturn($quoteMock); - $this->messageManagerMock->expects(self::once()) + $this->messageManagerMock->expects($this->once()) ->method('addExceptionMessage') ->with( - self::isInstanceOf(\Magento\Framework\Exception\LocalizedException::class), + $this->isInstanceOf(\Magento\Framework\Exception\LocalizedException::class), 'Checkout failed to initialize. Verify and try again.' ); - $this->resultFactoryMock->expects(self::once()) + $this->resultFactoryMock->expects($this->once()) ->method('create') ->with(ResultFactory::TYPE_REDIRECT) ->willReturn($resultRedirectMock); - $resultRedirectMock->expects(self::once()) + $resultRedirectMock->expects($this->once()) ->method('setPath') ->with('checkout/cart') ->willReturnSelf(); - self::assertEquals($this->review->execute(), $resultRedirectMock); + $this->assertEquals($this->review->execute(), $resultRedirectMock); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php index 32ed698189fa7..5ed1bdaca9e0c 100644 --- a/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Controller/Paypal/SaveShippingMethodTest.php @@ -111,22 +111,22 @@ protected function setUp() $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->getMockForAbstractClass(); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getRequest') ->willReturn($this->requestMock); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getRedirect') ->willReturn($this->redirectMock); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getResponse') ->willReturn($this->responseMock); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getUrl') ->willReturn($this->urlMock); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getResultFactory') ->willReturn($this->resultFactoryMock); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getMessageManager') ->willReturn($this->messageManagerMock); @@ -146,11 +146,11 @@ public function testExecuteAjax() $layoutMock = $this->getLayoutMock(); $blockMock = $this->getBlockMock(); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getItemsCount') ->willReturn(1); - $this->requestMock->expects(self::exactly(2)) + $this->requestMock->expects($this->exactly(2)) ->method('getParam') ->willReturnMap( [ @@ -159,42 +159,42 @@ public function testExecuteAjax() ] ); - $this->checkoutSessionMock->expects(self::once()) + $this->checkoutSessionMock->expects($this->once()) ->method('getQuote') ->willReturn($quoteMock); - $this->shippingMethodUpdaterMock->expects(self::once()) + $this->shippingMethodUpdaterMock->expects($this->once()) ->method('execute') ->with('test-shipping-method', $quoteMock); - $this->resultFactoryMock->expects(self::once()) + $this->resultFactoryMock->expects($this->once()) ->method('create') ->with(ResultFactory::TYPE_PAGE) ->willReturn($responsePageMock); - $responsePageMock->expects(self::once()) + $responsePageMock->expects($this->once()) ->method('addHandle') ->with('paypal_express_review_details') ->willReturnSelf(); - $responsePageMock->expects(self::once()) + $responsePageMock->expects($this->once()) ->method('getLayout') ->willReturn($layoutMock); - $layoutMock->expects(self::once()) + $layoutMock->expects($this->once()) ->method('getBlock') ->with('page.block') ->willReturn($blockMock); - $blockMock->expects(self::once()) + $blockMock->expects($this->once()) ->method('toHtml') ->willReturn($resultHtml); - $this->responseMock->expects(self::once()) + $this->responseMock->expects($this->once()) ->method('setBody') ->with($resultHtml); - $this->urlMock->expects(self::never()) + $this->urlMock->expects($this->never()) ->method('getUrl'); $this->saveShippingMethod->execute(); @@ -205,11 +205,11 @@ public function testExecuteAjaxException() $redirectPath = 'path/to/redirect'; $quoteMock = $this->getQuoteMock(); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getItemsCount') ->willReturn(0); - $this->requestMock->expects(self::exactly(1)) + $this->requestMock->expects($this->exactly(1)) ->method('getParam') ->willReturnMap( [ @@ -217,26 +217,26 @@ public function testExecuteAjaxException() ] ); - $this->checkoutSessionMock->expects(self::once()) + $this->checkoutSessionMock->expects($this->once()) ->method('getQuote') ->willReturn($quoteMock); - $this->shippingMethodUpdaterMock->expects(self::never()) + $this->shippingMethodUpdaterMock->expects($this->never()) ->method('execute'); - $this->messageManagerMock->expects(self::once()) + $this->messageManagerMock->expects($this->once()) ->method('addExceptionMessage') ->with( - self::isInstanceOf('\InvalidArgumentException'), + $this->isInstanceOf('\InvalidArgumentException'), 'Checkout failed to initialize. Verify and try again.' ); - $this->urlMock->expects(self::once()) + $this->urlMock->expects($this->once()) ->method('getUrl') ->with('*/*/review', ['_secure' => true]) ->willReturn($redirectPath); - $this->redirectMock->expects(self::once()) + $this->redirectMock->expects($this->once()) ->method('redirect') ->with($this->responseMock, $redirectPath, []); @@ -248,11 +248,11 @@ public function testExecuteException() $redirectPath = 'path/to/redirect'; $quoteMock = $this->getQuoteMock(); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getItemsCount') ->willReturn(0); - $this->requestMock->expects(self::exactly(1)) + $this->requestMock->expects($this->exactly(1)) ->method('getParam') ->willReturnMap( [ @@ -260,26 +260,26 @@ public function testExecuteException() ] ); - $this->checkoutSessionMock->expects(self::once()) + $this->checkoutSessionMock->expects($this->once()) ->method('getQuote') ->willReturn($quoteMock); - $this->shippingMethodUpdaterMock->expects(self::never()) + $this->shippingMethodUpdaterMock->expects($this->never()) ->method('execute'); - $this->messageManagerMock->expects(self::once()) + $this->messageManagerMock->expects($this->once()) ->method('addExceptionMessage') ->with( - self::isInstanceOf('\InvalidArgumentException'), + $this->isInstanceOf('\InvalidArgumentException'), 'Checkout failed to initialize. Verify and try again.' ); - $this->urlMock->expects(self::once()) + $this->urlMock->expects($this->once()) ->method('getUrl') ->with('*/*/review', ['_secure' => true]) ->willReturn($redirectPath); - $this->responseMock->expects(self::once()) + $this->responseMock->expects($this->once()) ->method('setBody') ->with(sprintf('', $redirectPath)); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php index 845a02930d709..df74635816285 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php @@ -103,7 +103,7 @@ protected function setUp() $adapterFactoryMock = $this->getMockBuilder(BraintreeAdapterFactory::class) ->disableOriginalConstructor() ->getMock(); - $adapterFactoryMock->expects(self::any()) + $adapterFactoryMock->expects($this->any()) ->method('create') ->willReturn($this->braintreeAdapterMock); @@ -128,26 +128,26 @@ public function testSaleExecute() $paymentData = $this->getPaymentDataObjectMock(); $subject['payment'] = $paymentData; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentData); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getAuthorizationTransaction') ->willReturn(false); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getId') ->willReturn(1); $this->buildSearchCriteria(); - $this->transactionRepositoryMock->expects(static::once()) + $this->transactionRepositoryMock->expects($this->once()) ->method('getTotalCount') ->willReturn(0); - $this->commandPoolMock->expects(static::once()) + $this->commandPoolMock->expects($this->once()) ->method('get') ->with(CaptureStrategyCommand::SALE) ->willReturn($this->commandMock); @@ -164,35 +164,35 @@ public function testCaptureExecute() $subject['payment'] = $paymentData; $lastTransId = 'txnds'; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentData); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getAuthorizationTransaction') ->willReturn(true); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getLastTransId') ->willReturn($lastTransId); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getId') ->willReturn(1); $this->buildSearchCriteria(); - $this->transactionRepositoryMock->expects(static::once()) + $this->transactionRepositoryMock->expects($this->once()) ->method('getTotalCount') ->willReturn(0); // authorization transaction was not expired $collection = $this->getNotExpiredExpectedCollection($lastTransId); - $collection->expects(static::once()) + $collection->expects($this->once()) ->method('maximumCount') ->willReturn(0); - $this->commandPoolMock->expects(static::once()) + $this->commandPoolMock->expects($this->once()) ->method('get') ->with(CaptureStrategyCommand::CAPTURE) ->willReturn($this->commandMock); @@ -215,10 +215,10 @@ private function getNotExpiredExpectedCollection($lastTransactionId) ->disableOriginalConstructor() ->getMock(); - $this->braintreeAdapterMock->expects(static::once()) + $this->braintreeAdapterMock->expects($this->once()) ->method('search') ->with( - static::callback( + $this->callback( function (array $filters) use ($isExpectations) { foreach ($filters as $filter) { /** @var IsNode $filter */ @@ -249,35 +249,35 @@ public function testExpiredAuthorizationPerformVaultCaptureExecute() $subject['payment'] = $paymentData; $lastTransId = 'txnds'; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentData); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getAuthorizationTransaction') ->willReturn(true); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getLastTransId') ->willReturn($lastTransId); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getId') ->willReturn(1); $this->buildSearchCriteria(); - $this->transactionRepositoryMock->expects(static::once()) + $this->transactionRepositoryMock->expects($this->once()) ->method('getTotalCount') ->willReturn(0); // authorization transaction was expired $collection = $this->getNotExpiredExpectedCollection($lastTransId); - $collection->expects(static::once()) + $collection->expects($this->once()) ->method('maximumCount') ->willReturn(1); - $this->commandPoolMock->expects(static::once()) + $this->commandPoolMock->expects($this->once()) ->method('get') ->with(CaptureStrategyCommand::VAULT_CAPTURE) ->willReturn($this->commandMock); @@ -293,26 +293,26 @@ public function testVaultCaptureExecute() $paymentData = $this->getPaymentDataObjectMock(); $subject['payment'] = $paymentData; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentData); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getAuthorizationTransaction') ->willReturn(true); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getId') ->willReturn(1); $this->buildSearchCriteria(); - $this->transactionRepositoryMock->expects(static::once()) + $this->transactionRepositoryMock->expects($this->once()) ->method('getTotalCount') ->willReturn(1); - $this->commandPoolMock->expects(static::once()) + $this->commandPoolMock->expects($this->once()) ->method('get') ->with(CaptureStrategyCommand::VAULT_CAPTURE) ->willReturn($this->commandMock); @@ -335,7 +335,7 @@ private function getPaymentDataObjectMock() ->disableOriginalConstructor() ->getMock(); - $mock->expects(static::once()) + $mock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); @@ -359,7 +359,7 @@ private function initCommandMock() ->setMethods(['execute']) ->getMock(); - $this->commandMock->expects(static::once()) + $this->commandMock->expects($this->once()) ->method('execute') ->willReturn([]); } @@ -380,22 +380,22 @@ private function initFilterBuilderMock() */ private function buildSearchCriteria() { - $this->filterBuilderMock->expects(static::exactly(2)) + $this->filterBuilderMock->expects($this->exactly(2)) ->method('setField') ->willReturnSelf(); - $this->filterBuilderMock->expects(static::exactly(2)) + $this->filterBuilderMock->expects($this->exactly(2)) ->method('setValue') ->willReturnSelf(); $searchCriteria = new SearchCriteria(); - $this->searchCriteriaBuilderMock->expects(static::exactly(2)) + $this->searchCriteriaBuilderMock->expects($this->exactly(2)) ->method('addFilters') ->willReturnSelf(); - $this->searchCriteriaBuilderMock->expects(static::once()) + $this->searchCriteriaBuilderMock->expects($this->once()) ->method('create') ->willReturn($searchCriteria); - $this->transactionRepositoryMock->expects(static::once()) + $this->transactionRepositoryMock->expects($this->once()) ->method('getList') ->with($searchCriteria) ->willReturnSelf(); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php index 23167af02a97b..4fe7220532fd7 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php @@ -84,7 +84,7 @@ protected function setUp() $adapterFactoryMock = $this->getMockBuilder(BraintreeAdapterFactory::class) ->disableOriginalConstructor() ->getMock(); - $adapterFactoryMock->expects(self::any()) + $adapterFactoryMock->expects($this->any()) ->method('create') ->willReturn($this->adapterMock); @@ -125,11 +125,11 @@ public function testExecuteWithExceptionForPublicHash() { $exception = new \InvalidArgumentException('The "publicHash" field does not exists'); - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPublicHash') ->willThrowException($exception); - $this->subjectReaderMock->expects(self::never()) + $this->subjectReaderMock->expects($this->never()) ->method('readCustomerId'); $this->command->execute([]); @@ -144,16 +144,16 @@ public function testExecuteWithExceptionForCustomerId() { $publicHash = '3wv2m24d2er3'; - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPublicHash') ->willReturn($publicHash); $exception = new \InvalidArgumentException('The "customerId" field does not exists'); - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readCustomerId') ->willThrowException($exception); - $this->tokenManagementMock->expects(static::never()) + $this->tokenManagementMock->expects($this->never()) ->method('getByPublicHash'); $this->command->execute(['publicHash' => $publicHash]); @@ -169,20 +169,20 @@ public function testExecuteWithExceptionForTokenManagement() $publicHash = '3wv2m24d2er3'; $customerId = 1; - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPublicHash') ->willReturn($publicHash); - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readCustomerId') ->willReturn($customerId); $exception = new \Exception('No available payment tokens'); - $this->tokenManagementMock->expects(static::once()) + $this->tokenManagementMock->expects($this->once()) ->method('getByPublicHash') ->willThrowException($exception); - $this->paymentTokenMock->expects(self::never()) + $this->paymentTokenMock->expects($this->never()) ->method('getGatewayToken'); $this->command->execute(['publicHash' => $publicHash, 'customerId' => $customerId]); @@ -199,44 +199,44 @@ public function testExecuteWithFailedValidation() $customerId = 1; $token = 'jd2vnq'; - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPublicHash') ->willReturn($publicHash); - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readCustomerId') ->willReturn($customerId); - $this->tokenManagementMock->expects(static::once()) + $this->tokenManagementMock->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn($this->paymentTokenMock); - $this->paymentTokenMock->expects(static::once()) + $this->paymentTokenMock->expects($this->once()) ->method('getGatewayToken') ->willReturn($token); $obj = new \stdClass(); $obj->success = false; - $this->adapterMock->expects(static::once()) + $this->adapterMock->expects($this->once()) ->method('createNonce') ->with($token) ->willReturn($obj); - $this->responseValidatorMock->expects(static::once()) + $this->responseValidatorMock->expects($this->once()) ->method('validate') ->with(['response' => ['object' => $obj]]) ->willReturn($this->validationResultMock); - $this->validationResultMock->expects(static::once()) + $this->validationResultMock->expects($this->once()) ->method('isValid') ->willReturn(false); - $this->validationResultMock->expects(static::once()) + $this->validationResultMock->expects($this->once()) ->method('getFailsDescription') ->willReturn(['Payment method nonce can\'t be retrieved.']); - $this->resultFactoryMock->expects(static::never()) + $this->resultFactoryMock->expects($this->never()) ->method('create'); $this->command->execute(['publicHash' => $publicHash, 'customerId' => $customerId]); @@ -252,20 +252,20 @@ public function testExecute() $token = 'jd2vnq'; $nonce = 's1dj23'; - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPublicHash') ->willReturn($publicHash); - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readCustomerId') ->willReturn($customerId); - $this->tokenManagementMock->expects(static::once()) + $this->tokenManagementMock->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn($this->paymentTokenMock); - $this->paymentTokenMock->expects(static::once()) + $this->paymentTokenMock->expects($this->once()) ->method('getGatewayToken') ->willReturn($token); @@ -273,36 +273,36 @@ public function testExecute() $obj->success = true; $obj->paymentMethodNonce = new \stdClass(); $obj->paymentMethodNonce->nonce = $nonce; - $this->adapterMock->expects(static::once()) + $this->adapterMock->expects($this->once()) ->method('createNonce') ->with($token) ->willReturn($obj); - $this->responseValidatorMock->expects(static::once()) + $this->responseValidatorMock->expects($this->once()) ->method('validate') ->with(['response' => ['object' => $obj]]) ->willReturn($this->validationResultMock); - $this->validationResultMock->expects(static::once()) + $this->validationResultMock->expects($this->once()) ->method('isValid') ->willReturn(true); - $this->validationResultMock->expects(self::never()) + $this->validationResultMock->expects($this->never()) ->method('getFailsDescription'); $expected = $this->getMockBuilder(ArrayResult::class) ->disableOriginalConstructor() ->setMethods(['get']) ->getMock(); - $expected->expects(static::once()) + $expected->expects($this->once()) ->method('get') ->willReturn(['paymentMethodNonce' => $nonce]); - $this->resultFactoryMock->expects(static::once()) + $this->resultFactoryMock->expects($this->once()) ->method('create') ->willReturn($expected); $actual = $this->command->execute(['publicHash' => $publicHash, 'customerId' => $customerId]); - self::assertEquals($expected, $actual); - self::assertEquals($nonce, $actual->get()['paymentMethodNonce']); + $this->assertEquals($expected, $actual); + $this->assertEquals($nonce, $actual->get()['paymentMethodNonce']); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Config/CanVoidHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/CanVoidHandlerTest.php index 031e53690451f..5adb60f9abaf4 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Config/CanVoidHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/CanVoidHandlerTest.php @@ -24,19 +24,19 @@ public function testHandleNotOrderPayment() ->disableOriginalConstructor() ->getMock(); - $subjectReader->expects(static::once()) + $subjectReader->expects($this->once()) ->method('readPayment') ->willReturn($paymentDO); $paymentMock = $this->createMock(InfoInterface::class); - $paymentDO->expects(static::once()) + $paymentDO->expects($this->once()) ->method('getPayment') ->willReturn($paymentMock); $voidHandler = new CanVoidHandler($subjectReader); - static::assertFalse($voidHandler->handle($subject)); + $this->assertFalse($voidHandler->handle($subject)); } public function testHandleSomeAmountWasPaid() @@ -50,7 +50,7 @@ public function testHandleSomeAmountWasPaid() ->disableOriginalConstructor() ->getMock(); - $subjectReader->expects(static::once()) + $subjectReader->expects($this->once()) ->method('readPayment') ->willReturn($paymentDO); @@ -58,16 +58,16 @@ public function testHandleSomeAmountWasPaid() ->disableOriginalConstructor() ->getMock(); - $paymentDO->expects(static::once()) + $paymentDO->expects($this->once()) ->method('getPayment') ->willReturn($paymentMock); - $paymentMock->expects(static::once()) + $paymentMock->expects($this->once()) ->method('getAmountPaid') ->willReturn(1.00); $voidHandler = new CanVoidHandler($subjectReader); - static::assertFalse($voidHandler->handle($subject)); + $this->assertFalse($voidHandler->handle($subject)); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php index 36ea3aea465dd..58b4ad1b96611 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Config/ConfigTest.php @@ -58,7 +58,7 @@ protected function setUp() */ public function testGetCountrySpecificCardTypeConfig($encodedValue, $value, array $expected) { - $this->scopeConfigMock->expects(static::once()) + $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with($this->getPath(Config::KEY_COUNTRY_CREDIT_CARD), ScopeInterface::SCOPE_STORE, null) ->willReturn($encodedValue); @@ -68,7 +68,7 @@ public function testGetCountrySpecificCardTypeConfig($encodedValue, $value, arra ->with($encodedValue) ->willReturn($value); - static::assertEquals( + $this->assertEquals( $expected, $this->model->getCountrySpecificCardTypeConfig() ); @@ -100,12 +100,12 @@ public function getCountrySpecificCardTypeConfigDataProvider() */ public function testGetAvailableCardTypes($value, $expected) { - $this->scopeConfigMock->expects(static::once()) + $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with($this->getPath(Config::KEY_CC_TYPES), ScopeInterface::SCOPE_STORE, null) ->willReturn($value); - static::assertEquals( + $this->assertEquals( $expected, $this->model->getAvailableCardTypes() ); @@ -135,12 +135,12 @@ public function getAvailableCardTypesDataProvider() */ public function testGetCcTypesMapper($value, $expected) { - $this->scopeConfigMock->expects(static::once()) + $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with($this->getPath(Config::KEY_CC_TYPES_BRAINTREE_MAPPER), ScopeInterface::SCOPE_STORE, null) ->willReturn($value); - static::assertEquals( + $this->assertEquals( $expected, $this->model->getCcTypesMapper() ); @@ -176,7 +176,7 @@ public function getCcTypesMapperDataProvider() */ public function testCountryAvailableCardTypes($encodedData, $data, array $countryData) { - $this->scopeConfigMock->expects(static::any()) + $this->scopeConfigMock->expects($this->any()) ->method('getValue') ->with($this->getPath(Config::KEY_COUNTRY_CREDIT_CARD), ScopeInterface::SCOPE_STORE, null) ->willReturn($encodedData); @@ -188,11 +188,11 @@ public function testCountryAvailableCardTypes($encodedData, $data, array $countr foreach ($countryData as $countryId => $types) { $result = $this->model->getCountryAvailableCardTypes($countryId); - static::assertEquals($types, $result); + $this->assertEquals($types, $result); } if (empty($countryData)) { - static::assertEquals($data, ""); + $this->assertEquals($data, ""); } } @@ -201,12 +201,12 @@ public function testCountryAvailableCardTypes($encodedData, $data, array $countr */ public function testUseCvv() { - $this->scopeConfigMock->expects(static::any()) + $this->scopeConfigMock->expects($this->any()) ->method('getValue') ->with($this->getPath(Config::KEY_USE_CVV), ScopeInterface::SCOPE_STORE, null) ->willReturn(1); - static::assertEquals(true, $this->model->isCvvEnabled()); + $this->assertEquals(true, $this->model->isCvvEnabled()); } /** @@ -217,11 +217,11 @@ public function testUseCvv() */ public function testIsVerify3DSecure($data, $expected) { - $this->scopeConfigMock->expects(static::any()) + $this->scopeConfigMock->expects($this->any()) ->method('getValue') ->with($this->getPath(Config::KEY_VERIFY_3DSECURE), ScopeInterface::SCOPE_STORE, null) ->willReturn($data); - static::assertEquals($expected, $this->model->isVerify3DSecure()); + $this->assertEquals($expected, $this->model->isVerify3DSecure()); } /** @@ -248,11 +248,11 @@ public function verify3DSecureDataProvider() */ public function testGetThresholdAmount($data, $expected) { - $this->scopeConfigMock->expects(static::any()) + $this->scopeConfigMock->expects($this->any()) ->method('getValue') ->with($this->getPath(Config::KEY_THRESHOLD_AMOUNT), ScopeInterface::SCOPE_STORE, null) ->willReturn($data); - static::assertEquals($expected, $this->model->getThresholdAmount()); + $this->assertEquals($expected, $this->model->getThresholdAmount()); } /** @@ -281,18 +281,18 @@ public function thresholdAmountDataProvider() */ public function testGet3DSecureSpecificCountries($value, array $expected) { - $this->scopeConfigMock->expects(static::at(0)) + $this->scopeConfigMock->expects($this->at(0)) ->method('getValue') ->with($this->getPath(Config::KEY_VERIFY_ALLOW_SPECIFIC), ScopeInterface::SCOPE_STORE, null) ->willReturn($value); if ($value !== Config::VALUE_3DSECURE_ALL) { - $this->scopeConfigMock->expects(static::at(1)) + $this->scopeConfigMock->expects($this->at(1)) ->method('getValue') ->with($this->getPath(Config::KEY_VERIFY_SPECIFIC), ScopeInterface::SCOPE_STORE, null) ->willReturn('GB,US'); } - static::assertEquals($expected, $this->model->get3DSecureSpecificCountries()); + $this->assertEquals($expected, $this->model->get3DSecureSpecificCountries()); } /** @@ -317,21 +317,21 @@ public function threeDSecureSpecificCountriesDataProvider() */ public function testGetDynamicDescriptors($name, $phone, $url, array $expected) { - $this->scopeConfigMock->expects(static::at(0)) + $this->scopeConfigMock->expects($this->at(0)) ->method('getValue') ->with($this->getPath('descriptor_name'), ScopeInterface::SCOPE_STORE, null) ->willReturn($name); - $this->scopeConfigMock->expects(static::at(1)) + $this->scopeConfigMock->expects($this->at(1)) ->method('getValue') ->with($this->getPath('descriptor_phone'), ScopeInterface::SCOPE_STORE, null) ->willReturn($phone); - $this->scopeConfigMock->expects(static::at(2)) + $this->scopeConfigMock->expects($this->at(2)) ->method('getValue') ->with($this->getPath('descriptor_url'), ScopeInterface::SCOPE_STORE, null) ->willReturn($url); $actual = $this->model->getDynamicDescriptors(); - static::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php index c871dc69a5370..bb6acec7d4f58 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionRefundTest.php @@ -61,7 +61,7 @@ protected function setUp() $adapterFactoryMock = $this->getMockBuilder(BraintreeAdapterFactory::class) ->disableOriginalConstructor() ->getMock(); - $adapterFactoryMock->expects(self::once()) + $adapterFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->adapterMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php index 1317deeddb7fe..652bea0c67efb 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSaleTest.php @@ -50,7 +50,7 @@ protected function setUp() $adapterFactoryMock = $this->getMockBuilder(BraintreeAdapterFactory::class) ->disableOriginalConstructor() ->getMock(); - $adapterFactoryMock->expects(self::once()) + $adapterFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->adapterMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php index 2e77824817942..9d8956a22a6f6 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionSubmitForSettlementTest.php @@ -69,7 +69,7 @@ protected function setUp() public function testPlaceRequestWithException() { $exception = new \Exception('Transaction has been declined'); - $this->adapterMock->expects(static::once()) + $this->adapterMock->expects($this->once()) ->method('submitForSettlement') ->willThrowException($exception); @@ -84,15 +84,15 @@ public function testPlaceRequestWithException() public function testPlaceRequest() { $data = new Successful(['success'], [true]); - $this->adapterMock->expects(static::once()) + $this->adapterMock->expects($this->once()) ->method('submitForSettlement') ->willReturn($data); /** @var TransferInterface|MockObject $transferObject */ $transferObject = $this->getTransferObjectMock(); $response = $this->client->placeRequest($transferObject); - static::assertTrue(is_object($response['object'])); - static::assertEquals(['object' => $data], $response); + $this->assertTrue(is_object($response['object'])); + $this->assertEquals(['object' => $data], $response); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionVoidTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionVoidTest.php index 17f63d0659b93..cc8caba5458d9 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionVoidTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Http/Client/TransactionVoidTest.php @@ -55,7 +55,7 @@ protected function setUp() $adapterFactoryMock = $this->getMockBuilder(BraintreeAdapterFactory::class) ->disableOriginalConstructor() ->getMock(); - $adapterFactoryMock->expects(self::once()) + $adapterFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->adapterMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php index e1bbf29c63645..0e8616e7b9583 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/AddressDataBuilderTest.php @@ -57,7 +57,7 @@ public function testBuildReadPaymentException() 'payment' => null, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willThrowException(new \InvalidArgumentException()); @@ -67,14 +67,14 @@ public function testBuildReadPaymentException() public function testBuildNoAddresses() { - $this->paymentDOMock->expects(static::once()) + $this->paymentDOMock->expects($this->once()) ->method('getOrder') ->willReturn($this->orderMock); - $this->orderMock->expects(static::once()) + $this->orderMock->expects($this->once()) ->method('getShippingAddress') ->willReturn(null); - $this->orderMock->expects(static::once()) + $this->orderMock->expects($this->once()) ->method('getBillingAddress') ->willReturn(null); @@ -82,12 +82,12 @@ public function testBuildNoAddresses() 'payment' => $this->paymentDOMock, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - static::assertEquals([], $this->builder->build($buildSubject)); + $this->assertEquals([], $this->builder->build($buildSubject)); } /** @@ -100,14 +100,14 @@ public function testBuild($addressData, $expectedResult) { $addressMock = $this->getAddressMock($addressData); - $this->paymentDOMock->expects(static::once()) + $this->paymentDOMock->expects($this->once()) ->method('getOrder') ->willReturn($this->orderMock); - $this->orderMock->expects(static::once()) + $this->orderMock->expects($this->once()) ->method('getShippingAddress') ->willReturn($addressMock); - $this->orderMock->expects(static::once()) + $this->orderMock->expects($this->once()) ->method('getBillingAddress') ->willReturn($addressMock); @@ -115,12 +115,12 @@ public function testBuild($addressData, $expectedResult) 'payment' => $this->paymentDOMock, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - self::assertEquals($expectedResult, $this->builder->build($buildSubject)); + $this->assertEquals($expectedResult, $this->builder->build($buildSubject)); } /** @@ -178,31 +178,31 @@ private function getAddressMock($addressData) { $addressMock = $this->createMock(AddressAdapterInterface::class); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getFirstname') ->willReturn($addressData['first_name']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getLastname') ->willReturn($addressData['last_name']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getCompany') ->willReturn($addressData['company']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getStreetLine1') ->willReturn($addressData['street_1']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getStreetLine2') ->willReturn($addressData['street_2']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getCity') ->willReturn($addressData['city']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getRegionCode') ->willReturn($addressData['region_code']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getPostcode') ->willReturn($addressData['post_code']); - $addressMock->expects(self::exactly(2)) + $addressMock->expects($this->exactly(2)) ->method('getCountryId') ->willReturn($addressData['country_id']); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php index 84558be0dab0f..c55b8d56c9d31 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CaptureDataBuilderTest.php @@ -62,15 +62,15 @@ public function testBuildWithException() 'amount' => $amount, ]; - $this->paymentMock->expects(self::once()) + $this->paymentMock->expects($this->once()) ->method('getCcTransId') ->willReturn(''); - $this->paymentDOMock->expects(self::once()) + $this->paymentDOMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); @@ -96,23 +96,23 @@ public function testBuild() 'amount' => $amount, ]; - $this->paymentMock->expects(self::once()) + $this->paymentMock->expects($this->once()) ->method('getCcTransId') ->willReturn($transactionId); - $this->paymentDOMock->expects(self::once()) + $this->paymentDOMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readAmount') ->with($buildSubject) ->willReturn($amount); - static::assertEquals($expected, $this->builder->build($buildSubject)); + $this->assertEquals($expected, $this->builder->build($buildSubject)); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php index 5769290c249aa..4fa657878ea1d 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ChannelDataBuilderTest.php @@ -57,13 +57,13 @@ public function testBuild($edition, array $expected) $buildSubject = []; $this->config->method('getValue') - ->with(self::equalTo('channel')) + ->with($this->equalTo('channel')) ->willReturn(null); $this->productMetadata->method('getEdition') ->willReturn($edition); - self::assertEquals($expected, $this->builder->build($buildSubject)); + $this->assertEquals($expected, $this->builder->build($buildSubject)); } /** @@ -74,13 +74,13 @@ public function testBuildWithChannelFromConfig() $channel = 'Magento2_Cart_ConfigEdition_BT'; $this->config->method('getValue') - ->with(self::equalTo('channel')) + ->with($this->equalTo('channel')) ->willReturn($channel); - $this->productMetadata->expects(self::never()) + $this->productMetadata->expects($this->never()) ->method('getEdition'); - self::assertEquals( + $this->assertEquals( [ 'channel' => $channel ], diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php index b19715cf92010..d39ad545f1679 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/CustomerDataBuilderTest.php @@ -57,7 +57,7 @@ public function testBuildReadPaymentException() 'payment' => null, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willThrowException(new \InvalidArgumentException()); @@ -75,10 +75,10 @@ public function testBuild($billingData, $expectedResult) { $billingMock = $this->getBillingMock($billingData); - $this->paymentDOMock->expects(static::once()) + $this->paymentDOMock->expects($this->once()) ->method('getOrder') ->willReturn($this->orderMock); - $this->orderMock->expects(static::once()) + $this->orderMock->expects($this->once()) ->method('getBillingAddress') ->willReturn($billingMock); @@ -86,12 +86,12 @@ public function testBuild($billingData, $expectedResult) 'payment' => $this->paymentDOMock, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - self::assertEquals($expectedResult, $this->builder->build($buildSubject)); + $this->assertEquals($expectedResult, $this->builder->build($buildSubject)); } /** @@ -129,19 +129,19 @@ private function getBillingMock($billingData) { $addressMock = $this->createMock(AddressAdapterInterface::class); - $addressMock->expects(static::once()) + $addressMock->expects($this->once()) ->method('getFirstname') ->willReturn($billingData['first_name']); - $addressMock->expects(static::once()) + $addressMock->expects($this->once()) ->method('getLastname') ->willReturn($billingData['last_name']); - $addressMock->expects(static::once()) + $addressMock->expects($this->once()) ->method('getCompany') ->willReturn($billingData['company']); - $addressMock->expects(static::once()) + $addressMock->expects($this->once()) ->method('getTelephone') ->willReturn($billingData['phone']); - $addressMock->expects(static::once()) + $addressMock->expects($this->once()) ->method('getEmail') ->willReturn($billingData['email']); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/DescriptorDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/DescriptorDataBuilderTest.php index 1a87e5254bc50..342aa36cb2b74 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/DescriptorDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/DescriptorDataBuilderTest.php @@ -56,20 +56,20 @@ public function testBuild(array $descriptors, array $expected) $buildSubject = [ 'payment' => $paymentDOMock, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($paymentDOMock); $order = $this->createMock(OrderAdapterInterface::class); - $order->expects(self::once())->method('getStoreId')->willReturn('1'); + $order->expects($this->once())->method('getStoreId')->willReturn('1'); - $paymentDOMock->expects(self::once())->method('getOrder')->willReturn($order); + $paymentDOMock->expects($this->once())->method('getOrder')->willReturn($order); $this->configMock->method('getDynamicDescriptors')->willReturn($descriptors); $actual = $this->builder->build(['payment' => $paymentDOMock]); - static::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php index 6a4aeacba4faf..cf9d8fd5ca45a 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/KountPaymentDataBuilderTest.php @@ -69,11 +69,11 @@ public function testBuildReadPaymentException() { $buildSubject = []; - $this->configMock->expects(self::never()) + $this->configMock->expects($this->never()) ->method('hasFraudProtection') ->willReturn(true); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willThrowException(new \InvalidArgumentException()); @@ -92,28 +92,28 @@ public function testBuild() ]; $order = $this->createMock(OrderAdapterInterface::class); - $this->paymentDOMock->expects(self::once())->method('getOrder')->willReturn($order); + $this->paymentDOMock->expects($this->once())->method('getOrder')->willReturn($order); $buildSubject = ['payment' => $this->paymentDOMock]; - $this->paymentMock->expects(self::exactly(count($additionalData))) + $this->paymentMock->expects($this->exactly(count($additionalData))) ->method('getAdditionalInformation') ->willReturn($additionalData); - $this->configMock->expects(self::once()) + $this->configMock->expects($this->once()) ->method('hasFraudProtection') ->willReturn(true); - $this->paymentDOMock->expects(self::once()) + $this->paymentDOMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - static::assertEquals( + $this->assertEquals( $expectedResult, $this->builder->build($buildSubject) ); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/DeviceDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/DeviceDataBuilderTest.php index c618ab66b95bc..43a9b23ddc28f 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/DeviceDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/DeviceDataBuilderTest.php @@ -62,21 +62,21 @@ public function testBuild(array $paymentData, array $expected) 'payment' => $this->paymentDataObjectMock, ]; - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($this->paymentDataObjectMock); - $this->paymentDataObjectMock->expects(static::once()) + $this->paymentDataObjectMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentInfoMock); - $this->paymentInfoMock->expects(static::once()) + $this->paymentInfoMock->expects($this->once()) ->method('getAdditionalInformation') ->willReturn($paymentData); $actual = $this->builder->build($subject); - static::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/VaultDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/VaultDataBuilderTest.php index 5595d5172b194..7d9a081e1617a 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/VaultDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PayPal/VaultDataBuilderTest.php @@ -63,21 +63,21 @@ public function testBuild(array $additionalInfo, array $expected) 'payment' => $this->paymentDataObjectMock, ]; - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($this->paymentDataObjectMock); - $this->paymentDataObjectMock->expects(static::once()) + $this->paymentDataObjectMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentInfoMock); - $this->paymentInfoMock->expects(static::once()) + $this->paymentInfoMock->expects($this->once()) ->method('getAdditionalInformation') ->willReturn($additionalInfo); $actual = $this->builder->build($subject); - static::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php index 5620e8ffa92b8..7102dd6d6d5b5 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/PaymentDataBuilderTest.php @@ -76,7 +76,7 @@ public function testBuildReadPaymentException(): void { $buildSubject = []; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willThrowException(new \InvalidArgumentException()); @@ -95,11 +95,11 @@ public function testBuildReadAmountException(): void 'amount' => null, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readAmount') ->with($buildSubject) ->willThrowException(new \InvalidArgumentException()); @@ -130,32 +130,32 @@ public function testBuild(): void 'amount' => 10.00, ]; - $this->paymentMock->expects(self::exactly(count($additionalData))) + $this->paymentMock->expects($this->exactly(count($additionalData))) ->method('getAdditionalInformation') ->willReturnMap($additionalData); - $this->paymentDOMock->expects(self::once()) + $this->paymentDOMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); - $this->paymentDOMock->expects(self::once()) + $this->paymentDOMock->expects($this->once()) ->method('getOrder') ->willReturn($this->orderMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readAmount') ->with($buildSubject) ->willReturn(10.00); - $this->orderMock->expects(self::once()) + $this->orderMock->expects($this->once()) ->method('getOrderIncrementId') ->willReturn('000000101'); - self::assertEquals( + $this->assertEquals( $expectedResult, $this->builder->build($buildSubject) ); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/RefundDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/RefundDataBuilderTest.php index dffe293c5a32f..341cccd9b9c47 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/RefundDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/RefundDataBuilderTest.php @@ -61,19 +61,19 @@ public function testBuild() $this->initPaymentDOMock(); $buildSubject = ['payment' => $this->paymentDOMock, 'amount' => 12.358]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->paymentModelMock->expects(self::once()) + $this->paymentModelMock->expects($this->once()) ->method('getParentTransactionId') ->willReturn($this->transactionId); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readAmount') ->with($buildSubject) ->willReturn($buildSubject['amount']); - static::assertEquals( + $this->assertEquals( [ 'transaction_id' => $this->transactionId, PaymentDataBuilder::AMOUNT => '12.36', @@ -87,19 +87,19 @@ public function testBuildNullAmount() $this->initPaymentDOMock(); $buildSubject = ['payment' => $this->paymentDOMock]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->paymentModelMock->expects(self::once()) + $this->paymentModelMock->expects($this->once()) ->method('getParentTransactionId') ->willReturn($this->transactionId); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readAmount') ->with($buildSubject) ->willThrowException(new \InvalidArgumentException()); - static::assertEquals( + $this->assertEquals( [ 'transaction_id' => $this->transactionId, PaymentDataBuilder::AMOUNT => null, @@ -114,19 +114,19 @@ public function testBuildCutOffLegacyTransactionIdPostfix() $buildSubject = ['payment' => $this->paymentDOMock]; $legacyTxnId = 'xsd7n-' . TransactionInterface::TYPE_CAPTURE; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->paymentModelMock->expects(self::once()) + $this->paymentModelMock->expects($this->once()) ->method('getParentTransactionId') ->willReturn($legacyTxnId); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readAmount') ->with($buildSubject) ->willThrowException(new \InvalidArgumentException()); - static::assertEquals( + $this->assertEquals( [ 'transaction_id' => $this->transactionId, PaymentDataBuilder::AMOUNT => null, @@ -143,7 +143,7 @@ public function testBuildCutOffLegacyTransactionIdPostfix() private function initPaymentDOMock() { $this->paymentDOMock = $this->createMock(PaymentDataObjectInterface::class); - $this->paymentDOMock->expects(self::once()) + $this->paymentDOMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentModelMock); } diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php index f12d1365d0b34..fbbd8d79aaa08 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/ThreeDSecureDataBuilderTest.php @@ -64,7 +64,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['getOrder', 'getPayment']) ->getMock(); - $this->paymentDOMock->expects(static::once()) + $this->paymentDOMock->expects($this->once()) ->method('getOrder') ->willReturn($this->orderMock); @@ -95,36 +95,36 @@ public function testBuild($verify, $thresholdAmount, $countryId, array $countrie 'amount' => 25, ]; - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('isVerify3DSecure') - ->with(self::equalTo($this->storeId)) + ->with($this->equalTo($this->storeId)) ->willReturn($verify); - $this->configMock->expects(static::any()) + $this->configMock->expects($this->any()) ->method('getThresholdAmount') - ->with(self::equalTo($this->storeId)) + ->with($this->equalTo($this->storeId)) ->willReturn($thresholdAmount); - $this->configMock->expects(static::any()) + $this->configMock->expects($this->any()) ->method('get3DSecureSpecificCountries') - ->with(self::equalTo($this->storeId)) + ->with($this->equalTo($this->storeId)) ->willReturn($countries); - $this->billingAddressMock->expects(static::any()) + $this->billingAddressMock->expects($this->any()) ->method('getCountryId') ->willReturn($countryId); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readAmount') ->with($buildSubject) ->willReturn(25); $result = $this->builder->build($buildSubject); - self::assertEquals($expected, $result); + $this->assertEquals($expected, $result); } /** @@ -173,7 +173,7 @@ private function initOrderMock() ->setMethods(['getBillingAddress', 'getStoreId']) ->getMock(); - $this->orderMock->expects(static::any()) + $this->orderMock->expects($this->any()) ->method('getBillingAddress') ->willReturn($this->billingAddressMock); $this->orderMock->method('getStoreId') diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php index d4e1f2745e3f3..b582b1ab10325 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php @@ -103,7 +103,7 @@ public function testBuild(): void ->willReturn($token); $result = $this->builder->build($buildSubject); - self::assertEquals($expected, $result); + $this->assertEquals($expected, $result); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultDataBuilderTest.php index 08b5526daeb04..29d84c1db0ced 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultDataBuilderTest.php @@ -20,7 +20,7 @@ public function testBuild() $buildSubject = []; $builder = new VaultDataBuilder(); - static::assertEquals( + $this->assertEquals( $expectedResult, $builder->build($buildSubject) ); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VoidDataBuilderTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VoidDataBuilderTest.php index 88713885b5c7d..5a80366a668a1 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VoidDataBuilderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Request/VoidDataBuilderTest.php @@ -45,7 +45,7 @@ protected function setUp() $this->paymentMock = $this->getMockBuilder(Payment::class) ->disableOriginalConstructor() ->getMock(); - $this->paymentDOMock->expects(static::once()) + $this->paymentDOMock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); @@ -73,12 +73,12 @@ public function testBuild($parentTransactionId, $callLastTransId, $lastTransId, 'amount' => $amount, ]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($buildSubject) ->willReturn($this->paymentDOMock); - $this->paymentMock->expects(self::once()) + $this->paymentMock->expects($this->once()) ->method('getParentTransactionId') ->willReturn($parentTransactionId); $this->paymentMock->expects(self::$callLastTransId()) @@ -86,7 +86,7 @@ public function testBuild($parentTransactionId, $callLastTransId, $lastTransId, ->willReturn($lastTransId); $result = $this->builder->build($buildSubject); - self::assertEquals( + $this->assertEquals( ['transaction_id' => $expected], $result ); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CancelDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CancelDetailsHandlerTest.php index 2fa3d2ea65836..3834ddc273212 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CancelDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CancelDetailsHandlerTest.php @@ -55,7 +55,7 @@ public function testHandle(): void $this->handler->handle($response, []); - self::assertTrue($payment->getIsTransactionClosed(), 'The current transaction should be closed.'); - self::assertTrue($payment->getShouldCloseParentTransaction(), 'The parent transaction should be closed.'); + $this->assertTrue($payment->getIsTransactionClosed(), 'The current transaction should be closed.'); + $this->assertTrue($payment->getShouldCloseParentTransaction(), 'The parent transaction should be closed.'); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php index a70993e14e50c..e5d57082db7cf 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/CardDetailsHandlerTest.php @@ -58,24 +58,24 @@ public function testHandle() $subject = ['payment' => $paymentDataMock]; $response = ['object' => $transaction]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentDataMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readTransaction') ->with($response) ->willReturn($transaction); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('setCcLast4'); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('setCcExpMonth'); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('setCcExpYear'); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('setCcType'); - $this->paymentMock->expects(static::exactly(2)) + $this->paymentMock->expects($this->exactly(2)) ->method('setAdditionalInformation'); $this->cardHandler->handle($subject, $response); @@ -91,7 +91,7 @@ private function initConfigMock() ->setMethods(['getCctypesMapper']) ->getMock(); - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('getCctypesMapper') ->willReturn([ 'american-express' => 'AE', @@ -125,7 +125,7 @@ private function getPaymentDataObjectMock() ->disableOriginalConstructor() ->getMock(); - $mock->expects(static::once()) + $mock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php index b3a7f8b9ee76a..54253ddc274f6 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php @@ -107,7 +107,7 @@ protected function setUp() ->setMethods(['create']) ->getMock(); - $this->paymentInfoMock->expects(self::any()) + $this->paymentInfoMock->expects($this->any()) ->method('getExtensionAttributes') ->willReturn($this->paymentExtensionMock); @@ -159,14 +159,14 @@ public function testHandle() $extensionAttributes = $this->paymentInfoMock->getExtensionAttributes(); $paymentToken = $extensionAttributes->getVaultPaymentToken(); - self::assertNotNull($paymentToken); + $this->assertNotNull($paymentToken); $tokenDetails = json_decode($paymentToken->getTokenDetails(), true); - self::assertSame($this->paymentTokenMock, $paymentToken); - self::assertEquals(self::$token, $paymentToken->getGatewayToken()); - self::assertEquals(self::$payerEmail, $tokenDetails['payerEmail']); - self::assertEquals($expirationDate, $paymentToken->getExpiresAt()); + $this->assertSame($this->paymentTokenMock, $paymentToken); + $this->assertEquals(self::$token, $paymentToken->getGatewayToken()); + $this->assertEquals(self::$payerEmail, $tokenDetails['payerEmail']); + $this->assertEquals($expirationDate, $paymentToken->getExpiresAt()); } public function testHandleWithoutToken() @@ -181,14 +181,14 @@ public function testHandleWithoutToken() $this->paymentDataObjectMock->method('getPayment') ->willReturn($this->paymentInfoMock); - $this->paymentTokenFactoryMock->expects(self::never()) + $this->paymentTokenFactoryMock->expects($this->never()) ->method('create'); - $this->dateTimeFactoryMock->expects(self::never()) + $this->dateTimeFactoryMock->expects($this->never()) ->method('create'); $this->handler->handle($this->subject, $response); - self::assertNotNull($this->paymentInfoMock->getExtensionAttributes()); + $this->assertNotNull($this->paymentInfoMock->getExtensionAttributes()); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php index 1b2c8c6bb4ad1..d4e5501e48d0f 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPalDetailsHandlerTest.php @@ -58,20 +58,20 @@ public function testHandle() $subject = ['payment' => $paymentDataMock]; $response = ['object' => $transaction]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentDataMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readTransaction') ->with($response) ->willReturn($transaction); - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayPal') ->with($transaction) ->willReturn($transaction->paypal); - $this->paymentMock->expects(static::exactly(2)) + $this->paymentMock->expects($this->exactly(2)) ->method('setAdditionalInformation'); $this->payPalHandler->handle($subject, $response); @@ -88,7 +88,7 @@ private function getPaymentDataObjectMock() ->disableOriginalConstructor() ->getMock(); - $mock->expects(static::once()) + $mock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php index 69beab38f001b..25e430d50e141 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/PaymentDetailsHandlerTest.php @@ -48,11 +48,11 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('setCcTransId'); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('setLastTransId'); - $this->paymentMock->expects(static::any()) + $this->paymentMock->expects($this->any()) ->method('setAdditionalInformation'); $this->paymentHandler = new PaymentDetailsHandler($this->subjectReaderMock); @@ -69,11 +69,11 @@ public function testHandle() $subject = ['payment' => $paymentDataMock]; $response = ['object' => $transaction]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentDataMock); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readTransaction') ->with($response) ->willReturn($transaction); @@ -92,7 +92,7 @@ private function getPaymentDataObjectMock() ->disableOriginalConstructor() ->getMock(); - $mock->expects(static::once()) + $mock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php index b86952ebf07a5..27f04d46f651f 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/RiskDataHandlerTest.php @@ -58,7 +58,7 @@ public function testHandle($riskDecision, $isFraud) ->getMock(); /** @var PaymentDataObjectInterface|MockObject $paymentDO */ $paymentDO = $this->createMock(PaymentDataObjectInterface::class); - $paymentDO->expects(self::once()) + $paymentDO->expects($this->once()) ->method('getPayment') ->willReturn($payment); @@ -76,27 +76,27 @@ public function testHandle($riskDecision, $isFraud) 'payment' => $paymentDO, ]; - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($handlingSubject) ->willReturn($paymentDO); - $this->subjectReaderMock->expects(static::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readTransaction') ->with($response) ->willReturn($transaction); - $payment->expects(static::at(0)) + $payment->expects($this->at(0)) ->method('setAdditionalInformation') ->with(RiskDataHandler::RISK_DATA_ID, 'test-id'); - $payment->expects(static::at(1)) + $payment->expects($this->at(1)) ->method('setAdditionalInformation') ->with(RiskDataHandler::RISK_DATA_DECISION, $riskDecision); if (!$isFraud) { - $payment->expects(static::never()) + $payment->expects($this->never()) ->method('setIsFraudDetected'); } else { - $payment->expects(static::once()) + $payment->expects($this->once()) ->method('setIsFraudDetected') ->with(true); } diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php index e97eefc8a3444..b6ae461baccce 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/ThreeDSecureDetailsHandlerTest.php @@ -64,19 +64,19 @@ public function testHandle() $subject = ['payment' => $paymentData]; $response = ['object' => $transaction]; - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readPayment') ->with($subject) ->willReturn($paymentData); - $this->subjectReaderMock->expects(self::once()) + $this->subjectReaderMock->expects($this->once()) ->method('readTransaction') ->with($response) ->willReturn($transaction); - $this->paymentMock->expects(static::at(1)) + $this->paymentMock->expects($this->at(1)) ->method('setAdditionalInformation') ->with('liabilityShifted', 'Yes'); - $this->paymentMock->expects(static::at(2)) + $this->paymentMock->expects($this->at(2)) ->method('setAdditionalInformation') ->with('liabilityShiftPossible', 'Yes'); @@ -94,7 +94,7 @@ private function getPaymentDataObjectMock() ->disableOriginalConstructor() ->getMock(); - $mock->expects(static::once()) + $mock->expects($this->once()) ->method('getPayment') ->willReturn($this->paymentMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php index 6cbca707242f1..f73fe6010585f 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/TransactionIdHandlerTest.php @@ -31,26 +31,26 @@ public function testHandle() ->disableOriginalConstructor() ->getMock(); - $subjectReader->expects(static::once()) + $subjectReader->expects($this->once()) ->method('readPayment') ->with($handlingSubject) ->willReturn($paymentDO); - $paymentDO->expects(static::atLeastOnce()) + $paymentDO->expects($this->atLeastOnce()) ->method('getPayment') ->willReturn($paymentInfo); - $subjectReader->expects(static::once()) + $subjectReader->expects($this->once()) ->method('readTransaction') ->with($response) ->willReturn($transaction); - $paymentInfo->expects(static::once()) + $paymentInfo->expects($this->once()) ->method('setTransactionId') ->with(1); - $paymentInfo->expects(static::once()) + $paymentInfo->expects($this->once()) ->method('setIsTransactionClosed') ->with(false); - $paymentInfo->expects(static::once()) + $paymentInfo->expects($this->once()) ->method('setShouldCloseParentTransaction') ->with(false); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php index c8ec52560be29..e9a5789484c39 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VaultDetailsHandlerTest.php @@ -83,7 +83,7 @@ protected function setUp() ->setMethods(['__wakeup', 'getExtensionAttributes']) ->getMock(); - $this->payment->expects(self::any())->method('getExtensionAttributes')->willReturn($this->paymentExtension); + $this->payment->expects($this->any())->method('getExtensionAttributes')->willReturn($this->paymentExtension); $config = $this->getConfigMock(); @@ -107,11 +107,11 @@ public function testHandle() $paymentToken = $this->payment->getExtensionAttributes() ->getVaultPaymentToken(); - self::assertEquals(self::$token, $paymentToken->getGatewayToken()); - self::assertEquals('2022-01-01 00:00:00', $paymentToken->getExpiresAt()); + $this->assertEquals(self::$token, $paymentToken->getGatewayToken()); + $this->assertEquals('2022-01-01 00:00:00', $paymentToken->getExpiresAt()); $details = json_decode($paymentToken->getTokenDetails(), true); - self::assertEquals( + $this->assertEquals( [ 'type' => 'AE', 'maskedCC' => 1231, diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VoidHandlerTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VoidHandlerTest.php index a541b0115fe63..da0f22136f8fb 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VoidHandlerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Response/VoidHandlerTest.php @@ -31,25 +31,25 @@ public function testHandle() ->disableOriginalConstructor() ->getMock(); - $subjectReader->expects(static::once()) + $subjectReader->expects($this->once()) ->method('readPayment') ->with($handlingSubject) ->willReturn($paymentDO); - $paymentDO->expects(static::atLeastOnce()) + $paymentDO->expects($this->atLeastOnce()) ->method('getPayment') ->willReturn($paymentInfo); - $subjectReader->expects(static::once()) + $subjectReader->expects($this->once()) ->method('readTransaction') ->with($response) ->willReturn($transaction); - $paymentInfo->expects(static::never()) + $paymentInfo->expects($this->never()) ->method('setTransactionId'); - $paymentInfo->expects(static::once()) + $paymentInfo->expects($this->once()) ->method('setIsTransactionClosed') ->with(true); - $paymentInfo->expects(static::once()) + $paymentInfo->expects($this->once()) ->method('setShouldCloseParentTransaction') ->with(true); diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php index 4741a3ea38c6f..5047df547ddf8 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php @@ -70,7 +70,7 @@ public function testValidate(array $validationSubject, bool $isValid, $messages, $actual = $this->responseValidator->validate($validationSubject); - self::assertEquals($result, $actual); + $this->assertEquals($result, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php index 530945c974ceb..ac729c252fc1a 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/PaymentNonceResponseValidatorTest.php @@ -53,7 +53,7 @@ public function testFailedValidate() ->willReturn($result); $actual = $this->validator->validate($subject); - self::assertEquals($result, $actual); + $this->assertEquals($result, $actual); } public function testValidateSuccess() @@ -74,6 +74,6 @@ public function testValidateSuccess() ->willReturn($result); $actual = $this->validator->validate($subject); - self::assertEquals($result, $actual); + $this->assertEquals($result, $actual); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ResponseValidatorTest.php b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ResponseValidatorTest.php index 360e1ff0525b6..570766775457a 100644 --- a/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ResponseValidatorTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Gateway/Validator/ResponseValidatorTest.php @@ -94,7 +94,7 @@ public function testValidate(array $validationSubject, $isValid, $messages) $actual = $this->responseValidator->validate($validationSubject); - self::assertEquals($result, $actual); + $this->assertEquals($result, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Helper/CcTypeTest.php b/app/code/Magento/Braintree/Test/Unit/Helper/CcTypeTest.php index 6b1a38c61a5cd..b5859fe8e92c5 100644 --- a/app/code/Magento/Braintree/Test/Unit/Helper/CcTypeTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Helper/CcTypeTest.php @@ -47,7 +47,7 @@ protected function setUp() */ public function testGetCcTypes() { - $this->ccTypeSource->expects(static::once()) + $this->ccTypeSource->expects($this->once()) ->method('toOptionArray') ->willReturn([ 'label' => 'VISA', 'value' => 'VI' @@ -55,7 +55,7 @@ public function testGetCcTypes() $this->helper->getCcTypes(); - $this->ccTypeSource->expects(static::never()) + $this->ccTypeSource->expects($this->never()) ->method('toOptionArray'); $this->helper->getCcTypes(); diff --git a/app/code/Magento/Braintree/Test/Unit/Helper/CountryTest.php b/app/code/Magento/Braintree/Test/Unit/Helper/CountryTest.php index 692eae643dc29..21345341fc6c5 100644 --- a/app/code/Magento/Braintree/Test/Unit/Helper/CountryTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Helper/CountryTest.php @@ -46,7 +46,7 @@ protected function setUp() */ public function testGetCountries() { - $this->collection->expects(static::once()) + $this->collection->expects($this->once()) ->method('toOptionArray') ->willReturn([ ['value' => 'US', 'label' => 'United States'], @@ -55,7 +55,7 @@ public function testGetCountries() $this->helper->getCountries(); - $this->collection->expects(static::never()) + $this->collection->expects($this->never()) ->method('toOptionArray'); $this->helper->getCountries(); @@ -71,11 +71,11 @@ protected function getCollectionFactoryMock() ->setMethods(['addFieldToFilter', 'loadData', 'toOptionArray', '__wakeup']) ->getMock(); - $this->collection->expects(static::any()) + $this->collection->expects($this->any()) ->method('addFieldToFilter') ->willReturnSelf(); - $this->collection->expects(static::any()) + $this->collection->expects($this->any()) ->method('loadData') ->willReturnSelf(); @@ -84,7 +84,7 @@ protected function getCollectionFactoryMock() ->setMethods(['create']) ->getMock(); - $collectionFactory->expects(static::once()) + $collectionFactory->expects($this->once()) ->method('create') ->willReturn($this->collection); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php index f8c6dcbda71df..03ed1ea641fd3 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryTest.php @@ -96,7 +96,7 @@ public function testToOptionArray() */ public function testIsCountryRestricted($countryId) { - static::assertTrue($this->model->isCountryRestricted($countryId)); + $this->assertTrue($this->model->isCountryRestricted($countryId)); } /** @@ -134,13 +134,13 @@ public function countryDataProvider() */ protected function initCountryCollectionMock(array $countries) { - $this->countryCollectionMock->expects(static::once()) + $this->countryCollectionMock->expects($this->once()) ->method('addFieldToFilter') ->willReturnSelf(); - $this->countryCollectionMock->expects(static::once()) + $this->countryCollectionMock->expects($this->once()) ->method('loadData') ->willReturnSelf(); - $this->countryCollectionMock->expects(static::once()) + $this->countryCollectionMock->expects($this->once()) ->method('toOptionArray') ->willReturn($countries); } diff --git a/app/code/Magento/Braintree/Test/Unit/Model/AvsEmsCodeMapperTest.php b/app/code/Magento/Braintree/Test/Unit/Model/AvsEmsCodeMapperTest.php index c82634d36db31..3b5b565a98f3d 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/AvsEmsCodeMapperTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/AvsEmsCodeMapperTest.php @@ -41,18 +41,18 @@ public function testGetCode($avsZip, $avsStreet, $expected) ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getMethod') ->willReturn(ConfigProvider::CODE); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getAdditionalInformation') ->willReturn([ 'avsPostalCodeResponseCode' => $avsZip, 'avsStreetAddressResponseCode' => $avsStreet ]); - self::assertEquals($expected, $this->mapper->getCode($orderPayment)); + $this->assertEquals($expected, $this->mapper->getCode($orderPayment)); } /** @@ -69,7 +69,7 @@ public function testGetCodeWithException() ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::exactly(2)) + $orderPayment->expects($this->exactly(2)) ->method('getMethod') ->willReturn('some_payment'); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/CvvEmsCodeMapperTest.php b/app/code/Magento/Braintree/Test/Unit/Model/CvvEmsCodeMapperTest.php index 5f151de7f12e0..7b7f4b026ca94 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/CvvEmsCodeMapperTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/CvvEmsCodeMapperTest.php @@ -40,15 +40,15 @@ public function testGetCode($cvvCode, $expected) ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getMethod') ->willReturn(ConfigProvider::CODE); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getAdditionalInformation') ->willReturn(['cvvResponseCode' => $cvvCode]); - self::assertEquals($expected, $this->mapper->getCode($orderPayment)); + $this->assertEquals($expected, $this->mapper->getCode($orderPayment)); } /** @@ -65,7 +65,7 @@ public function testGetCodeWithException() ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::exactly(2)) + $orderPayment->expects($this->exactly(2)) ->method('getMethod') ->willReturn('some_payment'); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/AvailabilityCheckerTest.php b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/AvailabilityCheckerTest.php index 2248aab1aad2e..cee8748bd4117 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/AvailabilityCheckerTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/AvailabilityCheckerTest.php @@ -52,7 +52,7 @@ public function testIsAvailable(bool $isVerify3DSecure, bool $expected) { $this->configMock->expects($this->once())->method('isVerify3DSecure')->willReturn($isVerify3DSecure); $actual = $this->availabilityChecker->isAvailable(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/TokenFormatterTest.php b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/TokenFormatterTest.php index a5c7cd743d85f..200c1664b5aae 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/TokenFormatterTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/CreditCard/TokenFormatterTest.php @@ -68,7 +68,7 @@ public function testFormatPaymentTokenWithKnownCardType() $this->tokenDetails['expirationDate'] ); - self::assertEquals( + $this->assertEquals( $formattedString, $this->creditCardTokenFormatter->formatPaymentToken($this->paymentTokenMock) ); @@ -95,7 +95,7 @@ public function testFormatPaymentTokenWithUnknownCardType() $this->tokenDetails['expirationDate'] ); - self::assertEquals( + $this->assertEquals( $formattedString, $this->creditCardTokenFormatter->formatPaymentToken($this->paymentTokenMock) ); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PayPal/TokenFormatterTest.php b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PayPal/TokenFormatterTest.php index e4cd8fd58043b..0aab4a3d8ee6e 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PayPal/TokenFormatterTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PayPal/TokenFormatterTest.php @@ -62,7 +62,7 @@ public function testFormatPaymentTokenWithKnownCardType() $this->tokenDetails['expirationDate'] ); - self::assertEquals($formattedString, $this->paypalTokenFormatter->formatPaymentToken($this->paymentTokenMock)); + $this->assertEquals($formattedString, $this->paypalTokenFormatter->formatPaymentToken($this->paymentTokenMock)); } /** @@ -84,7 +84,7 @@ public function testFormatPaymentTokenWithUnknownCardType() $this->tokenDetails['expirationDate'] ); - self::assertEquals($formattedString, $this->paypalTokenFormatter->formatPaymentToken($this->paymentTokenMock)); + $this->assertEquals($formattedString, $this->paypalTokenFormatter->formatPaymentToken($this->paymentTokenMock)); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PaymentAdditionalInformationProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PaymentAdditionalInformationProviderTest.php index 2631fcbe5f5b5..32e483b89fcde 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PaymentAdditionalInformationProviderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/InstantPurchase/PaymentAdditionalInformationProviderTest.php @@ -78,6 +78,6 @@ public function testGetAdditionalInformation() 'payment_method_nonce' => $paymentMethodNonce, ]; $actual = $this->paymentAdditionalInformationProvider->getAdditionalInformation($this->paymentTokenMock); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Model/LocaleResolverTest.php b/app/code/Magento/Braintree/Test/Unit/Model/LocaleResolverTest.php index b6ef534c55c29..d4e8fc41e531d 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/LocaleResolverTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/LocaleResolverTest.php @@ -55,7 +55,7 @@ public function testGetDefaultLocalePath() $expected = 'general/locale/code'; $this->resolverMock->expects($this->once())->method('getDefaultLocalePath')->willReturn($expected); $actual = $this->localeResolver->getDefaultLocalePath(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -80,7 +80,7 @@ public function testGetDefaultLocale() $expected = 'fr_FR'; $this->resolverMock->expects($this->once())->method('getDefaultLocale')->willReturn($expected); $actual = $this->localeResolver->getDefaultLocale(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -110,7 +110,7 @@ public function testGetLocale() $expected = 'en_US'; $actual = $this->localeResolver->getLocale(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php index c8524017274a4..5bd3edc83737e 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/OrderPlaceTest.php @@ -104,7 +104,7 @@ public function testExecuteGuest() $agreement = ['test', 'test']; $quoteMock = $this->getQuoteMock(); - $this->agreementsValidator->expects(self::once()) + $this->agreementsValidator->expects($this->once()) ->method('isValid') ->willReturn(true); @@ -112,14 +112,14 @@ public function testExecuteGuest() $this->prepareGuestQuoteStep($quoteMock); $this->disabledQuoteAddressValidationStep($quoteMock); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('collectTotals'); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('getId') ->willReturn(10); - $this->cartManagement->expects(self::once()) + $this->cartManagement->expects($this->once()) ->method('placeOrder') ->with(10); @@ -156,7 +156,7 @@ private function disabledQuoteAddressValidationStep(MockObject $quoteMock) $billingAddressMock->method('getEmail') ->willReturn(self::TEST_EMAIL); - $billingAddressMock->expects(self::never()) + $billingAddressMock->expects($this->never()) ->method('setSameAsBilling'); } @@ -170,7 +170,7 @@ private function getCheckoutMethodStep(MockObject $quoteMock) $this->customerSession->method('isLoggedIn') ->willReturn(false); - $quoteMock->expects(self::at(1)) + $quoteMock->expects($this->at(1)) ->method('getCheckoutMethod') ->willReturn(null); @@ -181,7 +181,7 @@ private function getCheckoutMethodStep(MockObject $quoteMock) $quoteMock->method('setCheckoutMethod') ->with(Onepage::METHOD_GUEST); - $quoteMock->expects(self::at(2)) + $quoteMock->expects($this->at(2)) ->method('getCheckoutMethod') ->willReturn(Onepage::METHOD_GUEST); } @@ -195,12 +195,12 @@ private function prepareGuestQuoteStep(MockObject $quoteMock) { $billingAddressMock = $this->getBillingAddressMock($quoteMock); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('setCustomerId') ->with(null) ->willReturnSelf(); - $billingAddressMock->expects(self::at(0)) + $billingAddressMock->expects($this->at(0)) ->method('getEmail') ->willReturn(self::TEST_EMAIL); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php index a2b5380d2884b..132c97794a202 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/QuoteUpdaterTest.php @@ -225,7 +225,7 @@ private function updateAddressDataStep(MockObject $address, array $addressData): */ private function updateQuoteAddressStep(MockObject $quoteMock, array $details): void { - $quoteMock->expects(self::exactly(2)) + $quoteMock->expects($this->exactly(2)) ->method('getIsVirtual') ->willReturn(false); @@ -268,7 +268,7 @@ private function updateQuoteStep(MockObject $quote, array $details): void $quote->method('getShippingAddress') ->willReturn($this->shippingAddress); - $quote->expects(self::exactly(2)) + $quote->expects($this->exactly(2)) ->method('getBillingAddress') ->willReturn($this->billingAddress); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php index c850a34cbdb95..63b5de6937f61 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Paypal/Helper/ShippingMethodUpdaterTest.php @@ -82,31 +82,31 @@ public function testExecute() { $quoteMock = $this->getQuoteMock(); - $quoteMock->expects(self::exactly(2)) + $quoteMock->expects($this->exactly(2)) ->method('getIsVirtual') ->willReturn(false); - $quoteMock->expects(self::exactly(2)) + $quoteMock->expects($this->exactly(2)) ->method('getShippingAddress') ->willReturn($this->shippingAddressMock); - $this->shippingAddressMock->expects(self::once()) + $this->shippingAddressMock->expects($this->once()) ->method('getShippingMethod') ->willReturn(self::TEST_SHIPPING_METHOD . '-bad'); $this->disabledQuoteAddressValidationStep($quoteMock); - $this->shippingAddressMock->expects(self::once()) + $this->shippingAddressMock->expects($this->once()) ->method('setShippingMethod') ->willReturn(self::TEST_SHIPPING_METHOD); - $this->shippingAddressMock->expects(self::once()) + $this->shippingAddressMock->expects($this->once()) ->method('setCollectShippingRates') ->willReturn(true); - $quoteMock->expects(self::once()) + $quoteMock->expects($this->once()) ->method('collectTotals'); - $this->quoteRepositoryMock->expects(self::once()) + $this->quoteRepositoryMock->expects($this->once()) ->method('save') ->with($quoteMock); @@ -120,21 +120,21 @@ private function disabledQuoteAddressValidationStep(\PHPUnit_Framework_MockObjec { $billingAddressMock = $this->getBillingAddressMock($quoteMock); - $billingAddressMock->expects(self::once()) + $billingAddressMock->expects($this->once()) ->method('setShouldIgnoreValidation') ->with(true) ->willReturnSelf(); - $this->shippingAddressMock->expects(self::once()) + $this->shippingAddressMock->expects($this->once()) ->method('setShouldIgnoreValidation') ->with(true) ->willReturnSelf(); - $billingAddressMock->expects(self::at(1)) + $billingAddressMock->expects($this->at(1)) ->method('getEmail') ->willReturn(self::TEST_EMAIL); - $billingAddressMock->expects(self::never()) + $billingAddressMock->expects($this->never()) ->method('setSameAsBilling'); } @@ -151,7 +151,7 @@ private function getBillingAddressMock(\PHPUnit_Framework_MockObject_MockObject ->getMock(); } - $quoteMock->expects(self::any()) + $quoteMock->expects($this->any()) ->method('getBillingAddress') ->willReturn($this->billingAddressMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php index f33af81b19746..b59cdd5dba334 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php @@ -203,7 +203,7 @@ public function testGetItemsWithNullLimit() */ public function testAddToFilter($field, $condition, $filterMapperCall, $expectedCondition) { - $this->filterMapperMock->expects(static::exactly($filterMapperCall)) + $this->filterMapperMock->expects($this->exactly($filterMapperCall)) ->method('getFilter') ->with($field, $expectedCondition) ->willReturn(new BraintreeSearchNodeStub()); @@ -214,7 +214,7 @@ public function testAddToFilter($field, $condition, $filterMapperCall, $expected $this->filterMapperMock ); - static::assertInstanceOf( + $this->assertInstanceOf( TransactionsCollection::class, $collection->addFieldToFilter($field, $condition) ); diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php index 499918d3d0119..bddc7b313c805 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php @@ -82,33 +82,33 @@ public function testGetComponentForToken() 'template' => 'vault.phtml' ]; - $this->config->expects(static::once()) + $this->config->expects($this->once()) ->method('getPayPalIcon') ->willReturn($icon); $paymentToken = $this->createMock(PaymentTokenInterface::class); - $paymentToken->expects(static::once()) + $paymentToken->expects($this->once()) ->method('getTokenDetails') ->willReturn('{"payerEmail":" ' . $payerEmail . '"}'); - $paymentToken->expects(static::once()) + $paymentToken->expects($this->once()) ->method('getPublicHash') ->willReturn('cmk32dl21l'); - $this->urlBuilder->expects(static::once()) + $this->urlBuilder->expects($this->once()) ->method('getUrl') ->willReturn($nonceUrl); $tokenComponent = $this->createMock(TokenUiComponentInterface::class); - $tokenComponent->expects(static::once()) + $tokenComponent->expects($this->once()) ->method('getConfig') ->willReturn($expected); - $this->componentFactory->expects(static::once()) + $this->componentFactory->expects($this->once()) ->method('create') ->willReturn($tokenComponent); $component = $this->tokenUiComponentProvider->getComponentForToken($paymentToken); - static::assertEquals($tokenComponent, $component); - static::assertEquals($expected, $component->getConfig()); + $this->assertEquals($tokenComponent, $component); + $this->assertEquals($expected, $component->getConfig()); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php index 192be9ccdb430..f12f970d579f1 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/Adminhtml/TokenUiComponentProviderTest.php @@ -70,28 +70,28 @@ public function testGetComponentForToken() ]; $paymentToken = $this->createMock(PaymentTokenInterface::class); - $paymentToken->expects(static::once()) + $paymentToken->expects($this->once()) ->method('getTokenDetails') ->willReturn('{"type":"VI","maskedCC":"1111","expirationDate":"12\/2015"}'); - $paymentToken->expects(static::once()) + $paymentToken->expects($this->once()) ->method('getPublicHash') ->willReturn('37du7ir5ed'); - $this->urlBuilder->expects(static::once()) + $this->urlBuilder->expects($this->once()) ->method('getUrl') ->willReturn($nonceUrl); $tokenComponent = $this->createMock(TokenUiComponentInterface::class); - $tokenComponent->expects(static::once()) + $tokenComponent->expects($this->once()) ->method('getConfig') ->willReturn($expected); - $this->componentFactory->expects(static::once()) + $this->componentFactory->expects($this->once()) ->method('create') ->willReturn($tokenComponent); $component = $this->tokenUiComponentProvider->getComponentForToken($paymentToken); - static::assertEquals($tokenComponent, $component); - static::assertEquals($expected, $component->getConfig()); + $this->assertEquals($tokenComponent, $component); + $this->assertEquals($expected, $component->getConfig()); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php index 24bc4eae960be..90a40291b2e0f 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php @@ -82,17 +82,17 @@ protected function setUp() */ public function testGetConfig($config, $expected) { - $this->braintreeAdapter->expects(static::once()) + $this->braintreeAdapter->expects($this->once()) ->method('generate') ->willReturn(self::CLIENT_TOKEN); foreach ($config as $method => $value) { - $this->config->expects(static::once()) + $this->config->expects($this->once()) ->method($method) ->willReturn($value); } - static::assertEquals($expected, $this->configProvider->getConfig()); + $this->assertEquals($expected, $this->configProvider->getConfig()); } /** @@ -101,16 +101,16 @@ public function testGetConfig($config, $expected) */ public function testGetClientToken($merchantAccountId, $params) { - $this->config->expects(static::once()) + $this->config->expects($this->once()) ->method('getMerchantAccountId') ->willReturn($merchantAccountId); - $this->braintreeAdapter->expects(static::once()) + $this->braintreeAdapter->expects($this->once()) ->method('generate') ->with($params) ->willReturn(self::CLIENT_TOKEN); - static::assertEquals(self::CLIENT_TOKEN, $this->configProvider->getClientToken()); + $this->assertEquals(self::CLIENT_TOKEN, $this->configProvider->getClientToken()); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/ConfigProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/ConfigProviderTest.php index 42469fe0faf45..be2ef928f0afd 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/ConfigProviderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/ConfigProviderTest.php @@ -80,7 +80,7 @@ public function testGetConfig($expected) $this->config->method('isRequiredBillingAddress') ->willReturn(1); - self::assertEquals($expected, $this->configProvider->getConfig()); + $this->assertEquals($expected, $this->configProvider->getConfig()); } /** diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/TokenUiComponentProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/TokenUiComponentProviderTest.php index 962cd56a7c5ac..a4e246b6ec0c0 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/TokenUiComponentProviderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/PayPal/TokenUiComponentProviderTest.php @@ -71,22 +71,22 @@ public function testGetComponentForToken() ]; $hash = '4g1mn4ew0vj23n2jf'; - $this->paymentToken->expects(static::once()) + $this->paymentToken->expects($this->once()) ->method('getTokenDetails') ->willReturn(json_encode($tokenDetails)); - $this->componentFactory->expects(static::once()) + $this->componentFactory->expects($this->once()) ->method('create') ->willReturn($this->tokenComponent); - $this->paymentToken->expects(static::once()) + $this->paymentToken->expects($this->once()) ->method('getPublicHash') ->willReturn($hash); - $this->urlBuilder->expects(static::once()) + $this->urlBuilder->expects($this->once()) ->method('getUrl'); $actual = $this->componentProvider->getComponentForToken($this->paymentToken); - static::assertEquals($this->tokenComponent, $actual); + $this->assertEquals($this->tokenComponent, $actual); } } diff --git a/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php b/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php index 377b4d3c650ae..15668c0aa07a8 100644 --- a/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Observer/AddPaypalShortcutsTest.php @@ -46,24 +46,24 @@ public function testExecute() ->disableOriginalConstructor() ->getMock(); - $observerMock->expects(self::once()) + $observerMock->expects($this->once()) ->method('getEvent') ->willReturn($eventMock); - $eventMock->expects(self::once()) + $eventMock->expects($this->once()) ->method('getContainer') ->willReturn($shortcutButtonsMock); - $shortcutButtonsMock->expects(self::once()) + $shortcutButtonsMock->expects($this->once()) ->method('getLayout') ->willReturn($layoutMock); - $layoutMock->expects(self::once()) + $layoutMock->expects($this->once()) ->method('createBlock') ->with(AddPaypalShortcuts::PAYPAL_SHORTCUT_BLOCK) ->willReturn($blockMock); - $shortcutButtonsMock->expects(self::once()) + $shortcutButtonsMock->expects($this->once()) ->method('addShortcut') ->with($blockMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php b/app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php index d4c7a3e19656e..1c02e913e2140 100644 --- a/app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php @@ -37,10 +37,10 @@ public function testExecute() ] ] ); - $observerContainer->expects(static::atLeastOnce()) + $observerContainer->expects($this->atLeastOnce()) ->method('getEvent') ->willReturn($event); - $event->expects(static::exactly(2)) + $event->expects($this->exactly(2)) ->method('getDataByKey') ->willReturnMap( [ @@ -48,10 +48,10 @@ public function testExecute() [AbstractDataAssignObserver::DATA_CODE, $dataObject] ] ); - $paymentInfoModel->expects(static::at(0)) + $paymentInfoModel->expects($this->at(0)) ->method('setAdditionalInformation') ->with('payment_method_nonce', self::PAYMENT_METHOD_NONCE); - $paymentInfoModel->expects(static::at(1)) + $paymentInfoModel->expects($this->at(1)) ->method('setAdditionalInformation') ->with('device_data', self::DEVICE_DATA); diff --git a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php index 8e463aa75d7aa..8dd6f73034737 100644 --- a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php @@ -53,7 +53,7 @@ protected function setUp() $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class) ->disableOriginalConstructor() ->getMock(); - $this->contextMock->expects(static::atLeastOnce()) + $this->contextMock->expects($this->atLeastOnce()) ->method('getProcessor') ->willReturn($processor); $this->uiComponentFactory = $this->getMockBuilder(UiComponentFactory::class) @@ -108,7 +108,7 @@ public function testPrepare($name, $filterData, $expectedCondition) if ($expectedCondition !== null) { if (is_string($filterData[$name])) { - $uiComponent->expects(static::once()) + $uiComponent->expects($this->once()) ->method('convertDate') ->with($filterData[$name]) ->willReturn(new \DateTime($filterData[$name], new \DateTimeZone('UTC'))); @@ -137,7 +137,7 @@ public function testPrepare($name, $filterData, $expectedCondition) $expectedCondition['date'], $i ); - $this->dataProviderMock->expects(static::once()) + $this->dataProviderMock->expects($this->once()) ->method('addFilter') ->with($filterMock); break; @@ -154,7 +154,7 @@ public function testPrepare($name, $filterData, $expectedCondition) $expectedCondition['date_to'], $i ); - $this->dataProviderMock->expects(static::exactly(2)) + $this->dataProviderMock->expects($this->exactly(2)) ->method('addFilter') ->with($filterMock); break; @@ -189,21 +189,21 @@ public function testPrepare($name, $filterData, $expectedCondition) */ private function getFilterMock($name, $expectedType, $expectedDate, &$i) { - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('setConditionType') ->with($expectedType) ->willReturnSelf(); - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('setField') ->with($name) ->willReturnSelf(); - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('setValue') ->with($expectedDate) ->willReturnSelf(); $filterMock = $this->createMock(Filter::class); - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('create') ->willReturn($filterMock); diff --git a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php index 988b1658f3032..967854ea013b1 100644 --- a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Listing/Column/CheckColumnOptionSourceTest.php @@ -19,7 +19,7 @@ public function testPaymentTypeSource() $source = new PaymentType(); $options = $source->toOptionArray(); - static::assertEquals(6, count($options)); + $this->assertEquals(6, count($options)); } public function testStatusSource() @@ -27,7 +27,7 @@ public function testStatusSource() $source = new Status(); $options = $source->toOptionArray(); - static::assertEquals(14, count($options)); + $this->assertEquals(14, count($options)); } public function testTransactionTypeSource() @@ -35,6 +35,6 @@ public function testTransactionTypeSource() $source = new TransactionType(); $options = $source->toOptionArray(); - static::assertEquals(2, count($options)); + $this->assertEquals(2, count($options)); } } diff --git a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php index 4463709391102..165c4a32654c2 100644 --- a/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Pricing/Price/FinalPriceTest.php @@ -197,7 +197,7 @@ public function testGetMinimalPriceFixedBundleWithOption() ->getMockForAbstractClass() ]; - $this->productOptionRepositoryMock->expects(static::once()) + $this->productOptionRepositoryMock->expects($this->once()) ->method('getProductOptions') ->with($this->saleableInterfaceMock) ->willReturn($customOptions); diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleSkuTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleSkuTest.php index b501bea7a0259..fd584edcafe2f 100644 --- a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleSkuTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleSkuTest.php @@ -49,7 +49,7 @@ public function testModifyMeta() ] ]; - $this->arrayManagerMock->expects(static::any()) + $this->arrayManagerMock->expects($this->any()) ->method('findPath') ->willReturnMap( [ diff --git a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleWeightTest.php b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleWeightTest.php index 8c89a18c292f6..29c636a22daa2 100644 --- a/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleWeightTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleWeightTest.php @@ -104,7 +104,7 @@ public function testModifyMeta() ] ]; - $this->arrayManagerMock->expects(static::any()) + $this->arrayManagerMock->expects($this->any()) ->method('findPath') ->willReturnMap( [ diff --git a/app/code/Magento/Captcha/Test/Unit/Observer/CaptchaStringResolverTest.php b/app/code/Magento/Captcha/Test/Unit/Observer/CaptchaStringResolverTest.php index 2bd8ac6f16986..0e90f522e6345 100644 --- a/app/code/Magento/Captcha/Test/Unit/Observer/CaptchaStringResolverTest.php +++ b/app/code/Magento/Captcha/Test/Unit/Observer/CaptchaStringResolverTest.php @@ -46,7 +46,7 @@ public function testResolveWithFormIdSet() ->with(CaptchaDataHelper::INPUT_NAME_FIELD_VALUE) ->willReturn([$formId => $captchaValue]); - self::assertEquals( + $this->assertEquals( $this->captchaStringResolver->resolve($this->requestMock, $formId), $captchaValue ); @@ -61,7 +61,7 @@ public function testResolveWithNoFormIdInRequest() ->with(CaptchaDataHelper::INPUT_NAME_FIELD_VALUE) ->willReturn([]); - self::assertEquals( + $this->assertEquals( $this->captchaStringResolver->resolve($this->requestMock, $formId), '' ); diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php index d003c6d01373f..f9f59e2521a96 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/AbstractProductTest.php @@ -199,12 +199,12 @@ public function testGetImage() $attributes = []; $productMock = $this->createMock(Product::class); $imageMock = $this->createMock(Image::class); - $this->imageBuilder->expects(static::once()) + $this->imageBuilder->expects($this->once()) ->method('create') ->willReturn($imageMock); $image = $this->block->getImage($productMock, $imageId, $attributes); - static::assertInstanceOf(Image::class, $image); + $this->assertInstanceOf(Image::class, $image); } } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageFactoryTest.php index 95b06e40602bf..f8bb321fc7000 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ImageFactoryTest.php @@ -79,12 +79,12 @@ public function testCreate($data, $expected) $this->paramsBuilder->method('build')->willReturn($data['imageParamsBuilder']); $viewAssetImage->method('getUrl')->willReturn($data['url']); - $this->objectManager->expects(self::once()) + $this->objectManager->expects($this->once()) ->method('create') ->with(Image::class, $expected) ->willReturn($imageBlock); $actual = $this->model->create($product, 'image_id', $data['custom_attributes']); - self::assertInstanceOf(Image::class, $actual); + $this->assertInstanceOf(Image::class, $actual); } /** diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php index a81d8b1c9fc3c..427f33a3a5540 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/View/GalleryTest.php @@ -183,7 +183,7 @@ public function testGetGalleryImages() { $productMock = $this->createMock(Product::class); $productTypeMock = $this->createMock(AbstractType::class); - $productTypeMock->expects(static::once()) + $productTypeMock->expects($this->once()) ->method('getStoreFilter') ->with($productMock) ->willReturn($this->createMock(Store::class)); @@ -195,16 +195,16 @@ public function testGetGalleryImages() $productMock->method('getTypeInstance')->willReturn($productTypeMock); $productMock->method('getMediaGalleryImages')->willReturn($imagesCollection); - $this->registry->expects(static::once()) + $this->registry->expects($this->once()) ->method('registry') ->with('product') ->willReturn($productMock); - $this->galleryImagesConfigMock->expects(static::exactly(1)) + $this->galleryImagesConfigMock->expects($this->exactly(1)) ->method('getItems') ->willReturn($this->getGalleryImagesConfigItems()); $images = $this->model->getGalleryImages(); - static::assertInstanceOf(Collection::class, $images); + $this->assertInstanceOf(Collection::class, $images); } /** diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/ReadHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/ReadHandlerTest.php index 5879c38cada9e..a1c738dd12c23 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/ReadHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/ReadHandlerTest.php @@ -73,10 +73,10 @@ public function testExecute() foreach ($categoryLinks as $key => $categoryLink) { $dtoCategoryLinks[$key] = $this->getMockBuilder(CategoryLinkInterface::class) ->getMockForAbstractClass(); - $this->dataObjectHelper->expects(static::at($key)) + $this->dataObjectHelper->expects($this->at($key)) ->method('populateWithArray') ->with($dtoCategoryLinks[$key], $categoryLink, CategoryLinkInterface::class); - $this->categoryLinkFactory->expects(static::at($key)) + $this->categoryLinkFactory->expects($this->at($key)) ->method('create') ->willReturn($dtoCategoryLinks[$key]); } @@ -90,23 +90,23 @@ public function testExecute() ->disableOriginalConstructor() ->setMethods(['setCategoryLinks']) ->getMockForAbstractClass(); - $extensionAttributes->expects(static::once())->method('setCategoryLinks')->with($dtoCategoryLinks); + $extensionAttributes->expects($this->once())->method('setCategoryLinks')->with($dtoCategoryLinks); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $product->expects(static::once()) + $product->expects($this->once()) ->method('setExtensionAttributes') ->with($extensionAttributes); - $this->productCategoryLink->expects(static::any()) + $this->productCategoryLink->expects($this->any()) ->method('getCategoryLinks') ->with($product) ->willReturn($categoryLinks); $entity = $this->readHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } public function testExecuteNullExtensionAttributes() @@ -120,22 +120,22 @@ public function testExecuteNullExtensionAttributes() ->disableOriginalConstructor() ->setMethods(['setCategoryLinks']) ->getMockForAbstractClass(); - $extensionAttributes->expects(static::once())->method('setCategoryLinks')->with(null); + $extensionAttributes->expects($this->once())->method('setCategoryLinks')->with(null); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $product->expects(static::once()) + $product->expects($this->once()) ->method('setExtensionAttributes') ->with($extensionAttributes); - $this->productCategoryLink->expects(static::any()) + $this->productCategoryLink->expects($this->any()) ->method('getCategoryLinks') ->with($product) ->willReturn([]); $entity = $this->readHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/SaveHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/SaveHandlerTest.php index 0b85ef38387fa..22be9f1fb1888 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/SaveHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Category/Link/SaveHandlerTest.php @@ -70,10 +70,10 @@ protected function setUp() public function testExecute($categoryIds, $categoryLinks, $existCategoryLinks, $expectedCategoryLinks, $affectedIds) { if ($categoryLinks) { - $this->hydrator->expects(static::any()) + $this->hydrator->expects($this->any()) ->method('extract') ->willReturnArgument(0); - $this->hydratorPool->expects(static::once()) + $this->hydratorPool->expects($this->once()) ->method('getHydrator') ->with(CategoryLinkInterface::class) ->willReturn($this->hydrator); @@ -83,7 +83,7 @@ public function testExecute($categoryIds, $categoryLinks, $existCategoryLinks, $ ->disableOriginalConstructor() ->setMethods(['setCategoryLinks', 'getCategoryLinks']) ->getMockForAbstractClass(); - $extensionAttributes->expects(static::any()) + $extensionAttributes->expects($this->any()) ->method('getCategoryLinks') ->willReturn($categoryLinks); @@ -98,33 +98,33 @@ public function testExecute($categoryIds, $categoryLinks, $existCategoryLinks, $ ] ) ->getMock(); - $product->expects(static::at(0))->method('setIsChangedCategories')->with(false); - $product->expects(static::once()) + $product->expects($this->at(0))->method('setIsChangedCategories')->with(false); + $product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $product->expects(static::any()) + $product->expects($this->any()) ->method('getCategoryIds') ->willReturn($categoryIds); - $this->productCategoryLink->expects(static::any()) + $this->productCategoryLink->expects($this->any()) ->method('saveCategoryLinks') ->with($product, $expectedCategoryLinks) ->willReturn($affectedIds); if (!empty($affectedIds)) { - $product->expects(static::once()) + $product->expects($this->once()) ->method('setAffectedCategoryIds') ->with($affectedIds); - $product->expects(static::exactly(2))->method('setIsChangedCategories'); + $product->expects($this->exactly(2))->method('setIsChangedCategories'); } - $this->productCategoryLink->expects(static::any()) + $this->productCategoryLink->expects($this->any()) ->method('getCategoryLinks') ->with($product, $categoryIds) ->willReturn($existCategoryLinks); $entity = $this->saveHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } /** @@ -221,14 +221,14 @@ public function testExecuteWithoutProcess() ->disableOriginalConstructor() ->setMethods(['getExtensionAttributes', 'hasCategoryIds']) ->getMock(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn(null); - $product->expects(static::any()) + $product->expects($this->any()) ->method('hasCategoryIds') ->willReturn(false); $entity = $this->saveHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php index fb90eaaaf1ec5..d1558416482c7 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CustomOptions/CustomOptionTest.php @@ -64,7 +64,7 @@ protected function setUp() ->setMethods(['getFileInfo']) ->getMockForAbstractClass(); - $this->extensionAttributesFactoryMock->expects(self::any()) + $this->extensionAttributesFactoryMock->expects($this->any()) ->method('create')->willReturn($this->extensionMock); $this->model = new CustomOption( diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php index 2f80f813f9a6e..7b7109eb25638 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Plugin/IndexerConfigDataTest.php @@ -59,7 +59,7 @@ protected function setUp() */ public function testAfterGet($isFlat, $path, $default, $inputData, $outputData) { - $this->indexerStateMock->expects(static::once()) + $this->indexerStateMock->expects($this->once()) ->method('isFlatEnabled') ->willReturn($isFlat); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Plugin/QuoteItemProductOptionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Plugin/QuoteItemProductOptionTest.php index 89f848750de65..01931e1e3eef7 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Plugin/QuoteItemProductOptionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Plugin/QuoteItemProductOptionTest.php @@ -72,7 +72,7 @@ protected function setUp() public function testBeforeItemToOrderItemEmptyOptions() { - $this->quoteItemMock->expects(static::once()) + $this->quoteItemMock->expects($this->once()) ->method('getOptions') ->willReturn(null); @@ -81,16 +81,16 @@ public function testBeforeItemToOrderItemEmptyOptions() public function testBeforeItemToOrderItemWithOptions() { - $this->quoteItemMock->expects(static::exactly(2)) + $this->quoteItemMock->expects($this->exactly(2)) ->method('getOptions') ->willReturn([$this->quoteItemOptionMock, $this->quoteItemOptionMock]); - $this->quoteItemOptionMock->expects(static::exactly(2)) + $this->quoteItemOptionMock->expects($this->exactly(2)) ->method('getCode') ->willReturnOnConsecutiveCalls('someText_8', 'not_int_text'); - $this->productMock->expects(static::once()) + $this->productMock->expects($this->once()) ->method('getOptionById') ->willReturn(new DataObject(['type' => ProductOption::OPTION_TYPE_FILE])); - $this->quoteItemMock->expects(static::once()) + $this->quoteItemMock->expects($this->once()) ->method('getProduct') ->willReturn($this->productMock); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/ImageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/ImageTest.php index 430db70701356..1d1fa29820877 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/ImageTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/ImageTest.php @@ -234,7 +234,7 @@ public function testSetGetBaseFile() 'angle' => null, 'quality' => 80, ]; - $this->paramsBuilder->expects(self::once()) + $this->paramsBuilder->expects($this->once()) ->method('build') ->willReturn($miscParams); $this->mediaDirectory->expects($this->any())->method('isFile')->will($this->returnValue(true)); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php index 9867fdf910219..1879d40dd2575 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php @@ -941,7 +941,7 @@ public function testGetIsSalableSimple() $this->model->setTypeInstance($typeInstanceMock); - self::assertTrue($this->model->getIsSalable()); + $this->assertTrue($this->model->getIsSalable()); } public function testGetIsSalableHasDataIsSaleable() @@ -952,7 +952,7 @@ public function testGetIsSalableHasDataIsSaleable() $this->model->setData('is_saleable', true); $this->model->setData('is_salable', false); - self::assertTrue($this->model->getIsSalable()); + $this->assertTrue($this->model->getIsSalable()); } /** @@ -1280,7 +1280,7 @@ public function testGetMediaGalleryImagesMerging() [3, 'not_null_skeep_foreache'], ] ); - $imagesCollectionMock->expects(self::exactly(2))->method('addItem')->withConsecutive( + $imagesCollectionMock->expects($this->exactly(2))->method('addItem')->withConsecutive( $expectedImageDataObject, $expectedSmallImageDataObject ); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php b/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php index eb7b70c8a1718..44a64fb17b4eb 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/View/Asset/ImageTest.php @@ -123,7 +123,7 @@ public function testGetPath($filePath, $miscParams) $hashPath = md5(implode('_', $miscParams)); $this->context->method('getPath')->willReturn($absolutePath); $this->encryptor->method('hash')->willReturn($hashPath); - static::assertEquals( + $this->assertEquals( $absolutePath . '/cache/'. $hashPath . $filePath, $imageModel->getPath() ); @@ -150,9 +150,9 @@ public function testGetUrl($filePath, $miscParams) $miscParams['background'] = isset($miscParams['background']) ? implode(',', $miscParams['background']) : ''; $absolutePath = 'http://localhost/pub/media/catalog/product'; $hashPath = md5(implode('_', $miscParams)); - $this->context->expects(static::once())->method('getBaseUrl')->willReturn($absolutePath); - $this->encryptor->expects(static::once())->method('hash')->willReturn($hashPath); - static::assertEquals( + $this->context->expects($this->once())->method('getBaseUrl')->willReturn($absolutePath); + $this->encryptor->expects($this->once())->method('hash')->willReturn($hashPath); + $this->assertEquals( $absolutePath . '/cache/' . $hashPath . $filePath, $imageModel->getUrl() ); diff --git a/app/code/Magento/Catalog/Test/Unit/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php b/app/code/Magento/Catalog/Test/Unit/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php index 712aeba59dffe..5be5e4dc39bdd 100644 --- a/app/code/Magento/Catalog/Test/Unit/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php @@ -58,13 +58,13 @@ public function testAfterDelete() $collection = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); - $collection->expects(self::once()) + $collection->expects($this->once()) ->method('addFieldToFilter') - ->with(self::identicalTo('attribute_set_id'), self::identicalTo(['eq' => $attributeSetId])); - $collection->expects(self::once()) + ->with($this->identicalTo('attribute_set_id'), $this->identicalTo(['eq' => $attributeSetId])); + $collection->expects($this->once()) ->method('delete'); - $this->collectionFactory->expects(self::once()) + $this->collectionFactory->expects($this->once()) ->method('create') ->willReturn($collection); @@ -78,10 +78,10 @@ public function testAfterDelete() ->setMethods(['getId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $attributeSet->expects(self::once()) + $attributeSet->expects($this->once()) ->method('getId') ->willReturn($attributeSetId); - self::assertTrue($this->testSubject->afterDelete($attributeSetRepository, true, $attributeSet)); + $this->assertTrue($this->testSubject->afterDelete($attributeSetRepository, true, $attributeSet)); } } diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php index 7804104490958..4705d32db0258 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Price/TierPriceTest.php @@ -260,7 +260,7 @@ public function testGetterTierPriceList($tierPrices, $basePrice, $expectedResult $this->calculator->expects($this->atLeastOnce())->method('getAmount') ->will($this->returnArgument(0)); - $this->priceInfo->expects(static::atLeastOnce()) + $this->priceInfo->expects($this->atLeastOnce()) ->method('getPrice') ->with(FinalPrice::PRICE_CODE) ->willReturn($price); diff --git a/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php index 397cd0fb2d165..cd399ebc32bde 100644 --- a/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php @@ -413,8 +413,8 @@ public function testGetCacheKeyInfoContainsDisplayMinimalPrice() public function testGetCacheKeyInfoContainsIsProductListFlagByDefault() { $cacheInfo = $this->object->getCacheKeyInfo(); - self::assertArrayHasKey('is_product_list', $cacheInfo); - self::assertFalse($cacheInfo['is_product_list']); + $this->assertArrayHasKey('is_product_list', $cacheInfo); + $this->assertFalse($cacheInfo['is_product_list']); } /** @@ -427,8 +427,8 @@ public function testGetCacheKeyInfoContainsIsProductListFlag($flag) { $this->object->setData('is_product_list', $flag); $cacheInfo = $this->object->getCacheKeyInfo(); - self::assertArrayHasKey('is_product_list', $cacheInfo); - self::assertEquals($flag, $cacheInfo['is_product_list']); + $this->assertArrayHasKey('is_product_list', $cacheInfo); + $this->assertEquals($flag, $cacheInfo['is_product_list']); } /** @@ -436,7 +436,7 @@ public function testGetCacheKeyInfoContainsIsProductListFlag($flag) */ public function testIsProductListByDefault() { - self::assertFalse($this->object->isProductList()); + $this->assertFalse($this->object->isProductList()); } /** @@ -448,7 +448,7 @@ public function testIsProductListByDefault() public function testIsProductList($flag) { $this->object->setData('is_product_list', $flag); - self::assertEquals($flag, $this->object->isProductList()); + $this->assertEquals($flag, $this->object->isProductList()); } /** diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Observer/AddStockItemsObserverTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Observer/AddStockItemsObserverTest.php index 8de05bd014039..53b73815a8500 100644 --- a/app/code/Magento/CatalogInventory/Test/Unit/Observer/AddStockItemsObserverTest.php +++ b/app/code/Magento/CatalogInventory/Test/Unit/Observer/AddStockItemsObserverTest.php @@ -83,16 +83,16 @@ public function testExecute() ->setMethods(['setProductsFilter', 'setScopeFilter']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $criteria->expects(self::once()) + $criteria->expects($this->once()) ->method('setProductsFilter') - ->with(self::identicalTo([$productId])) + ->with($this->identicalTo([$productId])) ->willReturn(true); - $criteria->expects(self::once()) + $criteria->expects($this->once()) ->method('setScopeFilter') - ->with(self::identicalTo($defaultScopeId)) + ->with($this->identicalTo($defaultScopeId)) ->willReturn(true); - $this->criteriaInterfaceFactoryMock->expects(self::once()) + $this->criteriaInterfaceFactoryMock->expects($this->once()) ->method('create') ->willReturn($criteria); $stockItemCollection = $this->getMockBuilder(StockItemCollectionInterface::class) @@ -103,20 +103,20 @@ public function testExecute() ->setMethods(['getProductId']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $stockItem->expects(self::once()) + $stockItem->expects($this->once()) ->method('getProductId') ->willReturn($productId); - $stockItemCollection->expects(self::once()) + $stockItemCollection->expects($this->once()) ->method('getItems') ->willReturn([$stockItem]); - $this->stockItemRepositoryMock->expects(self::once()) + $this->stockItemRepositoryMock->expects($this->once()) ->method('getList') - ->with(self::identicalTo($criteria)) + ->with($this->identicalTo($criteria)) ->willReturn($stockItemCollection); - $this->stockConfigurationMock->expects(self::once()) + $this->stockConfigurationMock->expects($this->once()) ->method('getDefaultScopeId') ->willReturn($defaultScopeId); @@ -124,38 +124,38 @@ public function testExecute() ->setMethods(['setStockItem']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $productExtension->expects(self::once()) + $productExtension->expects($this->once()) ->method('setStockItem') - ->with(self::identicalTo($stockItem)); + ->with($this->identicalTo($stockItem)); $product = $this->getMockBuilder(Product::class) ->disableOriginalConstructor() ->getMock(); - $product->expects(self::once()) + $product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($productExtension); - $product->expects(self::once()) + $product->expects($this->once()) ->method('setExtensionAttributes') - ->with(self::identicalTo($productExtension)) + ->with($this->identicalTo($productExtension)) ->willReturnSelf(); /** @var ProductCollection|\PHPUnit_Framework_MockObject_MockObject $productCollection */ $productCollection = $this->getMockBuilder(ProductCollection::class) ->disableOriginalConstructor() ->getMock(); - $productCollection->expects(self::once()) + $productCollection->expects($this->once()) ->method('getItems') ->willReturn([$productId => $product]); - $productCollection->expects(self::once()) + $productCollection->expects($this->once()) ->method('getItemById') - ->with(self::identicalTo($productId)) + ->with($this->identicalTo($productId)) ->willReturn($product); /** @var Observer|\PHPUnit_Framework_MockObject_MockObject $observer */ $observer = $this->getMockBuilder(Observer::class) ->disableOriginalConstructor() ->getMock(); - $observer->expects(self::once()) + $observer->expects($this->once()) ->method('getData') ->with('collection') ->willReturn($productCollection); diff --git a/app/code/Magento/CatalogRule/Test/Unit/Plugin/Indexer/Product/Save/ApplyRulesAfterReindexTest.php b/app/code/Magento/CatalogRule/Test/Unit/Plugin/Indexer/Product/Save/ApplyRulesAfterReindexTest.php index fe79c455ec1cd..055bf6f860901 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Plugin/Indexer/Product/Save/ApplyRulesAfterReindexTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Plugin/Indexer/Product/Save/ApplyRulesAfterReindexTest.php @@ -52,10 +52,10 @@ public function testAfterReindex() { $id = 'test_id'; - $this->subjectMock->expects(static::any()) + $this->subjectMock->expects($this->any()) ->method('getId') ->willReturn($id); - $this->productRuleProcessorMock->expects(static::once()) + $this->productRuleProcessorMock->expects($this->once()) ->method('reindexRow') ->with($id, false); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Block/Plugin/FrontTabPluginTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Block/Plugin/FrontTabPluginTest.php index 18e96171de5a1..55d316efe91e6 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Block/Plugin/FrontTabPluginTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Block/Plugin/FrontTabPluginTest.php @@ -92,14 +92,14 @@ public function testBeforeSetForm() { $weightOptions = [1 => '1', 2 => '2']; - $this->formMock->expects(static::any()) + $this->formMock->expects($this->any()) ->method('getElement') ->with('front_fieldset') ->willReturn($this->fieldsetMock); - $this->weightSourceMock->expects(static::any()) + $this->weightSourceMock->expects($this->any()) ->method('getOptions') ->willReturn($weightOptions); - $this->fieldsetMock->expects(static::once()) + $this->fieldsetMock->expects($this->once()) ->method('addField') ->with( 'search_weight', @@ -113,15 +113,15 @@ public function testBeforeSetForm() false ) ->willReturn($this->childElementMock); - $this->subjectMock->expects(static::any()) + $this->subjectMock->expects($this->any()) ->method('getChildBlock') ->with('form_after') ->willReturn($this->childBlockMock); - $this->childBlockMock->expects(static::once()) + $this->childBlockMock->expects($this->once()) ->method('addFieldMap') ->with('search_weight', 'search_weight') ->willReturnSelf(); - $this->childBlockMock->expects(static::once()) + $this->childBlockMock->expects($this->once()) ->method('addFieldDependence') ->with('search_weight', 'searchable', '1') ->willReturnSelf(); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Attribute/SearchWeightTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Attribute/SearchWeightTest.php index 60e4165b82d9e..a2034943484f5 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Attribute/SearchWeightTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Attribute/SearchWeightTest.php @@ -69,33 +69,33 @@ protected function setUp() public function testSaveNewAttribute() { - $this->attribute->expects(self::once())->method('isObjectNew')->willReturn(true); - $this->attribute->expects(self::once())->method('dataHasChangedFor')->with('search_weight')->willReturn(false); - $this->config->expects(self::once())->method('reset'); + $this->attribute->expects($this->once())->method('isObjectNew')->willReturn(true); + $this->attribute->expects($this->once())->method('dataHasChangedFor')->with('search_weight')->willReturn(false); + $this->config->expects($this->once())->method('reset'); $this->searchWeightPlugin->aroundSave($this->attributeResourceModel, $this->closure, $this->attribute); } public function testSaveNewAttributeWithChangedProperty() { - $this->attribute->expects(self::once())->method('isObjectNew')->willReturn(true); - $this->attribute->expects(self::once())->method('dataHasChangedFor')->with('search_weight')->willReturn(true); - $this->config->expects(self::once())->method('reset'); + $this->attribute->expects($this->once())->method('isObjectNew')->willReturn(true); + $this->attribute->expects($this->once())->method('dataHasChangedFor')->with('search_weight')->willReturn(true); + $this->config->expects($this->once())->method('reset'); $this->searchWeightPlugin->aroundSave($this->attributeResourceModel, $this->closure, $this->attribute); } public function testSaveNotNewAttributeWithChangedProperty() { - $this->attribute->expects(self::once())->method('isObjectNew')->willReturn(false); - $this->attribute->expects(self::once())->method('dataHasChangedFor')->with('search_weight')->willReturn(true); - $this->config->expects(self::once())->method('reset'); + $this->attribute->expects($this->once())->method('isObjectNew')->willReturn(false); + $this->attribute->expects($this->once())->method('dataHasChangedFor')->with('search_weight')->willReturn(true); + $this->config->expects($this->once())->method('reset'); $this->searchWeightPlugin->aroundSave($this->attributeResourceModel, $this->closure, $this->attribute); } public function testSaveNotNewAttributeWithNotChangedProperty() { - $this->attribute->expects(self::once())->method('isObjectNew')->willReturn(false); - $this->attribute->expects(self::once())->method('dataHasChangedFor')->with('search_weight')->willReturn(false); - $this->config->expects(self::never())->method('reset'); + $this->attribute->expects($this->once())->method('isObjectNew')->willReturn(false); + $this->attribute->expects($this->once())->method('dataHasChangedFor')->with('search_weight')->willReturn(false); + $this->config->expects($this->never())->method('reset'); $this->searchWeightPlugin->aroundSave($this->attributeResourceModel, $this->closure, $this->attribute); } } diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Product/ActionTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Product/ActionTest.php index 4cb7571f2a156..e9455e9ec24f4 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Product/ActionTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Product/ActionTest.php @@ -50,7 +50,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->indexerRegistryMock->expects(static::once()) + $this->indexerRegistryMock->expects($this->once()) ->method('get') ->with(FulltextIndexer::INDEXER_ID) ->willReturn($this->indexerMock); @@ -66,10 +66,10 @@ public function testAfterUpdateAttributesNonScheduled() { $productIds = [1, 2, 3]; - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('isScheduled') ->willReturn(false); - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('reindexList') ->with($productIds); @@ -83,10 +83,10 @@ public function testAfterUpdateAttributesScheduled() { $productIds = [1, 2, 3]; - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('isScheduled') ->willReturn(true); - $this->indexerMock->expects(static::never()) + $this->indexerMock->expects($this->never()) ->method('reindexList'); $this->assertSame( @@ -99,10 +99,10 @@ public function testAfterUpdateWebsitesNonScheduled() { $productIds = [1, 2, 3]; - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('isScheduled') ->willReturn(false); - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('reindexList') ->with($productIds); @@ -113,10 +113,10 @@ public function testAfterUpdateWebsitesScheduled() { $productIds = [1, 2, 3]; - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('isScheduled') ->willReturn(true); - $this->indexerMock->expects(static::never()) + $this->indexerMock->expects($this->never()) ->method('reindexList'); $this->plugin->afterUpdateWebsites($this->subjectMock, $this->subjectMock, $productIds, [], null); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php index b8717bfcfe381..c27db63c8c88c 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/GroupTest.php @@ -77,14 +77,14 @@ protected function setUp() public function testBeforeAfterSave($isObjectNew, $websiteChanged, $invalidateCounter) { $this->prepareIndexer($invalidateCounter); - $this->storeGroupMock->expects(static::any()) + $this->storeGroupMock->expects($this->any()) ->method('dataHasChangedFor') ->with('website_id') ->willReturn($websiteChanged); - $this->storeGroupMock->expects(static::once()) + $this->storeGroupMock->expects($this->once()) ->method('isObjectNew') ->willReturn($isObjectNew); - $this->indexerMock->expects(static::exactly($invalidateCounter)) + $this->indexerMock->expects($this->exactly($invalidateCounter)) ->method('invalidate'); $this->plugin->beforeSave($this->subjectMock, $this->storeGroupMock); @@ -107,7 +107,7 @@ public function beforeAfterSaveDataProvider() public function testAfterDelete() { $this->prepareIndexer(1); - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('invalidate'); $this->assertSame($this->subjectMock, $this->plugin->afterDelete($this->subjectMock, $this->subjectMock)); @@ -121,7 +121,7 @@ public function testAfterDelete() */ private function prepareIndexer($invalidateCounter) { - $this->indexerRegistryMock->expects(static::exactly($invalidateCounter)) + $this->indexerRegistryMock->expects($this->exactly($invalidateCounter)) ->method('get') ->with(FulltextIndexer::INDEXER_ID) ->willReturn($this->indexerMock); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/ViewTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/ViewTest.php index 070c9b46f6067..9fb8994ba0699 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/ViewTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/Store/ViewTest.php @@ -76,10 +76,10 @@ protected function setUp() public function testBeforeAfterSave($isObjectNew, $invalidateCounter) { $this->prepareIndexer($invalidateCounter); - $this->storeMock->expects(static::once()) + $this->storeMock->expects($this->once()) ->method('isObjectNew') ->willReturn($isObjectNew); - $this->indexerMock->expects(static::exactly($invalidateCounter)) + $this->indexerMock->expects($this->exactly($invalidateCounter)) ->method('invalidate'); $this->plugin->beforeSave($this->subjectMock, $this->storeMock); @@ -100,7 +100,7 @@ public function beforeAfterSaveDataProvider() public function testAfterDelete() { $this->prepareIndexer(1); - $this->indexerMock->expects(static::once()) + $this->indexerMock->expects($this->once()) ->method('invalidate'); $this->assertSame($this->subjectMock, $this->plugin->afterDelete($this->subjectMock, $this->subjectMock)); @@ -114,7 +114,7 @@ public function testAfterDelete() */ private function prepareIndexer($invalidateCounter) { - $this->indexerRegistryMock->expects(static::exactly($invalidateCounter)) + $this->indexerRegistryMock->expects($this->exactly($invalidateCounter)) ->method('get') ->with(FulltextIndexer::INDEXER_ID) ->willReturn($this->indexerMock); diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/FulltextTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/FulltextTest.php index f30733fb0824c..57c46424c5095 100644 --- a/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/FulltextTest.php +++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/ResourceModel/FulltextTest.php @@ -152,6 +152,6 @@ public function testGetRelationsByChild() $testTable2 )); - self::assertSame($ids, $this->target->getRelationsByChild($ids)); + $this->assertSame($ids, $this->target->getRelationsByChild($ids)); } } diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/StorageTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/StorageTest.php index e4216841bce25..aae3bbfddf3ab 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/StorageTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/Plugin/StorageTest.php @@ -79,18 +79,18 @@ protected function setUp() */ public function testAfterReplace() { - $this->urlRewrite->expects(static::any())->method('getMetadata')->willReturn(['category_id' => '5']); - $this->urlRewrite->expects(static::once())->method('getEntityTYpe')->willReturn('product'); - $this->urlRewrite->expects(static::once())->method('getIsAutogenerated')->willReturn(1); - $this->urlRewrite->expects(static::once())->method('getUrlRewriteId')->willReturn('4'); - $this->urlRewrite->expects(static::once())->method('getEntityId')->willReturn('2'); + $this->urlRewrite->expects($this->any())->method('getMetadata')->willReturn(['category_id' => '5']); + $this->urlRewrite->expects($this->once())->method('getEntityTYpe')->willReturn('product'); + $this->urlRewrite->expects($this->once())->method('getIsAutogenerated')->willReturn(1); + $this->urlRewrite->expects($this->once())->method('getUrlRewriteId')->willReturn('4'); + $this->urlRewrite->expects($this->once())->method('getEntityId')->willReturn('2'); $this->urlRewrite->setData('request_path', 'test'); $this->urlRewrite->setData('store_id', '1'); $productUrls = ['targetPath' => $this->urlRewrite]; - $this->urlFinder->expects(static::once())->method('findAllByData')->willReturn([$this->urlRewrite]); + $this->urlFinder->expects($this->once())->method('findAllByData')->willReturn([$this->urlRewrite]); - $this->productResourceModel->expects(static::once())->method('saveMultiple')->willReturnSelf(); + $this->productResourceModel->expects($this->once())->method('saveMultiple')->willReturnSelf(); $this->plugin->afterReplace($this->storage, $productUrls, $productUrls); } @@ -101,7 +101,7 @@ public function testAfterReplace() public function testBeforeDeleteByData() { $data = [1, 2, 3]; - $this->productResourceModel->expects(static::once()) + $this->productResourceModel->expects($this->once()) ->method('removeMultipleByProductCategory') ->with($data)->willReturnSelf(); $this->plugin->beforeDeleteByData($this->storage, $data); diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductScopeRewriteGeneratorTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductScopeRewriteGeneratorTest.php index 06be01445df4c..35e55d50f2281 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductScopeRewriteGeneratorTest.php +++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ProductScopeRewriteGeneratorTest.php @@ -221,12 +221,12 @@ protected function initObjectRegistryFactory($entities) public function testIsCategoryProperForGenerating($parentIds, $expectedResult) { $storeId = 1; - $this->categoryMock->expects(self::any())->method('getParentIds')->willReturn($parentIds); + $this->categoryMock->expects($this->any())->method('getParentIds')->willReturn($parentIds); $result = $this->productScopeGenerator->isCategoryProperForGenerating( $this->categoryMock, $storeId ); - self::assertEquals( + $this->assertEquals( $expectedResult, $result ); diff --git a/app/code/Magento/Checkout/Test/Unit/Block/Checkout/LayoutProcessorTest.php b/app/code/Magento/Checkout/Test/Unit/Block/Checkout/LayoutProcessorTest.php index 31ca2a2033012..1af5dc86ec6d5 100644 --- a/app/code/Magento/Checkout/Test/Unit/Block/Checkout/LayoutProcessorTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Block/Checkout/LayoutProcessorTest.php @@ -99,15 +99,15 @@ public function testProcess() { $jsLayout = $this->getLayoutData(); - $this->attributeDataProvider->expects(static::once()) + $this->attributeDataProvider->expects($this->once()) ->method('loadAttributesCollection') ->willReturn([]); - $this->dataHelper->expects(static::once()) + $this->dataHelper->expects($this->once()) ->method('isDisplayBillingOnPaymentMethodAvailable') ->willReturn(true); - $this->attributeMerger->expects(static::exactly(2)) + $this->attributeMerger->expects($this->exactly(2)) ->method('merge') ->willReturnMap([ ['payment1_1' => $this->getBillingComponent('payment1_1')], @@ -116,27 +116,27 @@ public function testProcess() $actual = $this->layoutProcessor->process($jsLayout); - static::assertArrayHasKey( + $this->assertArrayHasKey( 'payment1_1-form', $actual['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['payments-list']['children'] ); - static::assertArrayHasKey( + $this->assertArrayHasKey( 'payment2_1-form', $actual['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['payments-list']['children'] ); - static::assertArrayNotHasKey( + $this->assertArrayNotHasKey( 'payment2_2-form', $actual['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['payments-list']['children'] ); - static::assertArrayHasKey( + $this->assertArrayHasKey( 'afterMethods', $actual['components']['checkout']['children']['steps']['children']['billing-step'] ['children']['payment']['children'] ); - static::assertEmpty( + $this->assertEmpty( $actual['components']['checkout']['children']['steps']['children']['billing-step'] ['children']['payment']['children']['afterMethods']['children'] ); @@ -149,30 +149,30 @@ public function testProcessWithBillingAddressOnPaymentPage() { $jsLayout = $this->getLayoutData(); - $this->attributeDataProvider->expects(static::once()) + $this->attributeDataProvider->expects($this->once()) ->method('loadAttributesCollection') ->willReturn([]); - $this->dataHelper->expects(static::once()) + $this->dataHelper->expects($this->once()) ->method('isDisplayBillingOnPaymentMethodAvailable') ->willReturn(false); - $this->attributeMerger->expects(static::once()) + $this->attributeMerger->expects($this->once()) ->method('merge') ->willReturn($this->getBillingComponent('shared')); $actual = $this->layoutProcessor->process($jsLayout); - static::assertEmpty( + $this->assertEmpty( $actual['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['payments-list']['children'] ); - static::assertNotEmpty( + $this->assertNotEmpty( $actual['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['afterMethods']['children'] ); - static::assertArrayHasKey( + $this->assertArrayHasKey( 'billing-address-form', $actual['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment'] ['children']['afterMethods']['children'] diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php index b7ff79fc3c200..318107757aeda 100644 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php @@ -239,23 +239,23 @@ public function sessionRegenerationDataProvider(): array [ 'secure' => false, 'referer' => 'https://test.domain.com/', - 'expectedCall' => self::once() + 'expectedCall' => $this->once() ], [ 'secure' => true, 'referer' => false, - 'expectedCall' => self::once() + 'expectedCall' => $this->once() ], [ 'secure' => true, 'referer' => 'http://test.domain.com/', - 'expectedCall' => self::once() + 'expectedCall' => $this->once() ], // This is the only case in which session regeneration can be skipped [ 'secure' => true, 'referer' => 'https://test.domain.com/', - 'expectedCall' => self::never() + 'expectedCall' => $this->never() ], ]; } diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Cart/CollectQuoteTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Cart/CollectQuoteTest.php index 14410578b12e4..10da7330eee22 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Cart/CollectQuoteTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Cart/CollectQuoteTest.php @@ -127,35 +127,35 @@ public function testCollect() $regionId = 'CA'; $regionMock = $this->createMock(RegionInterface::class); - $this->customerSessionMock->expects(self::once()) + $this->customerSessionMock->expects($this->once()) ->method('isLoggedIn') ->willReturn(true); - $this->customerSessionMock->expects(self::once()) + $this->customerSessionMock->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $this->customerRepositoryMock->expects(self::once()) + $this->customerRepositoryMock->expects($this->once()) ->method('getById') ->willReturn($this->customerMock); - $this->customerMock->expects(self::once()) + $this->customerMock->expects($this->once()) ->method('getDefaultShipping') ->willReturn($defaultAddressId); - $this->addressMock->expects(self::once()) + $this->addressMock->expects($this->once()) ->method('getCountryId') ->willReturn($countryId); - $regionMock->expects(self::once()) + $regionMock->expects($this->once()) ->method('getRegion') ->willReturn($regionId); - $this->addressMock->expects(self::once()) + $this->addressMock->expects($this->once()) ->method('getRegion') ->willReturn($regionMock); - $this->addressRepositoryMock->expects(self::once()) + $this->addressRepositoryMock->expects($this->once()) ->method('getById') ->with($defaultAddressId) ->willReturn($this->addressMock); - $this->estimateAddressFactoryMock->expects(self::once()) + $this->estimateAddressFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->estimateAddressMock); - $this->quoteRepositoryMock->expects(self::once()) + $this->quoteRepositoryMock->expects($this->once()) ->method('save') ->with($this->quoteMock); @@ -167,10 +167,10 @@ public function testCollect() */ public function testCollectWhenCustomerIsNotLoggedIn() { - $this->customerSessionMock->expects(self::once()) + $this->customerSessionMock->expects($this->once()) ->method('isLoggedIn') ->willReturn(false); - $this->customerRepositoryMock->expects(self::never()) + $this->customerRepositoryMock->expects($this->never()) ->method('getById'); $this->model->collect($this->quoteMock); diff --git a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/GuestValidationTest.php b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/GuestValidationTest.php index 3d7b910c7abc5..171a7ba825a9e 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/GuestValidationTest.php +++ b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/GuestValidationTest.php @@ -106,7 +106,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder() ->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects(static::atLeastOnce()) + $this->paymentMock->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation( @@ -141,7 +141,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali ->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(false); - $this->paymentMock->expects(static::atLeastOnce()) + $this->paymentMock->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation( @@ -177,7 +177,7 @@ public function testBeforeSavePaymentInformation() ->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects(static::atLeastOnce()) + $this->paymentMock->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation( diff --git a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php index 7f11fad202401..84f3c45414122 100644 --- a/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php +++ b/app/code/Magento/CheckoutAgreements/Test/Unit/Model/Checkout/Plugin/ValidationTest.php @@ -105,7 +105,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrder() ->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects(static::atLeastOnce()) + $this->paymentMock->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); @@ -133,7 +133,7 @@ public function testBeforeSavePaymentInformationAndPlaceOrderIfAgreementsNotVali ->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(false); - $this->paymentMock->expects(static::atLeastOnce()) + $this->paymentMock->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); @@ -162,7 +162,7 @@ public function testBeforeSavePaymentInformation() ->willReturn([1]); $this->extensionAttributesMock->expects($this->once())->method('getAgreementIds')->willReturn($agreements); $this->agreementsValidatorMock->expects($this->once())->method('isValid')->with($agreements)->willReturn(true); - $this->paymentMock->expects(static::atLeastOnce()) + $this->paymentMock->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); $this->model->beforeSavePaymentInformation($this->subjectMock, $cartId, $this->paymentMock, $this->addressMock); diff --git a/app/code/Magento/Cms/Test/Unit/Model/BlockTest.php b/app/code/Magento/Cms/Test/Unit/Model/BlockTest.php index 448112b228a0d..2c7b924fc766b 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/BlockTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/BlockTest.php @@ -85,7 +85,7 @@ public function testBeforeSave() $this->eventManagerMock->expects($this->atLeastOnce())->method('dispatch'); $expected = $this->blockModel; $actual = $this->blockModel->beforeSave(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -114,7 +114,7 @@ public function testBeforeSaveWithException() public function testGetIdentities() { $result = $this->blockModel->getIdentities(); - self::assertInternalType('array', $result); + $this->assertInternalType('array', $result); } /** @@ -128,7 +128,7 @@ public function testGetId() $this->blockModel->setData(Block::BLOCK_ID, $blockId); $expected = $blockId; $actual = $this->blockModel->getId(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -142,7 +142,7 @@ public function testGetIdentifier() $this->blockModel->setData(Block::IDENTIFIER, $identifier); $expected = $identifier; $actual = $this->blockModel->getIdentifier(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -156,7 +156,7 @@ public function testGetTitle() $this->blockModel->setData(Block::TITLE, $title); $expected = $title; $actual = $this->blockModel->getTitle(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -170,7 +170,7 @@ public function testGetContent() $this->blockModel->setData(Block::CONTENT, $content); $expected = $content; $actual = $this->blockModel->getContent(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -184,7 +184,7 @@ public function testGetCreationTime() $this->blockModel->setData(Block::CREATION_TIME, $creationTime); $expected = $creationTime; $actual = $this->blockModel->getCreationTime(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -198,7 +198,7 @@ public function testGetUpdateTime() $this->blockModel->setData(Block::UPDATE_TIME, $updateTime); $expected = $updateTime; $actual = $this->blockModel->getUpdateTime(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -211,7 +211,7 @@ public function testIsActive() $isActive = true; $this->blockModel->setData(Block::IS_ACTIVE, $isActive); $result = $this->blockModel->isActive(); - self::assertTrue($result); + $this->assertTrue($result); } /** @@ -225,7 +225,7 @@ public function testSetId() $this->blockModel->setId($blockId); $expected = $blockId; $actual = $this->blockModel->getData(Block::BLOCK_ID); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -239,7 +239,7 @@ public function testSetIdentifier() $this->blockModel->setIdentifier($identifier); $expected = $identifier; $actual = $this->blockModel->getData(Block::IDENTIFIER); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -253,7 +253,7 @@ public function testSetTitle() $this->blockModel->setTitle($title); $expected = $title; $actual = $this->blockModel->getData(Block::TITLE); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -267,7 +267,7 @@ public function testSetContent() $this->blockModel->setContent($content); $expected = $content; $actual = $this->blockModel->getData(Block::CONTENT); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -281,7 +281,7 @@ public function testSetCreationTime() $this->blockModel->setCreationTime($creationTime); $expected = $creationTime; $actual = $this->blockModel->getData(Block::CREATION_TIME); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -295,7 +295,7 @@ public function testSetUpdateTime() $this->blockModel->setUpdateTime($updateTime); $expected = $updateTime; $actual = $this->blockModel->getData(Block::UPDATE_TIME); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -307,7 +307,7 @@ public function testSetIsActive() { $this->blockModel->setIsActive(false); $result = $this->blockModel->getData(Block::IS_ACTIVE); - self::assertFalse($result); + $this->assertFalse($result); } /** @@ -321,7 +321,7 @@ public function testGetStores() $this->blockModel->setData('stores', $stores); $expected = $stores; $actual = $this->blockModel->getStores(); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -332,6 +332,6 @@ public function testGetStores() public function testGetAvailableStatuses() { $result = $this->blockModel->getAvailableStatuses(); - self::assertInternalType('array', $result); + $this->assertInternalType('array', $result); } } diff --git a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/BlockActionsTest.php b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/BlockActionsTest.php index 3095abef7bbe3..e0df618d1c9fd 100644 --- a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/BlockActionsTest.php +++ b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/BlockActionsTest.php @@ -42,7 +42,7 @@ protected function setUp() $processor = $this->getMockBuilder(Processor::class) ->disableOriginalConstructor() ->getMock(); - $context->expects(static::never()) + $context->expects($this->never()) ->method('getProcessor') ->willReturn($processor); @@ -101,12 +101,12 @@ public function testPrepareDataSource() ] ]; - $this->escaper->expects(static::once()) + $this->escaper->expects($this->once()) ->method('escapeHtml') ->with($title) ->willReturn($title); - $this->urlBuilder->expects(static::exactly(2)) + $this->urlBuilder->expects($this->exactly(2)) ->method('getUrl') ->willReturnMap( [ @@ -130,6 +130,6 @@ public function testPrepareDataSource() $this->blockActions->setData('name', $name); $actual = $this->blockActions->prepareDataSource($items); - static::assertEquals($expectedItems, $actual['data']['items']); + $this->assertEquals($expectedItems, $actual['data']['items']); } } diff --git a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php index 9b3165a2c5517..91637ff16818d 100644 --- a/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php +++ b/app/code/Magento/Cms/Test/Unit/Ui/Component/Listing/Column/PageActionsTest.php @@ -76,7 +76,7 @@ public function testPrepareItemsByPageId() ] ]; - $escaper->expects(static::once()) + $escaper->expects($this->once()) ->method('escapeHtml') ->with($title) ->willReturn($title); diff --git a/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php b/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php index f877237a2ba66..44f3512d820bd 100644 --- a/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php +++ b/app/code/Magento/ConfigurableImportExport/Test/Unit/Model/Export/RowCustomizerTest.php @@ -206,16 +206,16 @@ private function initConfigurableData() ] ]; - $productMock->expects(static::any()) + $productMock->expects($this->any()) ->method('getId') ->willReturn($this->productId); - $productMock->expects(static::any()) + $productMock->expects($this->any()) ->method('getTypeInstance') ->willReturn($this->configurableProductTypeMock); - $this->configurableProductTypeMock->expects(static::any()) + $this->configurableProductTypeMock->expects($this->any()) ->method('getConfigurableOptions') ->willReturn($productAttributesOptions); - $this->productCollectionMock->expects(static::atLeastOnce()) + $this->productCollectionMock->expects($this->atLeastOnce()) ->method('addAttributeToFilter') ->willReturnMap( [ @@ -223,7 +223,7 @@ private function initConfigurableData() ['type_id', ['eq' => ConfigurableProductType::TYPE_CODE], 'inner', $this->productCollectionMock] ] ); - $this->productCollectionMock->expects(static::atLeastOnce()) + $this->productCollectionMock->expects($this->atLeastOnce()) ->method('fetchItem') ->willReturnOnConsecutiveCalls($productMock, false); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Edit/Button/SaveTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Edit/Button/SaveTest.php index 2d73b61245a4b..549c7a6b5a46d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Edit/Button/SaveTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Block/Adminhtml/Product/Edit/Button/SaveTest.php @@ -41,7 +41,7 @@ protected function setUp() ->setMethods(['isReadonly', 'isDuplicable', 'isComposite']) ->getMockForAbstractClass(); - $this->registryMock->expects(static::any()) + $this->registryMock->expects($this->any()) ->method('registry') ->with('current_product') ->willReturn($this->productMock); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php index 90306de598895..be82075b45448 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/ConfigurableTest.php @@ -154,15 +154,15 @@ public function testAfterInitializeWithAttributesAndVariations() ['attributes', null, $attributes], ]; - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn(ConfigurableProduct::TYPE_CODE); - $this->request->expects(static::any()) + $this->request->expects($this->any()) ->method('getPost') ->willReturnMap($valueMap); - $this->request->expects(static::any()) + $this->request->expects($this->any()) ->method('getParam') ->willReturnMap($paramValueMap); @@ -170,33 +170,33 @@ public function testAfterInitializeWithAttributesAndVariations() ->disableOriginalConstructor() ->setMethods(['setConfigurableProductOptions', 'setConfigurableProductLinks']) ->getMockForAbstractClass(); - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $this->optionFactory->expects(static::once()) + $this->optionFactory->expects($this->once()) ->method('create') ->with($attributes) ->willReturn($attributes); - $extensionAttributes->expects(static::once()) + $extensionAttributes->expects($this->once()) ->method('setConfigurableProductOptions') ->with($attributes); - $this->variationHandler->expects(static::once()) + $this->variationHandler->expects($this->once()) ->method('prepareAttributeSet') ->with($this->product); - $this->variationHandler->expects(static::once()) + $this->variationHandler->expects($this->once()) ->method('generateSimpleProducts') ->with($this->product, $variationMatrix) ->willReturn($simpleProductsIds); - $extensionAttributes->expects(static::once()) + $extensionAttributes->expects($this->once()) ->method('setConfigurableProductLinks') ->with($simpleProductsIds); - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('setExtensionAttributes') ->with($extensionAttributes); @@ -220,15 +220,15 @@ public function testAfterInitializeWithAttributesAndWithoutVariations() ['attributes', null, $attributes], ]; - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn(ConfigurableProduct::TYPE_CODE); - $this->request->expects(static::any()) + $this->request->expects($this->any()) ->method('getPost') ->willReturnMap($valueMap); - $this->request->expects(static::any()) + $this->request->expects($this->any()) ->method('getParam') ->willReturnMap($paramValueMap); @@ -236,29 +236,29 @@ public function testAfterInitializeWithAttributesAndWithoutVariations() ->disableOriginalConstructor() ->setMethods(['setConfigurableProductOptions', 'setConfigurableProductLinks']) ->getMockForAbstractClass(); - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $this->optionFactory->expects(static::once()) + $this->optionFactory->expects($this->once()) ->method('create') ->with($attributes) ->willReturn($attributes); - $extensionAttributes->expects(static::once()) + $extensionAttributes->expects($this->once()) ->method('setConfigurableProductOptions') ->with($attributes); - $this->variationHandler->expects(static::never()) + $this->variationHandler->expects($this->never()) ->method('prepareAttributeSet'); - $this->variationHandler->expects(static::never()) + $this->variationHandler->expects($this->never()) ->method('generateSimpleProducts'); - $extensionAttributes->expects(static::once()) + $extensionAttributes->expects($this->once()) ->method('setConfigurableProductLinks'); - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('setExtensionAttributes') ->with($extensionAttributes); @@ -267,36 +267,36 @@ public function testAfterInitializeWithAttributesAndWithoutVariations() public function testAfterInitializeIfAttributesEmpty() { - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn(ConfigurableProduct::TYPE_CODE); - $this->request->expects(static::once()) + $this->request->expects($this->once()) ->method('getParam') ->with('attributes') ->willReturn([]); - $this->product->expects(static::never()) + $this->product->expects($this->never()) ->method('getExtensionAttributes'); - $this->request->expects(static::once()) + $this->request->expects($this->once()) ->method('getPost'); - $this->variationHandler->expects(static::never()) + $this->variationHandler->expects($this->never()) ->method('prepareAttributeSet'); - $this->variationHandler->expects(static::never()) + $this->variationHandler->expects($this->never()) ->method('generateSimpleProducts'); $this->plugin->afterInitialize($this->subject, $this->product); } public function testAfterInitializeForNotConfigurableProduct() { - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn('non-configurable'); - $this->product->expects(static::never()) + $this->product->expects($this->never()) ->method('getExtensionAttributes'); - $this->request->expects(static::once()) + $this->request->expects($this->once()) ->method('getPost'); - $this->variationHandler->expects(static::never()) + $this->variationHandler->expects($this->never()) ->method('prepareAttributeSet'); - $this->variationHandler->expects(static::never()) + $this->variationHandler->expects($this->never()) ->method('generateSimpleProducts'); $this->plugin->afterInitialize($this->subject, $this->product); } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/UpdateConfigurationsTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/UpdateConfigurationsTest.php index fb63dc330db32..cfcabf7e2ee0d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/UpdateConfigurationsTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/Plugin/UpdateConfigurationsTest.php @@ -148,7 +148,7 @@ public function testAfterInitialize() 'product3' => $this->getProductMock($configurations['product3'], false, true), ]; - $this->requestMock->expects(static::any()) + $this->requestMock->expects($this->any()) ->method('getParam') ->willReturnMap( [ @@ -156,11 +156,11 @@ public function testAfterInitialize() ['configurable-matrix-serialized', "[]", json_encode($configurableMatrix)] ] ); - $this->variationHandlerMock->expects(static::once()) + $this->variationHandlerMock->expects($this->once()) ->method('duplicateImagesForVariations') ->with($configurations) ->willReturn($configurations); - $this->productRepositoryMock->expects(static::any()) + $this->productRepositoryMock->expects($this->any()) ->method('getById') ->willReturnMap( [ @@ -168,7 +168,7 @@ public function testAfterInitialize() ['product3', false, 0, false, $productMocks['product3']] ] ); - $this->variationHandlerMock->expects(static::any()) + $this->variationHandlerMock->expects($this->any()) ->method('processMediaGallery') ->willReturnMap( [ @@ -195,16 +195,16 @@ protected function getProductMock(array $expectedData = null, $hasDataChanges = if ($wasChanged !== false) { if ($expectedData !== null) { - $productMock->expects(static::once()) + $productMock->expects($this->once()) ->method('addData') ->with($expectedData) ->willReturnSelf(); } - $productMock->expects(static::any()) + $productMock->expects($this->any()) ->method('hasDataChanges') ->willReturn($hasDataChanges); - $productMock->expects($hasDataChanges ? static::once() : static::never()) + $productMock->expects($hasDataChanges ? $this->once() : $this->never()) ->method('save') ->willReturnSelf(); } @@ -218,7 +218,7 @@ public function testAfterInitializeEmptyMatrix() { $productMock = $this->getProductMock(); - $this->requestMock->expects(static::any()) + $this->requestMock->expects($this->any()) ->method('getParam') ->willReturnMap( [ @@ -227,7 +227,7 @@ public function testAfterInitializeEmptyMatrix() ] ); - $this->variationHandlerMock->expects(static::once()) + $this->variationHandlerMock->expects($this->once()) ->method('duplicateImagesForVariations') ->with([]) ->willReturn([]); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/DataTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/DataTest.php index cd9fb419981a1..8af00122e17f3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/DataTest.php @@ -218,34 +218,34 @@ public function testGetGalleryImages() ->method('getUrl') ->withConsecutive( [ - self::identicalTo('test_file'), - self::identicalTo('product_page_image_small') + $this->identicalTo('test_file'), + $this->identicalTo('product_page_image_small') ], [ - self::identicalTo('test_file'), - self::identicalTo('product_page_image_medium') + $this->identicalTo('test_file'), + $this->identicalTo('product_page_image_medium') ], [ - self::identicalTo('test_file'), - self::identicalTo('product_page_image_large') + $this->identicalTo('test_file'), + $this->identicalTo('product_page_image_large') ] ) - ->will(self::onConsecutiveCalls( + ->will($this->onConsecutiveCalls( 'testSmallImageUrl', 'testMediumImageUrl', 'testLargeImageUrl' )); - $this->_imageHelperMock->expects(self::never()) + $this->_imageHelperMock->expects($this->never()) ->method('setImageFile') ->with('test_file') ->willReturnSelf(); - $this->_imageHelperMock->expects(self::never()) + $this->_imageHelperMock->expects($this->never()) ->method('getUrl') ->willReturn('product_page_image_small_url'); - $this->_imageHelperMock->expects(self::never()) + $this->_imageHelperMock->expects($this->never()) ->method('getUrl') ->willReturn('product_page_image_medium_url'); - $this->_imageHelperMock->expects(self::never()) + $this->_imageHelperMock->expects($this->never()) ->method('getUrl') ->willReturn('product_page_image_large_url'); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/FactoryTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/FactoryTest.php index 5fef85d8c581c..ab848310f9306 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/FactoryTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/FactoryTest.php @@ -104,19 +104,19 @@ public function testCreateWithException() ->setMethods(['setValues', 'getData']) ->getMock(); - $this->attributeFactory->expects(static::once()) + $this->attributeFactory->expects($this->once()) ->method('create') ->willReturn($attribute); $eavAttribute = $this->getMockBuilder(EavAttribute::class) ->disableOriginalConstructor() ->getMock(); - $this->productAttributeRepository->expects(static::once()) + $this->productAttributeRepository->expects($this->once()) ->method('get') ->with($attributeId) ->willReturn($eavAttribute); - $this->configurable->expects(static::once()) + $this->configurable->expects($this->once()) ->method('canUseAttribute') ->with($eavAttribute) ->willReturn(false); @@ -139,41 +139,41 @@ public function testCreate() ->setMethods(['setValues', 'setData', '__wakeup']) ->getMock(); - $this->attributeFactory->expects(static::once()) + $this->attributeFactory->expects($this->once()) ->method('create') ->willReturn($attribute); $eavAttribute = $this->getMockBuilder(EavAttribute::class) ->disableOriginalConstructor() ->getMock(); - $this->productAttributeRepository->expects(static::once()) + $this->productAttributeRepository->expects($this->once()) ->method('get') ->with($attributeId) ->willReturn($eavAttribute); - $this->configurable->expects(static::once()) + $this->configurable->expects($this->once()) ->method('canUseAttribute') ->with($eavAttribute) ->willReturn(true); $option = $this->createMock(OptionValueInterface::class); - $option->expects(static::once()) + $option->expects($this->once()) ->method('setValueIndex') ->with($valueIndex) ->willReturnSelf(); - $this->optionValueFactory->expects(static::once()) + $this->optionValueFactory->expects($this->once()) ->method('create') ->willReturn($option); - $attribute->expects(static::once()) + $attribute->expects($this->once()) ->method('setData') ->with($item); - $attribute->expects(static::once()) + $attribute->expects($this->once()) ->method('setValues') ->with([$option]); $result = $this->factory->create($data); - static::assertSame([$attribute], $result); + $this->assertSame([$attribute], $result); } } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/LoaderTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/LoaderTest.php index 921a2bcfcc2ef..9d3a186d3992e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/LoaderTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Helper/Product/Options/LoaderTest.php @@ -72,7 +72,7 @@ public function testLoad() 'value_index' => 23 ]; - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeInstance') ->willReturn($this->configurable); @@ -87,28 +87,28 @@ public function testLoad() $iterator->expects($this->once())->method('getIterator') ->willReturn(new \ArrayIterator($attributes)); - $this->configurable->expects(static::once()) + $this->configurable->expects($this->once()) ->method('getConfigurableAttributeCollection') ->with($this->product) ->willReturn($iterator); - $attribute->expects(static::once()) + $attribute->expects($this->once()) ->method('getOptions') ->willReturn([$option]); $optionValue = $this->getMockForAbstractClass(OptionValueInterface::class); - $this->optionValueFactory->expects(static::once()) + $this->optionValueFactory->expects($this->once()) ->method('create') ->willReturn($optionValue); - $optionValue->expects(static::once()) + $optionValue->expects($this->once()) ->method('setValueIndex') ->with($option['value_index']); - $attribute->expects(static::once()) + $attribute->expects($this->once()) ->method('setValues') ->with([$optionValue]); $options = $this->loader->load($this->product); - static::assertSame([$attribute], $options); + $this->assertSame([$attribute], $options); } } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php index 665f296fc9a94..05ca467b33645 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Attribute/LockValidatorTest.php @@ -61,7 +61,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->metadataPoolMock->expects(self::once()) + $this->metadataPoolMock->expects($this->once()) ->method('getMetadata') ->with(ProductInterface::class) ->willReturn($this->getMetaDataMock()); @@ -92,7 +92,7 @@ private function getMetaDataMock() ->disableOriginalConstructor() ->getMock(); - $metadata->expects(self::once()) + $metadata->expects($this->once()) ->method('getLinkField') ->willReturn('entity_id'); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php index 4b35182fb9e2f..156822730b2be 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/OptionRepositoryTest.php @@ -87,26 +87,26 @@ public function testGet() $optionId = 3; $productSku = "configurable"; - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('get') ->with($productSku) ->willReturn($this->productMock); $optionMock = $this->createMock(OptionInterface::class); - $optionMock->expects(self::once()) + $optionMock->expects($this->once()) ->method('getId') ->willReturn($optionId); - $this->optionLoader->expects(self::once()) + $this->optionLoader->expects($this->once()) ->method('load') ->with($this->productMock) ->willReturn([$optionMock]); - self::assertEquals( + $this->assertEquals( $optionMock, $this->model->get($productSku, $optionId) ); @@ -121,20 +121,20 @@ public function testGetNotConfigurableProduct() $productSku = "configurable"; $optionId = 3; - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE . '-not'); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('get') ->with($productSku) ->willReturn($this->productMock); $optionMock = $this->createMock(OptionInterface::class); - $optionMock->expects(self::never()) + $optionMock->expects($this->never()) ->method('getId'); - $this->optionLoader->expects(self::never()) + $this->optionLoader->expects($this->never()) ->method('load'); $this->model->get($productSku, $optionId); @@ -150,17 +150,17 @@ public function testGetNotProductById() /** @var OptionInterface $optionMock */ $optionMock = $this->createMock(OptionInterface::class); - $this->configurableTypeResource->expects(self::once()) + $this->configurableTypeResource->expects($this->once()) ->method('getEntityIdByAttribute') ->with($optionMock) ->willReturn($entityId); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('getById') ->with($entityId) ->willReturn($this->productMock); - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE . '-not'); @@ -177,21 +177,21 @@ public function testDeleteCantSaveProducts() /** @var OptionInterface $optionMock */ $optionMock = $this->createMock(OptionInterface::class); - $this->configurableTypeResource->expects(self::once()) + $this->configurableTypeResource->expects($this->once()) ->method('getEntityIdByAttribute') ->with($optionMock) ->willReturn($entityId); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('getById') ->with($entityId) ->willReturn($this->productMock); - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->configurableTypeResource->expects(self::once()) + $this->configurableTypeResource->expects($this->once()) ->method('saveProducts') ->with($this->productMock) ->willThrowException(new \Exception()); @@ -210,29 +210,29 @@ public function testDeleteCantDeleteOption() ->disableOriginalConstructor() ->getMock(); - $optionMock->expects(self::once()) + $optionMock->expects($this->once()) ->method('getId') ->willReturn(33); - $this->configurableTypeResource->expects(self::once()) + $this->configurableTypeResource->expects($this->once()) ->method('getEntityIdByAttribute') ->with($optionMock) ->willReturn($entityId); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('getById') ->with($entityId) ->willReturn($this->productMock); - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->configurableTypeResource->expects(self::once()) + $this->configurableTypeResource->expects($this->once()) ->method('saveProducts') ->with($this->productMock); - $this->optionResource->expects(self::once()) + $this->optionResource->expects($this->once()) ->method('delete') ->with($optionMock) ->willThrowException(new \Exception()); @@ -247,25 +247,25 @@ public function testDelete() ->disableOriginalConstructor() ->getMock(); - $this->configurableTypeResource->expects(self::once()) + $this->configurableTypeResource->expects($this->once()) ->method('getEntityIdByAttribute') ->with($optionMock) ->willReturn($entityId); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('getById') ->with($entityId) ->willReturn($this->productMock); - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->configurableTypeResource->expects(self::once()) + $this->configurableTypeResource->expects($this->once()) ->method('saveProducts') ->with($this->productMock); - $this->optionResource->expects(self::once()) + $this->optionResource->expects($this->once()) ->method('delete') ->with($optionMock) ->willReturn(true); @@ -284,20 +284,20 @@ public function testGetEmptyExtensionAttribute() $optionId = 3; $productSku = "configurable"; - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('get') ->with($productSku) ->willReturn($this->productMock); $optionMock = $this->createMock(OptionInterface::class); - $optionMock->expects(self::never()) + $optionMock->expects($this->never()) ->method('getId'); - $this->optionLoader->expects(self::once()) + $this->optionLoader->expects($this->once()) ->method('load') ->with($this->productMock) ->willReturn([]); @@ -309,18 +309,18 @@ public function testGetList() { $productSku = "configurable"; - $this->productMock->expects(self::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->productRepositoryMock->expects(self::once()) + $this->productRepositoryMock->expects($this->once()) ->method('get') ->with($productSku) ->willReturn($this->productMock); $optionMock = $this->createMock(OptionInterface::class); - $this->optionLoader->expects(self::once()) + $this->optionLoader->expects($this->once()) ->method('load') ->with($this->productMock) ->willReturn([$optionMock]); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/PriceBackendTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/PriceBackendTest.php index 992a27eb41dc9..e2bd8c9dfd6c0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/PriceBackendTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/PriceBackendTest.php @@ -66,7 +66,7 @@ protected function setUp() */ public function testAroundValidate($typeId, $expectedResult) { - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn($typeId); $result = $this->priceBackendPlugin->aroundValidate( diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/ProductRepositorySaveTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/ProductRepositorySaveTest.php index 1c3e421ae924f..41bf456be4c1e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/ProductRepositorySaveTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Plugin/ProductRepositorySaveTest.php @@ -109,10 +109,10 @@ protected function setUp() public function testAfterSaveWhenProductIsSimple() { - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn('simple'); - $this->product->expects(static::never()) + $this->product->expects($this->never()) ->method('getExtensionAttributes'); $this->assertEquals( @@ -123,22 +123,22 @@ public function testAfterSaveWhenProductIsSimple() public function testAfterSaveWithoutOptions() { - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->result->expects(static::once()) + $this->result->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributes); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductOptions') ->willReturn([]); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductLinks') ->willReturn([]); - $this->productAttributeRepository->expects(static::never()) + $this->productAttributeRepository->expects($this->never()) ->method('get'); $this->assertEquals( @@ -154,21 +154,21 @@ public function testAfterSaveWithoutOptions() public function testAfterSaveWithLinks() { $links = [4, 5]; - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->result->expects(static::once()) + $this->result->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributes); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductOptions') ->willReturn(null); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductLinks') ->willReturn($links); - $this->productAttributeRepository->expects(static::never()) + $this->productAttributeRepository->expects($this->never()) ->method('get'); $product = $this->getMockBuilder(Product::class) @@ -176,14 +176,14 @@ public function testAfterSaveWithLinks() ->setMethods(['load', 'getData', '__wakeup']) ->getMock(); - $this->productFactory->expects(static::exactly(2)) + $this->productFactory->expects($this->exactly(2)) ->method('create') ->willReturn($product); - $product->expects(static::exactly(2)) + $product->expects($this->exactly(2)) ->method('load') ->willReturnSelf(); - $product->expects(static::never()) + $product->expects($this->never()) ->method('getData'); $this->plugin->afterSave($this->productRepository, $this->result, $this->product); @@ -200,29 +200,29 @@ public function testAfterSaveWithLinksWithMissingAttribute() $attributeCode = 'color'; $attributeId = 23; - $this->option->expects(static::once()) + $this->option->expects($this->once()) ->method('getAttributeId') ->willReturn($attributeId); - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->result->expects(static::once()) + $this->result->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributes); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductOptions') ->willReturn([$this->option]); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductLinks') ->willReturn($links); - $this->productAttributeRepository->expects(static::once()) + $this->productAttributeRepository->expects($this->once()) ->method('get') ->willReturn($this->eavAttribute); - $this->eavAttribute->expects(static::once()) + $this->eavAttribute->expects($this->once()) ->method('getAttributeCode') ->willReturn($attributeCode); @@ -231,14 +231,14 @@ public function testAfterSaveWithLinksWithMissingAttribute() ->setMethods(['load', 'getData', '__wakeup']) ->getMock(); - $this->productFactory->expects(static::once()) + $this->productFactory->expects($this->once()) ->method('create') ->willReturn($product); - $product->expects(static::once()) + $product->expects($this->once()) ->method('load') ->with($simpleProductId) ->willReturnSelf(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getData') ->with($attributeCode) ->willReturn(false); @@ -256,29 +256,29 @@ public function testAfterSaveWithLinksWithDuplicateAttributes() $attributeCode = 'color'; $attributeId = 23; - $this->option->expects(static::once()) + $this->option->expects($this->once()) ->method('getAttributeId') ->willReturn($attributeId); - $this->product->expects(static::once()) + $this->product->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); - $this->result->expects(static::once()) + $this->result->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributes); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductOptions') ->willReturn([$this->option]); - $this->extensionAttributes->expects(static::once()) + $this->extensionAttributes->expects($this->once()) ->method('getConfigurableProductLinks') ->willReturn($links); - $this->productAttributeRepository->expects(static::once()) + $this->productAttributeRepository->expects($this->once()) ->method('get') ->willReturn($this->eavAttribute); - $this->eavAttribute->expects(static::once()) + $this->eavAttribute->expects($this->once()) ->method('getAttributeCode') ->willReturn($attributeCode); @@ -287,13 +287,13 @@ public function testAfterSaveWithLinksWithDuplicateAttributes() ->setMethods(['load', 'getData', '__wakeup']) ->getMock(); - $this->productFactory->expects(static::exactly(2)) + $this->productFactory->expects($this->exactly(2)) ->method('create') ->willReturn($product); - $product->expects(static::exactly(2)) + $product->expects($this->exactly(2)) ->method('load') ->willReturnSelf(); - $product->expects(static::exactly(4)) + $product->expects($this->exactly(4)) ->method('getData') ->with($attributeCode) ->willReturn($attributeId); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/ReadHandlerTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/ReadHandlerTest.php index b1f708e3c4062..650f26c77d34e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/ReadHandlerTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/ReadHandlerTest.php @@ -49,15 +49,15 @@ public function testExecuteWithInvalidProductType() ->setMethods(['getTypeId', 'getExtensionAttributes']) ->getMock(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getTypeId') ->willReturn('simple'); - $product->expects(static::never()) + $product->expects($this->never()) ->method('getExtensionAttributes'); $entity = $this->readHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } /** @@ -79,7 +79,7 @@ public function testExecute() ]) ->getMock(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getTypeId') ->willReturn(Configurable::TYPE_CODE); @@ -88,11 +88,11 @@ public function testExecute() ->setMethods(['setConfigurableProductOptions', 'setConfigurableProductLinks']) ->getMockForAbstractClass(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $this->optionLoader->expects(static::once()) + $this->optionLoader->expects($this->once()) ->method('load') ->with($product) ->willReturn($options); @@ -102,23 +102,23 @@ public function testExecute() ->setMethods(['getChildrenIds']) ->getMock(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getTypeInstance') ->willReturn($typeInstance); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getId') ->willReturn($entityId); - $typeInstance->expects(static::once()) + $typeInstance->expects($this->once()) ->method('getChildrenIds') ->willReturn($ids); - $product->expects(static::once()) + $product->expects($this->once()) ->method('setExtensionAttributes') ->with($extensionAttributes); $entity = $this->readHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/SaveHandlerTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/SaveHandlerTest.php index 851595422f596..983fb69bb7e84 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/SaveHandlerTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/SaveHandlerTest.php @@ -71,15 +71,15 @@ public function testExecuteWithInvalidProductType() ->setMethods(['getTypeId', 'getExtensionAttributes']) ->getMock(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getTypeId') ->willReturn('simple'); - $product->expects(static::never()) + $product->expects($this->never()) ->method('getExtensionAttributes'); $entity = $this->saveHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } /** @@ -94,10 +94,10 @@ public function testExecuteWithEmptyExtensionAttributes() ->setMethods(['getTypeId', 'getExtensionAttributes', 'getSku']) ->getMock(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getTypeId') ->willReturn(ConfigurableModel::TYPE_CODE); - $product->expects(static::exactly(1)) + $product->expects($this->exactly(1)) ->method('getSku') ->willReturn($sku); @@ -106,26 +106,26 @@ public function testExecuteWithEmptyExtensionAttributes() ->disableOriginalConstructor() ->getMockForAbstractClass(); - $product->expects(static::atLeastOnce()) + $product->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $extensionAttributes->expects(static::atLeastOnce()) + $extensionAttributes->expects($this->atLeastOnce()) ->method('getConfigurableProductOptions') ->willReturn([]); - $extensionAttributes->expects(static::atLeastOnce()) + $extensionAttributes->expects($this->atLeastOnce()) ->method('getConfigurableProductLinks') ->willReturn($configurableProductLinks); - $this->optionRepository->expects(static::once()) + $this->optionRepository->expects($this->once()) ->method('getList') ->with($sku) ->willReturn([]); - $this->optionRepository->expects(static::never()) + $this->optionRepository->expects($this->never()) ->method('deleteById'); $entity = $this->saveHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } /** @@ -144,10 +144,10 @@ public function testExecute() ->disableOriginalConstructor() ->setMethods(['getTypeId', 'getSku', 'getData', 'getExtensionAttributes']) ->getMock(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('getTypeId') ->willReturn(ConfigurableModel::TYPE_CODE); - $product->expects(static::exactly(4)) + $product->expects($this->exactly(4)) ->method('getSku') ->willReturn($sku); @@ -156,7 +156,7 @@ public function testExecute() ->disableOriginalConstructor() ->getMockForAbstractClass(); - $product->expects(static::atLeastOnce()) + $product->expects($this->atLeastOnce()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); @@ -164,45 +164,45 @@ public function testExecute() ->disableOriginalConstructor() ->setMethods(['getAttributeId', 'loadByProductAndAttribute', 'setId', 'getId']) ->getMock(); - $attributeNew->expects(static::atLeastOnce()) + $attributeNew->expects($this->atLeastOnce()) ->method('getAttributeId') ->willReturn($attributeIdNew); $this->processSaveOptions($attributeNew, $sku, $idNew); $optionOld = $this->getMockForAbstractClass(OptionInterface::class); - $optionOld->expects(static::atLeastOnce()) + $optionOld->expects($this->atLeastOnce()) ->method('getAttributeId') ->willReturn($attributeIdOld); - $optionOld->expects(static::atLeastOnce()) + $optionOld->expects($this->atLeastOnce()) ->method('getId') ->willReturn($idOld); $list = [$optionOld]; - $this->optionRepository->expects(static::atLeastOnce()) + $this->optionRepository->expects($this->atLeastOnce()) ->method('getList') ->with($sku) ->willReturn($list); - $this->optionRepository->expects(static::once()) + $this->optionRepository->expects($this->once()) ->method('deleteById') ->with($sku, $idOld); $configurableAttributes = [ $attributeNew ]; - $extensionAttributes->expects(static::atLeastOnce()) + $extensionAttributes->expects($this->atLeastOnce()) ->method('getConfigurableProductOptions') ->willReturn($configurableAttributes); - $extensionAttributes->expects(static::once()) + $extensionAttributes->expects($this->once()) ->method('getConfigurableProductLinks') ->willReturn($configurableProductLinks); - $this->configurable->expects(static::once()) + $this->configurable->expects($this->once()) ->method('saveProducts') ->with($product, $configurableProductLinks); $entity = $this->saveHandler->execute($product); - static::assertSame($product, $entity); + $this->assertSame($product, $entity); } /** @@ -222,7 +222,7 @@ private function initConfigurableFactoryMock() ->setMethods(['create']) ->getMock(); - $this->configurableFactory->expects(static::any()) + $this->configurableFactory->expects($this->any()) ->method('create') ->willReturn($this->configurable); } @@ -237,12 +237,12 @@ private function initConfigurableFactoryMock() */ private function processSaveOptions(\PHPUnit_Framework_MockObject_MockObject $attribute, $sku, $id) { - $attribute->expects(static::once()) + $attribute->expects($this->once()) ->method('setId') ->with(null) ->willReturnSelf(); - $this->optionRepository->expects(static::once()) + $this->optionRepository->expects($this->once()) ->method('save') ->with($sku, $attribute) ->willReturn($id); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Validator/PluginTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Validator/PluginTest.php index 5f95d98054600..e5586a60d04b5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Validator/PluginTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Product/Validator/PluginTest.php @@ -87,8 +87,8 @@ protected function setUp() public function testBeforeValidate() { - $this->requestMock->expects(static::once())->method('has')->with('attributes')->willReturn(true); - $this->productMock->expects(static::once())->method('setTypeId')->willReturnSelf(); + $this->requestMock->expects($this->once())->method('has')->with('attributes')->willReturn(true); + $this->productMock->expects($this->once())->method('setTypeId')->willReturnSelf(); $this->plugin->beforeValidate( $this->subjectMock, diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php index d1df2b354204f..d406c3d59d8bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/Quote/Item/CartItemProcessorTest.php @@ -188,7 +188,7 @@ public function testProcessProductOptions() $this->optionFactoryMock->expects($this->once())->method('create')->willReturn($productOptionMock); $productOptionMock->expects($this->once())->method('getExtensionAttributes')->willReturn(null); - $this->optionExtensionFactoryMock->expects(static::once()) + $this->optionExtensionFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->productOptionExtensionAttributes); $this->productOptionExtensionAttributes->expects($this->once()) @@ -232,7 +232,7 @@ public function testProcessProductOptionsIfOptionsExist() ->willReturnSelf(); $productOptionMock = $this->createMock(\Magento\Quote\Api\Data\ProductOptionInterface::class); - $productOptionMock->expects(static::exactly(2)) + $productOptionMock->expects($this->exactly(2)) ->method('getExtensionAttributes') ->willReturn($this->productOptionExtensionAttributes); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Price/ConfigurablePriceResolverTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Price/ConfigurablePriceResolverTest.php index 189730e18080c..a54d489c50cbc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Price/ConfigurablePriceResolverTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Pricing/Price/ConfigurablePriceResolverTest.php @@ -79,7 +79,7 @@ public function testResolvePrice($variantPrices, $expectedPrice) ->willReturnOnConsecutiveCalls(...$variantPrices); $actualPrice = $this->resolver->resolvePrice($product); - self::assertSame($expectedPrice, $actualPrice); + $this->assertSame($expectedPrice, $actualPrice); } /** diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/AttributesTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/AttributesTest.php index 4ee7901e3da47..dc7c9540b4dc2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/AttributesTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/AttributesTest.php @@ -79,13 +79,13 @@ protected function setUp() $this->searchResultsMock = $this->getMockBuilder(ProductAttributeSearchResultsInterface::class) ->getMockForAbstractClass(); - $this->contextMock->expects(static::never()) + $this->contextMock->expects($this->never()) ->method('getProcessor') ->willReturn($this->uiElementProcessorMock); - $this->searchCriteriaBuilderMock->expects(static::any()) + $this->searchCriteriaBuilderMock->expects($this->any()) ->method('addFilter') ->willReturnSelf(); - $this->searchCriteriaBuilderMock->expects(static::any()) + $this->searchCriteriaBuilderMock->expects($this->any()) ->method('create') ->willReturn($this->searchCriteriaMock); @@ -175,11 +175,11 @@ public function testPrepareDataSource() $this->attributesColumn->setData('name', $name); - $this->attributeRepositoryMock->expects(static::any()) + $this->attributeRepositoryMock->expects($this->any()) ->method('getList') ->with($this->searchCriteriaMock) ->willReturn($this->searchResultsMock); - $this->searchResultsMock->expects(static::any()) + $this->searchResultsMock->expects($this->any()) ->method('getItems') ->willReturn($attributes); @@ -199,13 +199,13 @@ private function createAttributeMock($attributeCode, $defaultFrontendLabel, arra $attributeMock = $this->getMockBuilder(ProductAttributeInterface::class) ->getMockForAbstractClass(); - $attributeMock->expects(static::any()) + $attributeMock->expects($this->any()) ->method('getAttributeCode') ->willReturn($attributeCode); - $attributeMock->expects(static::any()) + $attributeMock->expects($this->any()) ->method('getDefaultFrontendLabel') ->willReturn($defaultFrontendLabel); - $attributeMock->expects(static::any()) + $attributeMock->expects($this->any()) ->method('getOptions') ->willReturn($options); @@ -224,10 +224,10 @@ private function createAttributeOptionMock($value, $label) $attributeOptionMock = $this->getMockBuilder(AttributeOptionInterface::class) ->getMockForAbstractClass(); - $attributeOptionMock->expects(static::any()) + $attributeOptionMock->expects($this->any()) ->method('getValue') ->willReturn($value); - $attributeOptionMock->expects(static::any()) + $attributeOptionMock->expects($this->any()) ->method('getLabel') ->willReturn($label); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/NameTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/NameTest.php index 06ee3502c0a19..5d40c8f6965bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/NameTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/NameTest.php @@ -48,7 +48,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->contextMock->expects(static::never()) + $this->contextMock->expects($this->never()) ->method('getProcessor') ->willReturn($this->uiElementProcessorMock); @@ -101,7 +101,7 @@ public function testPrepareDataSource() ] ]; - $this->urlBuilderMock->expects(static::any()) + $this->urlBuilderMock->expects($this->any()) ->method('getUrl') ->willReturnMap( [ diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/PriceTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/PriceTest.php index cdae68b4c7a8d..b919b11de251d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/PriceTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/Component/Listing/AssociatedProduct/Columns/PriceTest.php @@ -87,7 +87,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->contextMock->expects(static::never()) + $this->contextMock->expects($this->never()) ->method('getProcessor') ->willReturn($this->uiElementProcessorMock); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CompositeTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CompositeTest.php index c3f2008c8a687..d3d7295fa24ca 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CompositeTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CompositeTest.php @@ -63,7 +63,7 @@ protected function setUp() ->getMockForAbstractClass(); $this->allowedProductTypesMock = $this->createMock(AllowedProductTypes::class); - $this->productLocatorMock->expects(static::any()) + $this->productLocatorMock->expects($this->any()) ->method('getProduct') ->willReturn($this->productMock); @@ -90,23 +90,23 @@ public function testModifyData() ] ]; - $this->productMock->expects(static::any()) + $this->productMock->expects($this->any()) ->method('getTypeId') ->willReturn(ConfigurableType::TYPE_CODE); - $this->allowedProductTypesMock->expects(static::once()) + $this->allowedProductTypesMock->expects($this->once()) ->method('isAllowedProductType') ->with($this->productMock) ->willReturn(true); - $this->productMock->expects(static::any()) + $this->productMock->expects($this->any()) ->method('getId') ->willReturn($productId); - $this->associatedProductsMock->expects(static::any()) + $this->associatedProductsMock->expects($this->any()) ->method('getProductMatrix') ->willReturn($productMatrix); - $this->associatedProductsMock->expects(static::any()) + $this->associatedProductsMock->expects($this->any()) ->method('getProductAttributesIds') ->willReturn($productAttributesIds); - $this->associatedProductsMock->expects(static::any()) + $this->associatedProductsMock->expects($this->any()) ->method('getProductAttributesCodes') ->willReturn($productAttributesCodes); @@ -116,20 +116,20 @@ public function testModifyData() public function testDisallowModifyData() { $data = ['some data']; - $this->productMock->expects(static::any()) + $this->productMock->expects($this->any()) ->method('getTypeId') ->willReturn(ConfigurableType::TYPE_CODE); - $this->allowedProductTypesMock->expects(static::once()) + $this->allowedProductTypesMock->expects($this->once()) ->method('isAllowedProductType') ->with($this->productMock) ->willReturn(false); - $this->productMock->expects(static::never()) + $this->productMock->expects($this->never()) ->method('getId'); - $this->associatedProductsMock->expects(static::never()) + $this->associatedProductsMock->expects($this->never()) ->method('getProductMatrix'); - $this->associatedProductsMock->expects(static::never()) + $this->associatedProductsMock->expects($this->never()) ->method('getProductAttributesIds'); - $this->associatedProductsMock->expects(static::never()) + $this->associatedProductsMock->expects($this->never()) ->method('getProductAttributesCodes'); $this->assertSame($data, $this->createCompositeModifier()->modifyData($data)); @@ -141,14 +141,14 @@ public function testModifyMeta() $resultMeta = ['result_meta']; $modifiers = ['modifier1', 'modifier2']; - $this->productMock->expects(static::any()) + $this->productMock->expects($this->any()) ->method('getTypeId') ->willReturn(ConfigurableType::TYPE_CODE); - $this->allowedProductTypesMock->expects(static::once()) + $this->allowedProductTypesMock->expects($this->once()) ->method('isAllowedProductType') ->with($this->productMock) ->willReturn(true); - $this->objectManagerMock->expects(static::any()) + $this->objectManagerMock->expects($this->any()) ->method('get') ->willReturnMap( [ @@ -164,14 +164,14 @@ public function testDisallowModifyMeta() { $meta = ['some meta']; $modifiers = ['modifier1', 'modifier2']; - $this->productMock->expects(self::any()) + $this->productMock->expects($this->any()) ->method('getTypeId') ->willReturn(ConfigurableType::TYPE_CODE); - $this->allowedProductTypesMock->expects(self::once()) + $this->allowedProductTypesMock->expects($this->once()) ->method('isAllowedProductType') ->with($this->productMock) ->willReturn(false); - $this->objectManagerMock->expects(self::exactly(2)) + $this->objectManagerMock->expects($this->exactly(2)) ->method('get') ->willReturnMap( [ @@ -215,7 +215,7 @@ private function createModifierMock(array $initialMeta, array $resultMeta) $modifierMock = $this->getMockBuilder(ModifierInterface::class) ->getMockForAbstractClass(); - $modifierMock->expects(static::any()) + $modifierMock->expects($this->any()) ->method('modifyMeta') ->with($initialMeta) ->willReturn($resultMeta); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanelTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanelTest.php index 020551ff02537..ff395ff5689cf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanelTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanelTest.php @@ -47,10 +47,10 @@ protected function setUp() $this->productMock = $this->getMockBuilder(ProductInterface::class) ->getMockForAbstractClass(); - $this->productLocatorMock->expects(static::any()) + $this->productLocatorMock->expects($this->any()) ->method('getProduct') ->willReturn($this->productMock); - $this->urlBuilderMock->expects(static::any()) + $this->urlBuilderMock->expects($this->any()) ->method('addSessionParam') ->willReturnSelf(); diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/StockDataTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/StockDataTest.php index 0a65454192adc..6ed1781561cfc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/StockDataTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Ui/DataProvider/Product/Form/Modifier/StockDataTest.php @@ -39,7 +39,7 @@ protected function setUp() $this->productMock = $this->getMockBuilder(ProductInterface::class) ->getMockForAbstractClass(); - $this->productLocatorMock->expects(static::any()) + $this->productLocatorMock->expects($this->any()) ->method('getProduct') ->willReturn($this->productMock); diff --git a/app/code/Magento/Cron/Test/Unit/Model/System/Config/Initial/ConverterTest.php b/app/code/Magento/Cron/Test/Unit/Model/System/Config/Initial/ConverterTest.php index 703926b4c0116..dcb6568b6dd12 100644 --- a/app/code/Magento/Cron/Test/Unit/Model/System/Config/Initial/ConverterTest.php +++ b/app/code/Magento/Cron/Test/Unit/Model/System/Config/Initial/ConverterTest.php @@ -56,7 +56,7 @@ public function testAfterConvertWithNoData() $result = $this->converterPlugin->afterConvert($this->converterMock, $expectedResult); - self::assertSame($expectedResult, $result); + $this->assertSame($expectedResult, $result); } /** @@ -84,6 +84,6 @@ public function testAfterConvertWithData() $result = $this->converterPlugin->afterConvert($this->converterMock, $result); - self::assertEquals($expectedResult, $result); + $this->assertEquals($expectedResult, $result); } } diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php index 14ed09f73325b..7c593a0612406 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Ajax/LoginTest.php @@ -218,7 +218,7 @@ public function testLogin(): void $this->redirect->method('success') ->willReturn('some_url2'); - $this->resultRaw->expects(self::never()) + $this->resultRaw->expects($this->never()) ->method('setHttpResponseCode'); $result = [ @@ -230,7 +230,7 @@ public function testLogin(): void $this->resultJson->method('setData') ->with($result) ->willReturn($loginSuccessResponse); - self::assertEquals($loginSuccessResponse, $this->controller->execute()); + $this->assertEquals($loginSuccessResponse, $this->controller->execute()); } /** @@ -255,10 +255,10 @@ public function testLoginFailure(): void ->with('invalid@example.com', 'invalid') ->willThrowException(new InvalidEmailOrPasswordException(__('Invalid login or password.'))); - $this->customerSession->expects(self::never()) + $this->customerSession->expects($this->never()) ->method('setCustomerDataAsLoggedIn') ->with($customer); - $this->customerSession->expects(self::never()) + $this->customerSession->expects($this->never()) ->method('regenerateId'); $result = [ @@ -269,7 +269,7 @@ public function testLoginFailure(): void ->with($result) ->willReturn($loginFailureResponse); - self::assertEquals($loginFailureResponse, $this->controller->execute()); + $this->assertEquals($loginFailureResponse, $this->controller->execute()); } /** diff --git a/app/code/Magento/Customer/Test/Unit/Model/AccountConfirmationTest.php b/app/code/Magento/Customer/Test/Unit/Model/AccountConfirmationTest.php index 1ce80d9d1e99b..e747ce52db6a3 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/AccountConfirmationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/AccountConfirmationTest.php @@ -71,7 +71,7 @@ public function testIsConfirmationRequired( ->with('skip_confirmation_if_email') ->willReturn($skipConfirmationIfEmail); - self::assertEquals( + $this->assertEquals( $expected, $this->accountConfirmation->isConfirmationRequired($websiteId, $customerId, $customerEmail) ); diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php index a9c6de72acbef..de144b01b77af 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/DataProvider/DocumentTest.php @@ -85,30 +85,30 @@ public function testGetGenderAttribute() $genderId = 1; $this->document->setData('gender', $genderId); - $this->groupRepository->expects(static::never()) + $this->groupRepository->expects($this->never()) ->method('getById'); - $this->storeManager->expects(static::never()) + $this->storeManager->expects($this->never()) ->method('getWebsites'); $metadata = $this->getMockForAbstractClass(AttributeMetadataInterface::class); - $this->customerMetadata->expects(static::once()) + $this->customerMetadata->expects($this->once()) ->method('getAttributeMetadata') ->willReturn($metadata); $option = $this->getMockForAbstractClass(OptionInterface::class); - $metadata->expects(static::once()) + $metadata->expects($this->once()) ->method('getOptions') ->willReturn([$genderId => $option]); - $option->expects(static::once()) + $option->expects($this->once()) ->method('getLabel') ->willReturn('Male'); $attribute = $this->document->getCustomAttribute('gender'); - static::assertEquals('Male', $attribute->getValue()); + $this->assertEquals('Male', $attribute->getValue()); } /** @@ -118,24 +118,24 @@ public function testGetGroupAttribute() { $this->document->setData('group_id', 1); - $this->customerMetadata->expects(static::never()) + $this->customerMetadata->expects($this->never()) ->method('getAttributeMetadata'); - $this->storeManager->expects(static::never()) + $this->storeManager->expects($this->never()) ->method('getWebsites'); $group = $this->getMockForAbstractClass(GroupInterface::class); - $this->groupRepository->expects(static::once()) + $this->groupRepository->expects($this->once()) ->method('getById') ->willReturn($group); - $group->expects(static::once()) + $group->expects($this->once()) ->method('getCode') ->willReturn('General'); $attribute = $this->document->getCustomAttribute('group_id'); - static::assertEquals('General', $attribute->getValue()); + $this->assertEquals('General', $attribute->getValue()); } /** @@ -146,24 +146,24 @@ public function testGetWebsiteAttribute() $websiteId = 1; $this->document->setData('website_id', $websiteId); - $this->groupRepository->expects(static::never()) + $this->groupRepository->expects($this->never()) ->method('getById'); - $this->customerMetadata->expects(static::never()) + $this->customerMetadata->expects($this->never()) ->method('getAttributeMetadata'); $website = $this->getMockForAbstractClass(WebsiteInterface::class); - $this->storeManager->expects(static::once()) + $this->storeManager->expects($this->once()) ->method('getWebsites') ->willReturn([$websiteId => $website]); - $website->expects(static::once()) + $website->expects($this->once()) ->method('getName') ->willReturn('Main Website'); $attribute = $this->document->getCustomAttribute('website_id'); - static::assertEquals('Main Website', $attribute->getValue()); + $this->assertEquals('Main Website', $attribute->getValue()); } /** @@ -174,7 +174,7 @@ public function testGetConfirmationAttribute() $websiteId = 1; $this->document->setData('original_website_id', $websiteId); - $this->scopeConfig->expects(static::once()) + $this->scopeConfig->expects($this->once()) ->method('isSetFlag') ->with() ->willReturn(true); @@ -183,8 +183,8 @@ public function testGetConfirmationAttribute() $attribute = $this->document->getCustomAttribute('confirmation'); $value = $attribute->getValue(); - static::assertInstanceOf(Phrase::class, $value); - static::assertEquals('Confirmed', (string)$value); + $this->assertInstanceOf(Phrase::class, $value); + $this->assertEquals('Confirmed', (string)$value); } /** @@ -197,8 +197,8 @@ public function testGetAccountLockValue() $attribute = $this->document->getCustomAttribute('lock_expires'); $value = $attribute->getValue(); - static::assertInstanceOf(Phrase::class, $value); - static::assertEquals('Unlocked', (string)$value); + $this->assertInstanceOf(Phrase::class, $value); + $this->assertEquals('Unlocked', (string)$value); } /** @@ -214,7 +214,7 @@ private function initAttributeValueFactoryMock() $attributeValue = new AttributeValue(); - $this->attributeValueFactory->expects(static::once()) + $this->attributeValueFactory->expects($this->once()) ->method('create') ->willReturn($attributeValue); } diff --git a/app/code/Magento/Deploy/Test/Unit/Model/FilesystemTest.php b/app/code/Magento/Deploy/Test/Unit/Model/FilesystemTest.php index 00f70c6527a0d..89f2b85742f19 100644 --- a/app/code/Magento/Deploy/Test/Unit/Model/FilesystemTest.php +++ b/app/code/Magento/Deploy/Test/Unit/Model/FilesystemTest.php @@ -131,7 +131,7 @@ public function testRegenerateStatic() ->willReturn($storeLocales); $setupDiCompileCmd = $this->cmdPrefix . 'setup:di:compile'; - $this->shell->expects(self::at(0)) + $this->shell->expects($this->at(0)) ->method('execute') ->with($setupDiCompileCmd); @@ -140,20 +140,20 @@ public function testRegenerateStatic() $usedLocales = ['fr_FR', 'de_DE', 'nl_NL', 'en_US']; $staticContentDeployCmd = $this->cmdPrefix . 'setup:static-content:deploy -f ' . implode(' ', $usedLocales); - $this->shell->expects(self::at(1)) + $this->shell->expects($this->at(1)) ->method('execute') ->with($staticContentDeployCmd); - $this->output->expects(self::at(0)) + $this->output->expects($this->at(0)) ->method('writeln') ->with('Starting compilation'); - $this->output->expects(self::at(2)) + $this->output->expects($this->at(2)) ->method('writeln') ->with('Compilation complete'); - $this->output->expects(self::at(3)) + $this->output->expects($this->at(3)) ->method('writeln') ->with('Starting deployment of static content'); - $this->output->expects(self::at(5)) + $this->output->expects($this->at(5)) ->method('writeln') ->with('Deployment of static content complete'); diff --git a/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php b/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php index dc32de527c8c1..59928e5a769d2 100644 --- a/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php +++ b/app/code/Magento/Deploy/Test/Unit/Process/QueueTest.php @@ -117,7 +117,7 @@ public function testProcess() $this->queue->add($package, []); - $this->resourceConnection->expects(self::never())->method('closeConnection'); + $this->resourceConnection->expects($this->never())->method('closeConnection'); $this->assertEquals(0, $this->queue->process()); } diff --git a/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerDisableCommandTest.php b/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerDisableCommandTest.php index 785413eb10de5..1c153f06fa318 100644 --- a/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerDisableCommandTest.php +++ b/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerDisableCommandTest.php @@ -46,7 +46,7 @@ public function testCommand(bool $fileExists, string $expectedOutput) $commandTester = new CommandTester($command); $commandTester->execute([]); - self::assertEquals( + $this->assertEquals( $expectedOutput, trim(str_replace(PHP_EOL, ' ', $commandTester->getDisplay())) ); diff --git a/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerEnableCommandTest.php b/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerEnableCommandTest.php index 3efdf2d0ef5b8..deb282f12ea8b 100644 --- a/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerEnableCommandTest.php +++ b/app/code/Magento/Developer/Test/Unit/Console/Command/ProfilerEnableCommandTest.php @@ -50,7 +50,7 @@ public function testCommand(string $inputType, bool $fileExists, string $expecte $commandTester = new CommandTester($command); $commandTester->execute(['type' => $inputType]); - self::assertEquals( + $this->assertEquals( $expectedOutput, trim(str_replace(PHP_EOL, ' ', $commandTester->getDisplay())) ); diff --git a/app/code/Magento/Developer/Test/Unit/Console/Command/SourceThemeDeployCommandTest.php b/app/code/Magento/Developer/Test/Unit/Console/Command/SourceThemeDeployCommandTest.php index 648230ab2d1ca..7d4864ce2fbd1 100644 --- a/app/code/Magento/Developer/Test/Unit/Console/Command/SourceThemeDeployCommandTest.php +++ b/app/code/Magento/Developer/Test/Unit/Console/Command/SourceThemeDeployCommandTest.php @@ -87,7 +87,7 @@ public function testExecute() $assetMock = $this->getMockBuilder(LocalInterface::class) ->getMockForAbstractClass(); - $this->validatorMock->expects(self::once()) + $this->validatorMock->expects($this->once()) ->method('isValid') ->with(self::LOCALE_TEST_VALUE) ->willReturn(true); @@ -100,17 +100,17 @@ public function testExecute() self::TYPE_TEST_VALUE ); - $outputMock->expects(self::at(0)) + $outputMock->expects($this->at(0)) ->method('writeln') ->with($message); - $outputMock->expects(self::at(1)) + $outputMock->expects($this->at(1)) ->method('writeln') ->with('-> file-test-value/test/file'); - $outputMock->expects(self::at(2)) + $outputMock->expects($this->at(2)) ->method('writeln') ->with('Successfully processed.'); - $this->assetRepositoryMock->expects(self::once()) + $this->assetRepositoryMock->expects($this->once()) ->method('createAsset') ->with( 'file-test-value/test' . DIRECTORY_SEPARATOR . 'file' . '.' . self::TYPE_TEST_VALUE, @@ -121,11 +121,11 @@ public function testExecute() ] )->willReturn($assetMock); - $this->assetPublisherMock->expects(self::once()) + $this->assetPublisherMock->expects($this->once()) ->method('publish') ->with($assetMock); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getFilePath') ->willReturn(self::FILE_TEST_VALUE); @@ -143,7 +143,7 @@ public function testExecuteIncorrectThemeFormat() /** @var OutputInterface|\PHPUnit_Framework_MockObject_MockObject $outputMock */ $outputMock = $this->getMockBuilder(OutputInterface::class) ->getMockForAbstractClass(); - $this->validatorMock->expects(self::once()) + $this->validatorMock->expects($this->once()) ->method('isValid') ->with(self::LOCALE_TEST_VALUE) ->willReturn(true); @@ -175,12 +175,12 @@ public function testExecuteNonExistingValue() $assetMock = $this->getMockBuilder(LocalInterface::class) ->getMockForAbstractClass(); - $this->validatorMock->expects(self::once()) + $this->validatorMock->expects($this->once()) ->method('isValid') ->with(self::LOCALE_TEST_VALUE) ->willReturn(true); - $this->assetRepositoryMock->expects(self::once()) + $this->assetRepositoryMock->expects($this->once()) ->method('createAsset') ->with( 'file-test-value/test' . DIRECTORY_SEPARATOR . 'file' . '.' . self::TYPE_TEST_VALUE, @@ -191,7 +191,7 @@ public function testExecuteNonExistingValue() ] )->willReturn($assetMock); - $this->assetPublisherMock->expects(self::once()) + $this->assetPublisherMock->expects($this->once()) ->method('publish') ->with($assetMock) ->willThrowException(new \Magento\Framework\View\Asset\File\NotFoundException); @@ -225,12 +225,12 @@ private function getInputMock(array $valueMap = []) ]; $valueMap = empty($valueMap) ? $defaultValueMap : $valueMap; - $inputMock->expects(self::exactly(4)) + $inputMock->expects($this->exactly(4)) ->method('getOption') ->willReturnMap( $valueMap ); - $inputMock->expects(self::once()) + $inputMock->expects($this->once()) ->method('getArgument') ->with('file') ->willReturn([self::FILE_TEST_VALUE]); diff --git a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php index ce64ceb6db83d..8cf5537632614 100644 --- a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php +++ b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php @@ -78,41 +78,41 @@ protected function setUp() */ public function testProcessException() { - $this->lockerProcessMock->expects(self::once()) + $this->lockerProcessMock->expects($this->once()) ->method('lockProcess') - ->with(self::isType('string')); - $this->lockerProcessMock->expects(self::once()) + ->with($this->isType('string')); + $this->lockerProcessMock->expects($this->once()) ->method('unlockProcess'); - $this->alternativeSourceMock->expects(self::once()) + $this->alternativeSourceMock->expects($this->once()) ->method('getAlternativesExtensionsNames') ->willReturn(['less']); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setArea') ->with(self::AREA) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setTheme') ->with(self::THEME) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setLocale') ->with(self::LOCALE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setModule') ->with(self::MODULE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setPath') ->with(self::FILE_PATH) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('build') ->willThrowException(new \Exception()); - $this->assetSourceMock->expects(self::never()) + $this->assetSourceMock->expects($this->never()) ->method('getContent'); $frontendCompilation = new FrontendCompilation( @@ -126,7 +126,7 @@ public function testProcessException() try { $frontendCompilation->process($this->getChainMockExpects('', 0, 1)); } catch (\Exception $e) { - self::assertInstanceOf('\Exception', $e); + $this->assertInstanceOf('\Exception', $e); } } @@ -137,43 +137,43 @@ public function testProcess() { $newContentType = 'less'; - $this->lockerProcessMock->expects(self::once()) + $this->lockerProcessMock->expects($this->once()) ->method('lockProcess') - ->with(self::isType('string')); - $this->lockerProcessMock->expects(self::once()) + ->with($this->isType('string')); + $this->lockerProcessMock->expects($this->once()) ->method('unlockProcess'); $assetMock = $this->getAssetNew(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setArea') ->with(self::AREA) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setTheme') ->with(self::THEME) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setLocale') ->with(self::LOCALE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setModule') ->with(self::MODULE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setPath') ->with(self::FILE_PATH) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('build') ->willReturn($assetMock); - $this->alternativeSourceMock->expects(self::once()) + $this->alternativeSourceMock->expects($this->once()) ->method('getAlternativesExtensionsNames') ->willReturn([$newContentType]); - $this->assetSourceMock->expects(self::once()) + $this->assetSourceMock->expects($this->once()) ->method('getContent') ->with($assetMock) ->willReturn(self::NEW_CONTENT); @@ -212,16 +212,16 @@ private function getChainMockExpects($content = '', $contentExactly = 1, $pathEx { $chainMock = $this->getChainMock(); - $chainMock->expects(self::once()) + $chainMock->expects($this->once()) ->method('getContent') ->willReturn($content); - $chainMock->expects(self::exactly(3)) + $chainMock->expects($this->exactly(3)) ->method('getAsset') ->willReturn($this->getAssetMockExpects($pathExactly)); - $chainMock->expects(self::exactly($contentExactly)) + $chainMock->expects($this->exactly($contentExactly)) ->method('setContent') ->with(self::NEW_CONTENT); - $chainMock->expects(self::exactly($contentExactly)) + $chainMock->expects($this->exactly($contentExactly)) ->method('setContentType') ->with($newContentType); @@ -260,13 +260,13 @@ private function getAssetMockExpects($pathExactly = 1) { $assetMock = $this->getAssetMock(); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getContext') ->willReturn($this->getContextMock()); - $assetMock->expects(self::exactly($pathExactly)) + $assetMock->expects($this->exactly($pathExactly)) ->method('getFilePath') ->willReturn(self::FILE_PATH); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getModule') ->willReturn(self::MODULE); @@ -282,13 +282,13 @@ private function getContextMock() ->disableOriginalConstructor() ->getMock(); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getAreaCode') ->willReturn(self::AREA); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getThemePath') ->willReturn(self::THEME); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getLocale') ->willReturn(self::LOCALE); diff --git a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/PreprocessorStrategyTest.php b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/PreprocessorStrategyTest.php index 8372092c0e763..b61a64ca34166 100644 --- a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/PreprocessorStrategyTest.php +++ b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/PreprocessorStrategyTest.php @@ -86,14 +86,14 @@ public function testProcessClientSideCompilation() { $chainMock = $this->getChainMock(); - $this->scopeConfigMock->expects(self::once()) + $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with(WorkflowType::CONFIG_NAME_PATH) ->willReturn(WorkflowType::CLIENT_SIDE_COMPILATION); - $this->frontendCompilationMock->expects(self::once()) + $this->frontendCompilationMock->expects($this->once()) ->method('process') ->with($chainMock); - $this->alternativeSourceMock->expects(self::never()) + $this->alternativeSourceMock->expects($this->never()) ->method('process'); $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') @@ -106,14 +106,14 @@ public function testProcessClientSideCompilationWithDefaultMode() { $chainMock = $this->getChainMock(); - $this->scopeConfigMock->expects(self::once()) + $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with(WorkflowType::CONFIG_NAME_PATH) ->willReturn(WorkflowType::CLIENT_SIDE_COMPILATION); - $this->frontendCompilationMock->expects(self::once()) + $this->frontendCompilationMock->expects($this->once()) ->method('process') ->with($chainMock); - $this->alternativeSourceMock->expects(self::never()) + $this->alternativeSourceMock->expects($this->never()) ->method('process'); $this->stateMock->expects($this->once()) ->method('getMode') @@ -135,10 +135,10 @@ public function testProcessAlternativeSource() ->method('getValue') ->with(WorkflowType::CONFIG_NAME_PATH) ->willReturn('off'); - $this->alternativeSourceMock->expects(self::once()) + $this->alternativeSourceMock->expects($this->once()) ->method('process') ->with($chainMock); - $this->frontendCompilationMock->expects(self::never()) + $this->frontendCompilationMock->expects($this->never()) ->method('process'); $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php index 96c76a17bc317..1bffc12b1049d 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php @@ -272,11 +272,11 @@ public function testCollectRates() ->method('debug') ->with($this->stringContains('********')); - self::assertNotEmpty($this->model->collectRates($request)->getAllRates()); - self::assertContains('18.223', $rawPostData->getValue($this->httpClient)); - self::assertContains('0.630', $rawPostData->getValue($this->httpClient)); - self::assertContains('0.630', $rawPostData->getValue($this->httpClient)); - self::assertContains('0.630', $rawPostData->getValue($this->httpClient)); + $this->assertNotEmpty($this->model->collectRates($request)->getAllRates()); + $this->assertContains('18.223', $rawPostData->getValue($this->httpClient)); + $this->assertContains('0.630', $rawPostData->getValue($this->httpClient)); + $this->assertContains('0.630', $rawPostData->getValue($this->httpClient)); + $this->assertContains('0.630', $rawPostData->getValue($this->httpClient)); } public function testCollectRatesErrorMessage() diff --git a/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/FixerIoTest.php b/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/FixerIoTest.php index 7efcf0d62712a..afeb263c834f0 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/FixerIoTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/Currency/Import/FixerIoTest.php @@ -115,11 +115,11 @@ public function testFetchRates(): void $httpResponse->method('getBody') ->willReturn($responseBody); - self::assertEquals($expectedCurrencyRateList, $this->model->fetchRates()); + $this->assertEquals($expectedCurrencyRateList, $this->model->fetchRates()); $messages = $this->model->getMessages(); - self::assertNotEmpty($messages); - self::assertTrue(is_array($messages)); - self::assertEquals($message, (string)$messages[0]); + $this->assertNotEmpty($messages); + $this->assertTrue(is_array($messages)); + $this->assertEquals($message, (string)$messages[0]); } } diff --git a/app/code/Magento/Directory/Test/Unit/Model/CurrencyConfigTest.php b/app/code/Magento/Directory/Test/Unit/Model/CurrencyConfigTest.php index 9b52bae26f90f..17567e21c04c6 100644 --- a/app/code/Magento/Directory/Test/Unit/Model/CurrencyConfigTest.php +++ b/app/code/Magento/Directory/Test/Unit/Model/CurrencyConfigTest.php @@ -78,7 +78,7 @@ public function testGetConfigCurrencies(string $areCode) $path = 'test/path'; $expected = ['ARS', 'AUD', 'BZD']; - $this->appState->expects(self::once()) + $this->appState->expects($this->once()) ->method('getAreaCode') ->willReturn($areCode); @@ -87,29 +87,29 @@ public function testGetConfigCurrencies(string $areCode) ->setMethods(['getCode']) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $store->expects(self::once()) + $store->expects($this->once()) ->method('getCode') ->willReturn('testCode'); if ($areCode === Area::AREA_ADMINHTML) { - $this->storeManager->expects(self::once()) + $this->storeManager->expects($this->once()) ->method('getStores') ->willReturn([$store]); } else { - $this->storeManager->expects(self::once()) + $this->storeManager->expects($this->once()) ->method('getStore') ->willReturn($store); } - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('getValue') ->with( - self::identicalTo($path) + $this->identicalTo($path) )->willReturn('ARS,AUD,BZD'); $result = $this->testSubject->getConfigCurrencies($path); - self::assertEquals($expected, $result); + $this->assertEquals($expected, $result); } /** diff --git a/app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/DownloadablePanelTest.php b/app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/DownloadablePanelTest.php index 7eb85a1f3637e..7ab929a7b486c 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/DownloadablePanelTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/DownloadablePanelTest.php @@ -72,13 +72,13 @@ protected function setUp() public function testModifyData($typeId, $isDownloadable) { $productId = 1; - $this->locatorMock->expects(static::once()) + $this->locatorMock->expects($this->once()) ->method('getProduct') ->willReturn($this->productMock); - $this->productMock->expects(static::once()) + $this->productMock->expects($this->once()) ->method('getId') ->willReturn($productId); - $this->productMock->expects(static::once()) + $this->productMock->expects($this->once()) ->method('getTypeId') ->willReturn($typeId); $resultData = [ @@ -106,12 +106,12 @@ public function modifyDataDataProvider() */ public function testModifyMeta() { - $this->locatorMock->expects(static::once()) + $this->locatorMock->expects($this->once()) ->method('getProduct') ->willReturn($this->productMock); - $this->productMock->expects(static::any()) + $this->productMock->expects($this->any()) ->method('getTypeId'); - $this->arrayManagerMock->expects(static::exactly(3)) + $this->arrayManagerMock->expects($this->exactly(3)) ->method('set') ->willReturn([]); diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php index 8ee6de1e44476..2c8347d3818c6 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php @@ -117,8 +117,8 @@ public function testAddSubscriberData() $result = $this->problemModel->addSubscriberData($this->subscriberMock); - self::assertEquals($result, $this->problemModel); - self::assertEquals($subscriberId, $this->problemModel->getSubscriberId()); + $this->assertEquals($result, $this->problemModel); + $this->assertEquals($subscriberId, $this->problemModel->getSubscriberId()); } /** @@ -136,8 +136,8 @@ public function testAddQueueData() $result = $this->problemModel->addQueueData($queueMock); - self::assertEquals($result, $this->problemModel); - self::assertEquals($queueId, $this->problemModel->getQueueId()); + $this->assertEquals($result, $this->problemModel); + $this->assertEquals($queueId, $this->problemModel->getQueueId()); } /** @@ -151,9 +151,9 @@ public function testAddErrorData() $result = $this->problemModel->addErrorData($exception); - self::assertEquals($result, $this->problemModel); - self::assertEquals($exceptionMessage, $this->problemModel->getProblemErrorText()); - self::assertEquals($exceptionCode, $this->problemModel->getProblemErrorCode()); + $this->assertEquals($result, $this->problemModel); + $this->assertEquals($exceptionMessage, $this->problemModel->getProblemErrorText()); + $this->assertEquals($exceptionCode, $this->problemModel->getProblemErrorCode()); } /** @@ -161,7 +161,7 @@ public function testAddErrorData() */ public function testGetSubscriberWithNoSubscriberId() { - self::assertNull($this->problemModel->getSubscriber()); + $this->assertNull($this->problemModel->getSubscriber()); } /** @@ -170,7 +170,7 @@ public function testGetSubscriberWithNoSubscriberId() public function testGetSubscriber() { $this->setSubscriber(); - self::assertEquals($this->subscriberMock, $this->problemModel->getSubscriber()); + $this->assertEquals($this->subscriberMock, $this->problemModel->getSubscriber()); } /** @@ -184,7 +184,7 @@ public function testUnsubscribeWithNoSubscriber() $result = $this->problemModel->unsubscribe(); - self::assertEquals($this->problemModel, $result); + $this->assertEquals($this->problemModel, $result); } /** @@ -206,7 +206,7 @@ public function testUnsubscribe() $result = $this->problemModel->unsubscribe(); - self::assertEquals($this->problemModel, $result); + $this->assertEquals($this->problemModel, $result); } /** diff --git a/app/code/Magento/OfflinePayments/Test/Unit/Block/Info/CheckmoTest.php b/app/code/Magento/OfflinePayments/Test/Unit/Block/Info/CheckmoTest.php index 27705c242a012..cf16b057bc5f8 100644 --- a/app/code/Magento/OfflinePayments/Test/Unit/Block/Info/CheckmoTest.php +++ b/app/code/Magento/OfflinePayments/Test/Unit/Block/Info/CheckmoTest.php @@ -51,13 +51,13 @@ protected function setUp() */ public function testGetPayableTo($details, $expected) { - $this->info->expects(static::at(0)) + $this->info->expects($this->at(0)) ->method('getAdditionalInformation') ->with('payable_to') ->willReturn($details); $this->block->setData('info', $this->info); - static::assertEquals($expected, $this->block->getPayableTo()); + $this->assertEquals($expected, $this->block->getPayableTo()); } /** @@ -80,13 +80,13 @@ public function getPayableToDataProvider() */ public function testGetMailingAddress($details, $expected) { - $this->info->expects(static::at(1)) + $this->info->expects($this->at(1)) ->method('getAdditionalInformation') ->with('mailing_address') ->willReturn($details); $this->block->setData('info', $this->info); - static::assertEquals($expected, $this->block->getMailingAddress()); + $this->assertEquals($expected, $this->block->getMailingAddress()); } /** @@ -107,7 +107,7 @@ public function getMailingAddressDataProvider() public function testConvertAdditionalDataIsNeverCalled() { $mailingAddress = 'blah@blah.com'; - $this->info->expects(static::at(1)) + $this->info->expects($this->at(1)) ->method('getAdditionalInformation') ->with('mailing_address') ->willReturn($mailingAddress); @@ -117,6 +117,6 @@ public function testConvertAdditionalDataIsNeverCalled() $this->block->getMailingAddress(); // And now we get already setted property $this->_mailingAddress - static::assertEquals($mailingAddress, $this->block->getMailingAddress()); + $this->assertEquals($mailingAddress, $this->block->getMailingAddress()); } } diff --git a/app/code/Magento/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php b/app/code/Magento/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php index 51edaea0e659c..525f76733f8f4 100644 --- a/app/code/Magento/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php +++ b/app/code/Magento/OfflinePayments/Test/Unit/Observer/BeforeOrderPaymentSaveObserverTest.php @@ -52,7 +52,7 @@ protected function setUp() ->setMethods(['getPayment']) ->getMock(); - $this->event->expects(self::once()) + $this->event->expects($this->once()) ->method('getPayment') ->willReturn($this->payment); @@ -60,7 +60,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->observer->expects(self::once()) + $this->observer->expects($this->once()) ->method('getEvent') ->willReturn($this->event); @@ -73,20 +73,20 @@ protected function setUp() */ public function testBeforeOrderPaymentSaveWithInstructions($methodCode) { - $this->payment->expects(self::once()) + $this->payment->expects($this->once()) ->method('getMethod') ->willReturn($methodCode); - $this->payment->expects(self::once()) + $this->payment->expects($this->once()) ->method('setAdditionalInformation') ->with('instructions', 'payment configuration'); $method = $this->getMockBuilder(Banktransfer::class) ->disableOriginalConstructor() ->getMock(); - $method->expects(self::once()) + $method->expects($this->once()) ->method('getInstructions') ->willReturn('payment configuration'); - $this->payment->expects(self::once()) + $this->payment->expects($this->once()) ->method('getMethodInstance') ->willReturn($method); @@ -108,10 +108,10 @@ public function dataProviderBeforeOrderPaymentSaveWithInstructions() public function testBeforeOrderPaymentSaveWithCheckmo() { - $this->payment->expects(self::exactly(2)) + $this->payment->expects($this->exactly(2)) ->method('getMethod') ->willReturn(Checkmo::PAYMENT_METHOD_CHECKMO_CODE); - $this->payment->expects(self::exactly(2)) + $this->payment->expects($this->exactly(2)) ->method('setAdditionalInformation') ->willReturnMap( [ @@ -123,13 +123,13 @@ public function testBeforeOrderPaymentSaveWithCheckmo() $method = $this->getMockBuilder(Checkmo::class) ->disableOriginalConstructor() ->getMock(); - $method->expects(self::exactly(2)) + $method->expects($this->exactly(2)) ->method('getPayableTo') ->willReturn('payable to'); - $method->expects(self::exactly(2)) + $method->expects($this->exactly(2)) ->method('getMailingAddress') ->willReturn('mailing address'); - $this->payment->expects(self::once()) + $this->payment->expects($this->once()) ->method('getMethodInstance') ->willReturn($method); $this->_model->execute($this->observer); @@ -141,22 +141,22 @@ public function testBeforeOrderPaymentSaveWithCheckmo() */ public function testBeforeOrderPaymentSaveWithCheckmoWithoutConfig() { - $this->payment->expects(self::exactly(2)) + $this->payment->expects($this->exactly(2)) ->method('getMethod') ->willReturn(Checkmo::PAYMENT_METHOD_CHECKMO_CODE); - $this->payment->expects(self::never()) + $this->payment->expects($this->never()) ->method('setAdditionalInformation'); $method = $this->getMockBuilder(Checkmo::class) ->disableOriginalConstructor() ->getMock(); - $method->expects(self::once()) + $method->expects($this->once()) ->method('getPayableTo') ->willReturn(null); - $method->expects(self::once()) + $method->expects($this->once()) ->method('getMailingAddress') ->willReturn(null); - $this->payment->expects(self::once()) + $this->payment->expects($this->once()) ->method('getMethodInstance') ->willReturn($method); $this->_model->execute($this->observer); @@ -164,10 +164,10 @@ public function testBeforeOrderPaymentSaveWithCheckmoWithoutConfig() public function testBeforeOrderPaymentSaveWithOthers() { - $this->payment->expects(self::exactly(2)) + $this->payment->expects($this->exactly(2)) ->method('getMethod') ->willReturn('somepaymentmethod'); - $this->payment->expects(self::never()) + $this->payment->expects($this->never()) ->method('setAdditionalInformation'); $this->_model->execute($this->observer); diff --git a/app/code/Magento/OfflineShipping/Test/Unit/Model/Quote/Address/FreeShippingTest.php b/app/code/Magento/OfflineShipping/Test/Unit/Model/Quote/Address/FreeShippingTest.php index 8266a39bbbb6d..b5a205fd86f40 100644 --- a/app/code/Magento/OfflineShipping/Test/Unit/Model/Quote/Address/FreeShippingTest.php +++ b/app/code/Magento/OfflineShipping/Test/Unit/Model/Quote/Address/FreeShippingTest.php @@ -85,8 +85,8 @@ public function testIsFreeShipping(int $addressFree, int $fItemFree, int $sItemF }); $actual = $this->model->isFreeShipping($quote, $items); - self::assertEquals($expected, $actual); - self::assertEquals($expected, $address->getFreeShipping()); + $this->assertEquals($expected, $actual); + $this->assertEquals($expected, $address->getFreeShipping()); } /** diff --git a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php index 501fc9fe6a3d9..b49f36cec8f36 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/App/FrontController/VarnishPluginTest.php @@ -97,18 +97,18 @@ protected function setUp() */ public function testAfterDispatchReturnsCache($state, $countHeader) { - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('isEnabled') ->willReturn(true); - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('getType') ->willReturn(Config::VARNISH); - $this->versionMock->expects(static::once()) + $this->versionMock->expects($this->once()) ->method('process'); - $this->stateMock->expects(static::once()) + $this->stateMock->expects($this->once()) ->method('getMode') ->willReturn($state); - $this->responseMock->expects(static::exactly($countHeader)) + $this->responseMock->expects($this->exactly($countHeader)) ->method('setHeader') ->with('X-Magento-Debug'); @@ -120,17 +120,17 @@ public function testAfterDispatchReturnsCache($state, $countHeader) public function testAfterDispatchNotResponse() { - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('isEnabled') ->willReturn(true); - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('getType') ->willReturn(Config::VARNISH); - $this->versionMock->expects(static::never()) + $this->versionMock->expects($this->never()) ->method('process'); - $this->stateMock->expects(static::never()) + $this->stateMock->expects($this->never()) ->method('getMode'); - $this->resultMock->expects(static::never()) + $this->resultMock->expects($this->never()) ->method('setHeader'); $this->assertSame( @@ -141,15 +141,15 @@ public function testAfterDispatchNotResponse() public function testAfterDispatchDisabled() { - $this->configMock->expects(static::any()) + $this->configMock->expects($this->any()) ->method('getType') ->willReturn(null); - $this->versionMock->expects(static::never()) + $this->versionMock->expects($this->never()) ->method('process'); - $this->stateMock->expects(static::any()) + $this->stateMock->expects($this->any()) ->method('getMode') ->willReturn(AppState::MODE_DEVELOPER); - $this->responseMock->expects(static::never()) + $this->responseMock->expects($this->never()) ->method('setHeader'); $this->assertSame( diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/BuiltinPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/BuiltinPluginTest.php index fc4e056734939..d8573b9cbd6b0 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/BuiltinPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/BuiltinPluginTest.php @@ -88,7 +88,7 @@ protected function setUp() $this->httpHeaderMock = $this->getMockBuilder(HttpHeaderInterface::class) ->getMockForAbstractClass(); - $this->responseMock->expects(static::any()) + $this->responseMock->expects($this->any()) ->method('getHeader') ->willReturnMap( [ @@ -96,10 +96,10 @@ protected function setUp() ['Cache-Control', $this->httpHeaderMock] ] ); - $this->configMock->expects(static::any()) + $this->configMock->expects($this->any()) ->method('isEnabled') ->willReturn(true); - $this->configMock->expects(static::any()) + $this->configMock->expects($this->any()) ->method('getType') ->willReturn(Config::BUILT_IN); @@ -117,11 +117,11 @@ protected function setUp() public function testAfterResultWithoutPlugin() { - $this->registryMock->expects(static::once()) + $this->registryMock->expects($this->once()) ->method('registry') ->with('use_page_cache_plugin') ->willReturn(false); - $this->kernelMock->expects(static::never()) + $this->kernelMock->expects($this->never()) ->method('process') ->with($this->responseMock); @@ -133,23 +133,23 @@ public function testAfterResultWithoutPlugin() public function testAfterResultWithPlugin() { - $this->registryMock->expects(static::once()) + $this->registryMock->expects($this->once()) ->method('registry') ->with('use_page_cache_plugin') ->willReturn(true); - $this->stateMock->expects(static::once()) + $this->stateMock->expects($this->once()) ->method('getMode') ->willReturn(null); - $this->httpHeaderMock->expects(static::any()) + $this->httpHeaderMock->expects($this->any()) ->method('getFieldValue') ->willReturn('tag,tag'); - $this->responseMock->expects(static::once()) + $this->responseMock->expects($this->once()) ->method('clearHeader') ->with('X-Magento-Tags'); - $this->responseMock->expects(static::once()) + $this->responseMock->expects($this->once()) ->method('setHeader') ->with('X-Magento-Tags', 'tag,' . CacheType::CACHE_TAG); - $this->kernelMock->expects(static::once()) + $this->kernelMock->expects($this->once()) ->method('process') ->with($this->responseMock); @@ -161,31 +161,31 @@ public function testAfterResultWithPlugin() public function testAfterResultWithPluginDeveloperMode() { - $this->registryMock->expects(static::once()) + $this->registryMock->expects($this->once()) ->method('registry') ->with('use_page_cache_plugin') ->willReturn(true); - $this->stateMock->expects(static::once()) + $this->stateMock->expects($this->once()) ->method('getMode') ->willReturn(AppState::MODE_DEVELOPER); - $this->httpHeaderMock->expects(static::any()) + $this->httpHeaderMock->expects($this->any()) ->method('getFieldValue') ->willReturnOnConsecutiveCalls('test', 'tag,tag2'); - $this->responseMock->expects(static::any()) + $this->responseMock->expects($this->any()) ->method('setHeader') ->withConsecutive( ['X-Magento-Cache-Control', 'test'], ['X-Magento-Cache-Debug', 'MISS', true], ['X-Magento-Tags', 'tag,tag2,' . CacheType::CACHE_TAG] ); - $this->responseMock->expects(static::once()) + $this->responseMock->expects($this->once()) ->method('clearHeader') ->with('X-Magento-Tags'); - $this->registryMock->expects(static::once()) + $this->registryMock->expects($this->once()) ->method('registry') ->with('use_page_cache_plugin') ->willReturn(true); - $this->kernelMock->expects(static::once()) + $this->kernelMock->expects($this->once()) ->method('process') ->with($this->responseMock); diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/VarnishPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/VarnishPluginTest.php index 7be860182f5e0..27ddf0386bee6 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/VarnishPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/Controller/Result/VarnishPluginTest.php @@ -101,23 +101,23 @@ protected function setUp() */ public function testAfterRenderResult($usePlugin, $setCacheDebugHeaderCount, $getModeCount, $processCount) { - $this->responseMock->expects(static::exactly($setCacheDebugHeaderCount)) + $this->responseMock->expects($this->exactly($setCacheDebugHeaderCount)) ->method('setHeader') ->with('X-Magento-Debug', 1); - $this->registryMock->expects(static::once()) + $this->registryMock->expects($this->once()) ->method('registry') ->with('use_page_cache_plugin') ->willReturn($usePlugin); - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('isEnabled') ->willReturn(true); - $this->configMock->expects(static::once()) + $this->configMock->expects($this->once()) ->method('getType') ->willReturn(Config::VARNISH); - $this->appStateMock->expects(static::exactly($getModeCount)) + $this->appStateMock->expects($this->exactly($getModeCount)) ->method('getMode') ->willReturn(AppState::MODE_DEVELOPER); - $this->versionMock->expects(static::exactly($processCount)) + $this->versionMock->expects($this->exactly($processCount)) ->method('process'); $this->assertSame( diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php index 1146eb7c5630e..8abba591f0308 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Command/CommandPoolTest.php @@ -22,7 +22,7 @@ public function testGet() ->disableOriginalConstructor() ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -31,18 +31,18 @@ public function testGet() ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('offsetExists') ->with('command') ->willReturn(true); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('offsetGet') ->with('command') ->willReturn($commandI); $pool = new CommandPool($tMapFactory, [\Magento\Payment\Gateway\CommandInterface::class]); - static::assertSame($commandI, $pool->get('command')); + $this->assertSame($commandI, $pool->get('command')); } public function testGetException() @@ -57,7 +57,7 @@ public function testGetException() ->disableOriginalConstructor() ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -66,7 +66,7 @@ public function testGetException() ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('offsetExists') ->with('command') ->willReturn(false); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php index 7acb595384332..03cd363b7ea6b 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Command/GatewayCommandTest.php @@ -110,11 +110,11 @@ public function testExecuteValidationFail() $this->processRequest($commandSubject, false, $validationFailures); - $this->logger->expects(self::exactly(count($validationFailures))) + $this->logger->expects($this->exactly(count($validationFailures))) ->method('critical') ->withConsecutive( - [self::equalTo('Payment Error: ' . $validationFailures[0])], - [self::equalTo('Payment Error: ' . $validationFailures[1])] + [$this->equalTo('Payment Error: ' . $validationFailures[0])], + [$this->equalTo('Payment Error: ' . $validationFailures[1])] ); $this->command->execute($commandSubject); @@ -146,12 +146,12 @@ public function testExecuteValidationFailWithMappedErrors() ] ); - $this->logger->expects(self::exactly(count(array_merge($validationFailures, $errorCodes)))) + $this->logger->expects($this->exactly(count(array_merge($validationFailures, $errorCodes)))) ->method('critical') ->withConsecutive( - [self::equalTo('Payment Error: Unauthorized')], - [self::equalTo('Payment Error: Failure Mapped')], - [self::equalTo('Payment Error: Failure #2')] + [$this->equalTo('Payment Error: Unauthorized')], + [$this->equalTo('Payment Error: Failure Mapped')], + [$this->equalTo('Payment Error: Failure #2')] ); $this->command->execute($commandSubject); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php index ac44d9830fbc6..e19f6ad8c9103 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Config/ValueHandlerPoolTest.php @@ -18,7 +18,7 @@ public function testConstructorException() ->setMethods(['create']) ->getMock(); - $tMapFactory->expects(static::never()) + $tMapFactory->expects($this->never()) ->method('create'); new ValueHandlerPool($tMapFactory, []); } @@ -39,7 +39,7 @@ public function testGet() ->disableOriginalConstructor() ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -52,7 +52,7 @@ public function testGet() ] ) ->willReturn($tMap); - $tMap->expects(static::exactly(3)) + $tMap->expects($this->exactly(3)) ->method('offsetExists') ->willReturnMap( [ @@ -60,7 +60,7 @@ public function testGet() ['some_value', true] ] ); - $tMap->expects(static::exactly(3)) + $tMap->expects($this->exactly(3)) ->method('offsetGet') ->willReturnMap( [ @@ -76,8 +76,8 @@ public function testGet() 'some_value' => \Magento\Payment\Gateway\Config\ValueHandlerInterface::class ] ); - static::assertSame($someValueHandler, $pool->get('some_value')); - static::assertSame($defaultHandler, $pool->get(ValueHandlerPool::DEFAULT_HANDLER)); - static::assertSame($defaultHandler, $pool->get('no_custom_logic_required')); + $this->assertSame($someValueHandler, $pool->get('some_value')); + $this->assertSame($defaultHandler, $pool->get(ValueHandlerPool::DEFAULT_HANDLER)); + $this->assertSame($defaultHandler, $pool->get('no_custom_logic_required')); } } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php index 546dadfb1bf62..307e90455faea 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/SoapTest.php @@ -66,32 +66,32 @@ public function testPlaceRequest() ]; $soapResult = new \StdClass(); - $this->logger->expects(static::at(0)) + $this->logger->expects($this->at(0)) ->method('debug') ->with( ['request' => ['body']] ); - $this->clientFactory->expects(static::once()) + $this->clientFactory->expects($this->once()) ->method('create') ->with('path_to_wsdl', ['trace' => true]) ->willReturn($this->client); $transferObject = $this->getTransferObject(); - $transferObject->expects(static::any()) + $transferObject->expects($this->any()) ->method('__setSoapHeaders') ->with(['headers']); - $this->client->expects(static::once()) + $this->client->expects($this->once()) ->method('__soapCall') ->with('soapMethod', [['body']]) ->willReturn($soapResult); - $this->converter->expects(static::once()) + $this->converter->expects($this->once()) ->method('convert') ->with($soapResult) ->willReturn($expectedResult); - $this->logger->expects(static::at(1)) + $this->logger->expects($this->at(1)) ->method('debug') ->with(['response' => $expectedResult]); - static::assertEquals( + $this->assertEquals( $expectedResult, $this->gatewayClient->placeRequest($transferObject) ); @@ -101,27 +101,27 @@ public function testPlaceRequestSoapException() { $this->expectException('Exception'); - $this->logger->expects(static::at(0)) + $this->logger->expects($this->at(0)) ->method('debug') ->with( ['request' => ['body']] ); - $this->clientFactory->expects(static::once()) + $this->clientFactory->expects($this->once()) ->method('create') ->with('path_to_wsdl', ['trace' => true]) ->willReturn($this->client); $transferObject = $this->getTransferObject(); - $transferObject->expects(static::any()) + $transferObject->expects($this->any()) ->method('__setSoapHeaders') ->with(['headers']); - $this->client->expects(static::once()) + $this->client->expects($this->once()) ->method('__soapCall') ->with('soapMethod', [['body']]) ->willThrowException(new \Exception()); - $this->client->expects(static::once()) + $this->client->expects($this->once()) ->method('__getLastRequest') ->willReturn('RequestTrace'); - $this->logger->expects(static::at(1)) + $this->logger->expects($this->at(1)) ->method('debug') ->with( ['trace' => 'RequestTrace'] @@ -141,13 +141,13 @@ private function getTransferObject() \Magento\Payment\Gateway\Http\TransferInterface::class )->setMethods(['__setSoapHeaders', 'getBody', 'getClientConfig', 'getMethod'])->getMockForAbstractClass(); - $transferObject->expects(static::any()) + $transferObject->expects($this->any()) ->method('getBody') ->willReturn(['body']); - $transferObject->expects(static::any()) + $transferObject->expects($this->any()) ->method('getClientConfig') ->willReturn(['wsdl' => 'path_to_wsdl']); - $transferObject->expects(static::any()) + $transferObject->expects($this->any()) ->method('getMethod') ->willReturn('soapMethod'); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php index 642619ec7f5ae..49b8438599a1b 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Client/ZendTest.php @@ -155,7 +155,7 @@ private function setClientTransferObjects() $this->transferObjectMock->expects($this->once())->method('getHeaders')->willReturn($headers); $this->transferObjectMock->expects($this->atLeastOnce())->method('getBody')->willReturn($body); $this->transferObjectMock->expects($this->once())->method('shouldEncode')->willReturn($shouldEncode); - $this->transferObjectMock->expects(static::atLeastOnce())->method('getUri')->willReturn($uri); + $this->transferObjectMock->expects($this->atLeastOnce())->method('getUri')->willReturn($uri); $this->clientMock->expects($this->once())->method('setConfig')->with($config)->willReturnSelf(); $this->clientMock->expects($this->once())->method('setMethod')->with($method)->willReturnSelf(); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/HtmlFormConverterTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/HtmlFormConverterTest.php index 9ea0472b04e65..6d701486d3485 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/HtmlFormConverterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/HtmlFormConverterTest.php @@ -18,7 +18,7 @@ public function testConvert() ]; $converter = new HtmlFormConverter(); - static::assertEquals($expectedResult, $converter->convert($this->getValidFormHtml())); + $this->assertEquals($expectedResult, $converter->convert($this->getValidFormHtml())); } public function testConvertNotValidHtml() diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/Soap/ObjectToArrayConverterTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/Soap/ObjectToArrayConverterTest.php index 7de5bc66dad78..e6a3eb7841d54 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/Soap/ObjectToArrayConverterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/Converter/Soap/ObjectToArrayConverterTest.php @@ -29,6 +29,6 @@ public function testConvert() ]; $converter = new ObjectToArrayConverter(); - static::assertEquals($output, $converter->convert($input)); + $this->assertEquals($output, $converter->convert($input)); } } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Http/TransferTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Http/TransferTest.php index 03fbd68883259..db358742f29d7 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Http/TransferTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Http/TransferTest.php @@ -29,11 +29,11 @@ public function testIO() $encode ); - static::assertSame($clientConfig, $transfer->getClientConfig()); - static::assertSame($headers, $transfer->getHeaders()); - static::assertSame($body, $transfer->getBody()); - static::assertSame($method, $transfer->getMethod()); - static::assertSame($uri, $transfer->getUri()); - static::assertSame($encode, $transfer->shouldEncode()); + $this->assertSame($clientConfig, $transfer->getClientConfig()); + $this->assertSame($headers, $transfer->getHeaders()); + $this->assertSame($body, $transfer->getBody()); + $this->assertSame($method, $transfer->getMethod()); + $this->assertSame($uri, $transfer->getUri()); + $this->assertSame($encode, $transfer->shouldEncode()); } } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php index 190875fb6f82c..b3ac4fe4c10c3 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Request/BuilderCompositeTest.php @@ -20,7 +20,7 @@ public function testBuildEmpty() ->disableOriginalConstructor() ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -29,12 +29,12 @@ public function testBuildEmpty() ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('getIterator') ->willReturn(new \ArrayIterator([])); $builder = new BuilderComposite($tMapFactory, []); - static::assertEquals([], $builder->build([])); + $this->assertEquals([], $builder->build([])); } /** @@ -58,7 +58,7 @@ public function testBuild(array $expected) $magentoBuilder = $this->getMockBuilder(\Magento\Payment\Gateway\Request\BuilderInterface::class) ->getMockForAbstractClass(); - $customerBuilder->expects(static::once()) + $customerBuilder->expects($this->once()) ->method('build') ->willReturn( [ @@ -66,7 +66,7 @@ public function testBuild(array $expected) 'address' => $expected['address'] ] ); - $productBuilder->expects(static::once()) + $productBuilder->expects($this->once()) ->method('build') ->willReturn( [ @@ -77,7 +77,7 @@ public function testBuild(array $expected) 'options' => ['product' => $expected['options']['product']] ] ); - $magentoBuilder->expects(static::once()) + $magentoBuilder->expects($this->once()) ->method('build') ->willReturn( [ @@ -86,7 +86,7 @@ public function testBuild(array $expected) ] ); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -99,7 +99,7 @@ public function testBuild(array $expected) ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('getIterator') ->willReturn(new \ArrayIterator([$customerBuilder, $productBuilder, $magentoBuilder])); @@ -112,7 +112,7 @@ public function testBuild(array $expected) ] ); - static::assertEquals($expected, $builder->build([])); + $this->assertEquals($expected, $builder->build([])); } /** diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php index 3563466abb929..684b2af8d3528 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Response/HandlerChainTest.php @@ -24,7 +24,7 @@ public function testHandle() ->disableOriginalConstructor() ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -36,16 +36,16 @@ public function testHandle() ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('getIterator') ->willReturn(new \ArrayIterator([$handler1, $handler2])); $handlingSubject = []; $response = []; - $handler1->expects(static::once()) + $handler1->expects($this->once()) ->method('handle') ->with($handlingSubject, $response); - $handler2->expects(static::once()) + $handler2->expects($this->once()) ->method('handle') ->with($handlingSubject, $response); diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php index 7352cb7a4ac6d..d403502542ce2 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorCompositeTest.php @@ -25,7 +25,7 @@ public function testValidate() ->disableOriginalConstructor() ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -37,29 +37,29 @@ public function testValidate() ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('getIterator') ->willReturn(new \ArrayIterator([$validator1, $validator2])); $resultSuccess = $this->getMockBuilder(\Magento\Payment\Gateway\Validator\ResultInterface::class) ->getMockForAbstractClass(); - $resultSuccess->expects(static::once()) + $resultSuccess->expects($this->once()) ->method('isValid') ->willReturn(true); $resultFail = $this->getMockBuilder(\Magento\Payment\Gateway\Validator\ResultInterface::class) ->getMockForAbstractClass(); - $resultFail->expects(static::once()) + $resultFail->expects($this->once()) ->method('isValid') ->willReturn(false); - $resultFail->expects(static::once()) + $resultFail->expects($this->once()) ->method('getFailsDescription') ->willReturn(['Fail']); - $validator1->expects(static::once()) + $validator1->expects($this->once()) ->method('validate') ->with($validationSubject) ->willReturn($resultSuccess); - $validator2->expects(static::once()) + $validator2->expects($this->once()) ->method('validate') ->with($validationSubject) ->willReturn($resultFail); @@ -70,7 +70,7 @@ public function testValidate() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $resultFactory->expects(static::once()) + $resultFactory->expects($this->once()) ->method('create') ->with( [ @@ -89,6 +89,6 @@ public function testValidate() 'validator2' => \Magento\Payment\Gateway\Validator\ValidatorInterface::class ] ); - static::assertSame($compositeResult, $validatorComposite->validate($validationSubject)); + $this->assertSame($compositeResult, $validatorComposite->validate($validationSubject)); } } diff --git a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php index 64750ec4f5e29..fbdcaaa8bb03d 100644 --- a/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php +++ b/app/code/Magento/Payment/Test/Unit/Gateway/Validator/ValidatorPoolTest.php @@ -22,7 +22,7 @@ public function testGet() ->setMethods(['create']) ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -31,11 +31,11 @@ public function testGet() ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('offsetExists') ->with('validator') ->willReturn(true); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('offsetGet') ->with('validator') ->willReturn($commandI); @@ -45,7 +45,7 @@ public function testGet() ['validator' => \Magento\Payment\Gateway\Validator\ValidatorInterface::class] ); - static::assertSame($commandI, $pool->get('validator')); + $this->assertSame($commandI, $pool->get('validator')); } public function testGetException() @@ -60,7 +60,7 @@ public function testGetException() ->disableOriginalConstructor() ->getMock(); - $tMapFactory->expects(static::once()) + $tMapFactory->expects($this->once()) ->method('create') ->with( [ @@ -69,7 +69,7 @@ public function testGetException() ] ) ->willReturn($tMap); - $tMap->expects(static::once()) + $tMap->expects($this->once()) ->method('offsetExists') ->with('validator') ->willReturn(false); diff --git a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php index 3965822bcb830..d1874d3cf6e86 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Checks/CanUseForCountry/CountryProviderTest.php @@ -56,20 +56,20 @@ public function testGetCountry() ->setMethods(['getCountry']) ->getMock(); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getBillingAddress') ->willReturn($address); - $this->quote->expects(static::never()) + $this->quote->expects($this->never()) ->method('getShippingAddress'); - $address->expects(static::exactly(2)) + $address->expects($this->exactly(2)) ->method('getCountry') ->willReturn('UK'); - $this->directory->expects(static::never()) + $this->directory->expects($this->never()) ->method('getDefaultCountry'); - static::assertEquals('UK', $this->countryProvider->getCountry($this->quote)); + $this->assertEquals('UK', $this->countryProvider->getCountry($this->quote)); } /** @@ -82,19 +82,19 @@ public function testGetCountryForBillingAddressWithoutCountry() ->setMethods(['getCountry']) ->getMock(); - $this->quote->expects(static::never()) + $this->quote->expects($this->never()) ->method('getShippingAddress'); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getBillingAddress') ->willReturn($address); - $address->expects(static::once()) + $address->expects($this->once()) ->method('getCountry') ->willReturn(null); - $this->directory->expects(static::once()) + $this->directory->expects($this->once()) ->method('getDefaultCountry') ->willReturn('US'); - static::assertEquals('US', $this->countryProvider->getCountry($this->quote)); + $this->assertEquals('US', $this->countryProvider->getCountry($this->quote)); } /** @@ -107,21 +107,21 @@ public function testGetCountryShippingAddress() ->setMethods(['getCountry']) ->getMock(); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getBillingAddress') ->willReturn(null); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getShippingAddress') ->willReturn($address); - $address->expects(static::exactly(2)) + $address->expects($this->exactly(2)) ->method('getCountry') ->willReturn('CA'); - $this->directory->expects(static::never()) + $this->directory->expects($this->never()) ->method('getDefaultCountry'); - static::assertEquals('CA', $this->countryProvider->getCountry($this->quote)); + $this->assertEquals('CA', $this->countryProvider->getCountry($this->quote)); } } diff --git a/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php index 584da622b1aad..2cc4f9543de15 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/ConfigTest.php @@ -124,22 +124,22 @@ protected function setUp() public function testGetActiveMethods($isActive) { $adapter = $this->createMock(MethodInterface::class); - $this->scopeConfig->expects(static::once()) + $this->scopeConfig->expects($this->once()) ->method('getValue') ->with('payment', ScopeInterface::SCOPE_STORE, null) ->willReturn($this->paymentMethodsList); - $this->paymentMethodFactory->expects(static::once()) + $this->paymentMethodFactory->expects($this->once()) ->method('create') ->with($this->paymentMethodsList['active_method']['model']) ->willReturn($adapter); - $adapter->expects(static::once()) + $adapter->expects($this->once()) ->method('setStore') ->with(null); - $adapter->expects(static::once()) + $adapter->expects($this->once()) ->method('getConfigData') - ->with('active', static::isNull()) + ->with('active', $this->isNull()) ->willReturn($isActive); - static::assertEquals($isActive ? ['active_method' => $adapter] : [], $this->config->getActiveMethods()); + $this->assertEquals($isActive ? ['active_method' => $adapter] : [], $this->config->getActiveMethods()); } /** diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/AbstractMethodTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/AbstractMethodTest.php index f92c75d1adb03..320e1fab8f9df 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Method/AbstractMethodTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Method/AbstractMethodTest.php @@ -131,7 +131,7 @@ public function testAssignData() AbstractDataAssignObserver::DATA_CODE => $data ]; - $this->eventManagerMock->expects(static::exactly(2)) + $this->eventManagerMock->expects($this->exactly(2)) ->method('dispatch') ->willReturnMap( [ diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php index f5ceac60804f8..1fa2919899370 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Method/AdapterTest.php @@ -150,19 +150,19 @@ public function testIsAvailableNotActive() { $activeValueHandler = $this->createMock(ValueHandlerInterface::class); - $this->valueHandlerPool->expects(static::once()) + $this->valueHandlerPool->expects($this->once()) ->method('get') ->with('active') ->willReturn($activeValueHandler); - $activeValueHandler->expects(static::once()) + $activeValueHandler->expects($this->once()) ->method('handle') ->with(['field' => 'active']) ->willReturn(false); - $this->eventManager->expects(static::never()) + $this->eventManager->expects($this->never()) ->method('dispatch'); - static::assertFalse($this->adapter->isAvailable(null)); + $this->assertFalse($this->adapter->isAvailable(null)); } /** @@ -176,35 +176,35 @@ public function testIsAvailableEmptyQuote() $validationResult = $this->createMock(ResultInterface::class); $paymentInfo = $this->createMock(InfoInterface::class); - $this->valueHandlerPool->expects(static::once()) + $this->valueHandlerPool->expects($this->once()) ->method('get') ->with('active') ->willReturn($activeValueHandler); - $activeValueHandler->expects(static::once()) + $activeValueHandler->expects($this->once()) ->method('handle') ->with(['field' => 'active', 'payment' => $paymentDO]) ->willReturn(true); - $this->validatorPool->expects(static::once()) + $this->validatorPool->expects($this->once()) ->method('get') ->with('availability') ->willReturn($availabilityValidator); - $this->paymentDataObjectFactory->expects(static::exactly(2)) + $this->paymentDataObjectFactory->expects($this->exactly(2)) ->method('create') ->with($paymentInfo) ->willReturn($paymentDO); - $availabilityValidator->expects(static::once()) + $availabilityValidator->expects($this->once()) ->method('validate') ->willReturn($validationResult); - $validationResult->expects(static::once()) + $validationResult->expects($this->once()) ->method('isValid') ->willReturn(true); - $this->eventManager->expects(static::once()) + $this->eventManager->expects($this->once()) ->method('dispatch'); $this->adapter->setInfoInstance($paymentInfo); - static::assertTrue($this->adapter->isAvailable(null)); + $this->assertTrue($this->adapter->isAvailable(null)); } /** @@ -213,23 +213,23 @@ public function testIsAvailableEmptyQuote() public function testIsAvailableWithEmptyInfoInstance() { $activeValueHandler = $this->createMock(ValueHandlerInterface::class); - $this->valueHandlerPool->expects(static::once()) + $this->valueHandlerPool->expects($this->once()) ->method('get') ->with('active') ->willReturn($activeValueHandler); - $activeValueHandler->expects(static::once()) + $activeValueHandler->expects($this->once()) ->method('handle') ->with(['field' => 'active']) ->willReturn(true); - $this->validatorPool->expects(static::never()) + $this->validatorPool->expects($this->never()) ->method('get') ->with('availability'); - $this->eventManager->expects(static::once()) + $this->eventManager->expects($this->once()) ->method('dispatch'); - static::assertTrue($this->adapter->isAvailable(null)); + $this->assertTrue($this->adapter->isAvailable(null)); } public function testExecuteCommandWithCommandExecutor() @@ -274,21 +274,21 @@ public function testExecuteCommandWithCommandExecutor() $valueHandler = $this->createMock(ValueHandlerInterface::class); - $valueHandlerPool->expects(static::once()) + $valueHandlerPool->expects($this->once()) ->method('get') ->with('can_authorize') ->willReturn($valueHandler); - $valueHandler->expects(static::once()) + $valueHandler->expects($this->once()) ->method('handle') ->with(['field' => 'can_authorize']) ->willReturn(true); - $paymentDataObjectFactory->expects(static::once()) + $paymentDataObjectFactory->expects($this->once()) ->method('create') ->with($paymentInfo) ->willReturn($paymentDO); - $commandManager->expects(static::once()) + $commandManager->expects($this->once()) ->method('executeByCode') ->with('authorize', $paymentInfo, ['amount' => 10, 'payment' => $paymentDO]) ->willReturn(null); @@ -331,25 +331,25 @@ public function testExecuteCommandWithCommandPool() $valueHandler = $this->createMock(ValueHandlerInterface::class); $command = $this->createMock(CommandInterface::class); - $valueHandlerPool->expects(static::once()) + $valueHandlerPool->expects($this->once()) ->method('get') ->with('can_authorize') ->willReturn($valueHandler); - $valueHandler->expects(static::once()) + $valueHandler->expects($this->once()) ->method('handle') ->with(['field' => 'can_authorize']) ->willReturn(true); - $paymentDataObjectFactory->expects(static::once()) + $paymentDataObjectFactory->expects($this->once()) ->method('create') ->with($paymentInfo) ->willReturn($paymentDO); - $commandPool->expects(static::once()) + $commandPool->expects($this->once()) ->method('get') ->with('authorize') ->willReturn($command); - $command->expects(static::once()) + $command->expects($this->once()) ->method('execute') ->with(['amount' => 10, 'payment' => $paymentDO]) ->willReturn(null); diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/CcTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/CcTest.php index 2891b02d82eab..c25f8f31b4a3f 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Method/CcTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Method/CcTest.php @@ -61,7 +61,7 @@ public function testAssignData() 'cc_ss_start_year' => '30' ]; - $payment->expects(static::once()) + $payment->expects($this->once()) ->method('addData') ->with( $expectedData diff --git a/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php b/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php index 3ac07af3d452d..a45c1fe100d19 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Method/LoggerTest.php @@ -52,7 +52,7 @@ public function testDebugOnNoReplaceKeys() 'request' => ['data1' => '123', 'data2' => '123'] ]; - $this->loggerMock->expects(static::once()) + $this->loggerMock->expects($this->once()) ->method('debug') ->with(var_export($debugData, true)); diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php index ed0da1fb0dd4e..e2a8f0e593a15 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/Store/SwitcherPluginTest.php @@ -53,11 +53,11 @@ protected function setUp() */ public function testBeforeGetUrl($countryParam, $getUrlParams) { - $this->requestMock->expects(static::once()) + $this->requestMock->expects($this->once()) ->method('getParam') ->with(ConfigStructurePlugin::REQUEST_PARAM_COUNTRY) ->willReturn($countryParam); - $this->subjectMock->expects(static::any()) + $this->subjectMock->expects($this->any()) ->method('getRequest') ->willReturn($this->requestMock); diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/HintTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/HintTest.php index 452e06cd83a50..9632d34558c88 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/HintTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Adminhtml/System/Config/Fieldset/HintTest.php @@ -46,15 +46,15 @@ public function testRender() $expected .= 'Configuration Details'; $expected .= '

'; - $this->element->expects(static::exactly(2)) + $this->element->expects($this->exactly(2)) ->method('getComment') ->willReturn('http://test.com'); - $this->element->expects(static::once()) + $this->element->expects($this->once()) ->method('getHtmlId') ->willReturn('payment'); - static::assertSame($expected, $this->block->render($this->element)); + $this->assertSame($expected, $this->block->render($this->element)); } /** @@ -62,13 +62,13 @@ public function testRender() */ public function testRenderEmptyComment() { - $this->element->expects(static::once()) + $this->element->expects($this->once()) ->method('getComment') ->willReturn(''); - $this->element->expects(static::never()) + $this->element->expects($this->never()) ->method('getHtmlId'); - static::assertSame('', $this->block->render($this->element)); + $this->assertSame('', $this->block->render($this->element)); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php index 27ed799a4adb7..149c565ad487c 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Express/ReviewTest.php @@ -188,9 +188,9 @@ public function testGetEmailWhenBillingAddressNotExist() public function testCanEditShippingMethod() { $this->model->setData('can_edit_shipping_method', true); - static::assertTrue($this->model->canEditShippingMethod()); + $this->assertTrue($this->model->canEditShippingMethod()); $this->model->setData('can_edit_shipping_method', false); - static::assertTrue($this->model->canEditShippingMethod()); + $this->assertTrue($this->model->canEditShippingMethod()); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Block/Express/ShortcutTest.php b/app/code/Magento/Paypal/Test/Unit/Block/Express/ShortcutTest.php index fcad11b653d21..6bbe0889cfe68 100644 --- a/app/code/Magento/Paypal/Test/Unit/Block/Express/ShortcutTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Block/Express/ShortcutTest.php @@ -31,11 +31,11 @@ public function testGetAlias() ->disableOriginalConstructor() ->getMock(); - $paypalConfigFactoryMock->expects(self::once()) + $paypalConfigFactoryMock->expects($this->once()) ->method('create') ->willReturn($configMock); - $configMock->expects(self::once()) + $configMock->expects($this->once()) ->method('setMethod') ->with('test-method'); diff --git a/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php b/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php index 32d3f2c73b159..b11f31ca7ede3 100644 --- a/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php @@ -228,7 +228,7 @@ public function testExecuteNotAllowedOrderState($state, $restoreQuote, $expected ->willReturn(Config::METHOD_PAYFLOWLINK); $this->checkoutHelper->method('cancelCurrentOrder') - ->with(self::equalTo($errMessage)); + ->with($this->equalTo($errMessage)); $this->withBlockContent($expectedGotoSection, 'Your payment has been declined. Please try again.'); @@ -269,7 +269,7 @@ public function testCheckRejectByPaymentMethod() $this->withBlockContent(false, 'Requested payment method does not match with order.'); - $this->payment->expects(self::once()) + $this->payment->expects($this->once()) ->method('getMethod') ->willReturn('something_else'); @@ -292,7 +292,7 @@ public function testCheckXSSEscaped($errorMsg, $errorMsgEscaped) ->willReturn($errorMsg); $this->checkoutHelper->method('cancelCurrentOrder') - ->with(self::equalTo($errorMsgEscaped)); + ->with($this->equalTo($errorMsgEscaped)); $this->withBlockContent('paymentMethod', 'Your payment has been declined. Please try again.'); @@ -412,14 +412,14 @@ private function withCheckoutSession($orderId, $restoreQuote) */ private function withBlockContent($gotoSection, $errMsg) { - $this->block->expects(self::at(0)) + $this->block->expects($this->at(0)) ->method('setData') - ->with('goto_section', self::equalTo($gotoSection)) + ->with('goto_section', $this->equalTo($gotoSection)) ->willReturnSelf(); - $this->block->expects(self::at(1)) + $this->block->expects($this->at(1)) ->method('setData') - ->with('error_msg', self::equalTo(__($errMsg))) + ->with('error_msg', $this->equalTo(__($errMsg))) ->willReturnSelf(); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php b/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php index ffa1bf027ab57..0c855c8549565 100644 --- a/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Helper/BackendTest.php @@ -54,7 +54,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $this->request = $this->createMock(\Magento\Framework\App\RequestInterface::class); - $this->context->expects(static::once()) + $this->context->expects($this->once()) ->method('getRequest') ->willReturn($this->request); $this->directoryHelperMock = $this->getMockBuilder(\Magento\Directory\Helper\Data::class) diff --git a/app/code/Magento/Paypal/Test/Unit/Helper/CheckoutTest.php b/app/code/Magento/Paypal/Test/Unit/Helper/CheckoutTest.php index d19c278bd6e79..e6bb4f2485b03 100644 --- a/app/code/Magento/Paypal/Test/Unit/Helper/CheckoutTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Helper/CheckoutTest.php @@ -44,23 +44,23 @@ public function testCancelCurrentOrder() ->disableOriginalConstructor() ->getMock(); - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getLastRealOrder') ->willReturn($order); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getId') ->willReturn($id); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getState') ->willReturn($state); - $order->expects(static::once()) + $order->expects($this->once()) ->method('registerCancellation') ->with($comment) ->willReturnSelf(); - $order->expects(static::once()) + $order->expects($this->once()) ->method('save'); - static::assertTrue($this->checkout->cancelCurrentOrder($comment)); + $this->assertTrue($this->checkout->cancelCurrentOrder($comment)); } public function testCancelCurrentOrderWhichIsCancelled() @@ -73,31 +73,31 @@ public function testCancelCurrentOrderWhichIsCancelled() ->disableOriginalConstructor() ->getMock(); - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getLastRealOrder') ->willReturn($order); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getId') ->willReturn($id); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getState') ->willReturn($state); - $order->expects(static::never()) + $order->expects($this->never()) ->method('registerCancellation') ->with($comment) ->willReturnSelf(); - $order->expects(static::never()) + $order->expects($this->never()) ->method('save'); - static::assertFalse($this->checkout->cancelCurrentOrder($comment)); + $this->assertFalse($this->checkout->cancelCurrentOrder($comment)); } public function testRestoreQuote() { - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('restoreQuote') ->willReturn(true); - static::assertTrue($this->checkout->restoreQuote()); + $this->assertTrue($this->checkout->restoreQuote()); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php b/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php index b9423d27d465f..7ec8daa798854 100644 --- a/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Helper/DataTest.php @@ -89,12 +89,12 @@ protected function setUp() */ public function testGetBillingAgreementMethods($store, $quote, $paymentMethodsMap, $expectedResult) { - $this->paymentMethodList->expects(static::once()) + $this->paymentMethodList->expects($this->once()) ->method('getActiveList') ->with($store) ->willReturn(array_column($paymentMethodsMap, 0)); - $this->paymentMethodInstanceFactory->expects(static::any()) + $this->paymentMethodInstanceFactory->expects($this->any()) ->method('create') ->willReturnMap($paymentMethodsMap); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php index 78bd269403b83..03c3937006a7e 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php @@ -311,7 +311,7 @@ public function testGetBuildNotationCode() $productMetadata ); - self::assertEquals('Magento_Cart_SomeEdition', $this->config->getBuildNotationCode()); + $this->assertEquals('Magento_Cart_SomeEdition', $this->config->getBuildNotationCode()); } /** @@ -322,9 +322,9 @@ public function testBuildNotationCodeFromConfig() $notationCode = 'Magento_Cart_EditionFromConfig'; $this->scopeConfigMock->method('getValue') - ->with(self::equalTo('paypal/notation_code'), self::equalTo('stores')) + ->with($this->equalTo('paypal/notation_code'), $this->equalTo('stores')) ->willReturn($notationCode); - self::assertEquals($notationCode, $this->config->getBuildNotationCode()); + $this->assertEquals($notationCode, $this->config->getBuildNotationCode()); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Adminhtml/ExpressTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Adminhtml/ExpressTest.php index 0b7b9aeb2a7bb..e5fed70060ea0 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Adminhtml/ExpressTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Adminhtml/ExpressTest.php @@ -153,11 +153,11 @@ public function testAuthorizeOrder() $this->paymentInstance->method('getConfigPaymentAction') ->willReturn('order'); - $this->nvp->expects(static::once()) + $this->nvp->expects($this->once()) ->method('callDoAuthorization') ->willReturnSelf(); - $this->payment->expects(static::once()) + $this->payment->expects($this->once()) ->method('addTransaction') ->with(Transaction::TYPE_AUTH) ->willReturn($this->transaction); @@ -196,7 +196,7 @@ public function testIsOrderAuthorizationAllowed( $this->payment->method('getAmountAuthorized') ->willReturn($authorizedAmount); - static::assertEquals($isAuthAllowed, $this->express->isOrderAuthorizationAllowed($this->payment)); + $this->assertEquals($isAuthAllowed, $this->express->isOrderAuthorizationAllowed($this->payment)); } /** diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php index 979bb34a782dc..6acc571720cfb 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Config/StructurePluginTest.php @@ -128,7 +128,7 @@ public function testAroundGetElementByPathPartsNoResult($pathParts, $countryCode return null; }; - $this->backendHelperMock->expects(static::once()) + $this->backendHelperMock->expects($this->once()) ->method('getConfigurationCountryCode') ->willReturn($countryCode); @@ -151,7 +151,7 @@ public function testAroundGetElementByPathParts($pathParts, $countryCode) return $result; }; - $this->backendHelperMock->expects(static::once()) + $this->backendHelperMock->expects($this->once()) ->method('getConfigurationCountryCode') ->willReturn($countryCode); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php index 113aa5766ed3f..ef12fb808380a 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php @@ -132,7 +132,7 @@ public function testIsMethodAvailableForIsMethodActive($methodName, $expected) public function testGetMerchantCountryPaypal() { - $this->scopeConfig->expects(static::once()) + $this->scopeConfig->expects($this->once()) ->method('getValue') ->with( 'paypal/general/merchant_country', @@ -140,15 +140,15 @@ public function testGetMerchantCountryPaypal() null )->willReturn('US'); - $this->directoryHelper->expects(static::never()) + $this->directoryHelper->expects($this->never()) ->method('getDefaultCountry'); - static::assertEquals('US', $this->model->getMerchantCountry()); + $this->assertEquals('US', $this->model->getMerchantCountry()); } public function testGetMerchantCountryGeneral() { - $this->scopeConfig->expects(static::once()) + $this->scopeConfig->expects($this->once()) ->method('getValue') ->with( 'paypal/general/merchant_country', @@ -156,12 +156,12 @@ public function testGetMerchantCountryGeneral() null )->willReturn(null); - $this->directoryHelper->expects(static::once()) + $this->directoryHelper->expects($this->once()) ->method('getDefaultCountry') ->with(null) ->willReturn('US'); - static::assertEquals('US', $this->model->getMerchantCountry()); + $this->assertEquals('US', $this->model->getMerchantCountry()); } /** diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Express/CheckoutTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Express/CheckoutTest.php index cfa3914845ffb..1d1f1e45dea2d 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Express/CheckoutTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Express/CheckoutTest.php @@ -116,10 +116,10 @@ public function testUpdateShippingMethod() $billingAddressMock = $this->getMockBuilder(Quote\Address::class) ->disableOriginalConstructor() ->getMock(); - $shippingAddressMock->expects(static::once()) + $shippingAddressMock->expects($this->once()) ->method('getShippingMethod') ->willReturn('old_method'); - $shippingAddressMock->expects(static::once()) + $shippingAddressMock->expects($this->once()) ->method('setShippingMethod') ->with(self::SHIPPING_METHOD) ->willReturnSelf(); @@ -127,34 +127,34 @@ public function testUpdateShippingMethod() $shippingMock = $this->getMockBuilder(Shipping::class) ->disableOriginalConstructor() ->getMock(); - $shippingMock->expects(static::once()) + $shippingMock->expects($this->once()) ->method('setMethod') ->with(self::SHIPPING_METHOD); $shippingAssignmentMock = $this->getMockBuilder(ShippingAssignment::class) ->disableOriginalConstructor() ->getMock(); - $shippingAssignmentMock->expects(static::once()) + $shippingAssignmentMock->expects($this->once()) ->method('getShipping') ->willReturn($shippingMock); $cartExtensionMock = $this->getMockBuilder(CartExtensionInterface::class) ->setMethods(['getShippingAssignments']) ->getMockForAbstractClass(); - $cartExtensionMock->expects(static::exactly(2)) + $cartExtensionMock->expects($this->exactly(2)) ->method('getShippingAssignments') ->willReturn([$shippingAssignmentMock]); - $this->quoteMock->expects(static::exactly(2)) + $this->quoteMock->expects($this->exactly(2)) ->method('getShippingAddress') ->willReturn($shippingAddressMock); - $this->quoteMock->expects(static::exactly(2)) + $this->quoteMock->expects($this->exactly(2)) ->method('getIsVirtual') ->willReturn(false); - $this->quoteMock->expects(static::any()) + $this->quoteMock->expects($this->any()) ->method('getBillingAddress') ->willReturn($billingAddressMock); - $this->quoteMock->expects(static::once()) + $this->quoteMock->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($cartExtensionMock); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php b/app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php index abedc573558f1..a0b31e9cee3cb 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php @@ -161,7 +161,7 @@ public function testOrder() ->with($transactionData) ->willReturnSelf(); - static::assertEquals($this->model, $this->model->order($paymentModel, 12.3)); + $this->assertEquals($this->model, $this->model->order($paymentModel, 12.3)); } public function testAssignData() @@ -202,7 +202,7 @@ public function testAssignData() $this->parentAssignDataExpectation($data); - $paymentInfo->expects(static::exactly(3)) + $paymentInfo->expects($this->exactly(3)) ->method('setAdditionalInformation') ->withConsecutive( [Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT, $transportValue], @@ -224,7 +224,7 @@ private function parentAssignDataExpectation(DataObject $data) AbstractDataAssignObserver::DATA_CODE => $data ]; - $this->eventManager->expects(static::exactly(2)) + $this->eventManager->expects($this->exactly(2)) ->method('dispatch') ->willReturnMap( [ diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php index ed834ae2b9c01..3d96d6d718b31 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Hostedpro/RequestTest.php @@ -65,20 +65,20 @@ public function testSetOrderAddresses($billing, $shipping, $billingState, $state ->disableOriginalConstructor() ->setMethods(['getPayment', '__wakeup', 'getBillingAddress', 'getShippingAddress']) ->getMock(); - $order->expects(static::any()) + $order->expects($this->any()) ->method('getPayment') ->will($this->returnValue($payment)); - $order->expects(static::any()) + $order->expects($this->any()) ->method('getBillingAddress') ->will($this->returnValue($billing)); - $order->expects(static::any()) + $order->expects($this->any()) ->method('getShippingAddress') ->will($this->returnValue($shipping)); $this->_model->setOrder($order); - static::assertEquals($billingState, $this->_model->getData('billing_state')); - static::assertEquals($state, $this->_model->getData('state')); - static::assertEquals($countryId, $this->_model->getData('billing_country')); - static::assertEquals($countryId, $this->_model->getData('country')); + $this->assertEquals($billingState, $this->_model->getData('billing_state')); + $this->assertEquals($state, $this->_model->getData('state')); + $this->assertEquals($countryId, $this->_model->getData('billing_country')); + $this->assertEquals($countryId, $this->_model->getData('country')); } /** @@ -175,20 +175,20 @@ public function testSetOrder() ->disableOriginalConstructor() ->getMock(); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getIncrementId') ->willReturn($expectation['invoice']); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseCurrencyCode') ->willReturn($expectation['currency_code']); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getCustomerEmail') ->willReturn($expectation['buyer_email']); $this->_model->setOrder($order); - static::assertEquals($expectation, $this->_model->getData()); + $this->assertEquals($expectation, $this->_model->getData()); } /** @@ -210,7 +210,7 @@ public function testSetAmountWithoutTax($total, $subtotal, $tax, $shipping, $dis 'discount' => abs($discount) ]; - static::assertFalse($this->taxData->priceIncludesTax()); + $this->assertFalse($this->taxData->priceIncludesTax()); $payment = $this->getMockBuilder(Payment::class) ->disableOriginalConstructor() @@ -220,32 +220,32 @@ public function testSetAmountWithoutTax($total, $subtotal, $tax, $shipping, $dis ->disableOriginalConstructor() ->getMock(); - $payment->expects(static::once()) + $payment->expects($this->once()) ->method('getBaseAmountAuthorized') ->willReturn($total); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getPayment') ->willReturn($payment); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseDiscountAmount') ->willReturn($discount); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseTaxAmount') ->willReturn($tax); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseShippingAmount') ->willReturn($shipping); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseSubtotal') ->willReturn($subtotal); $this->_model->setAmount($order); - static::assertEquals($expectation, $this->_model->getData()); + $this->assertEquals($expectation, $this->_model->getData()); } /** @@ -267,7 +267,7 @@ public function testSetAmountWithoutTaxZeroSubtotal($total, $subtotal, $tax, $sh 'discount' => abs($discount) ]; - static::assertFalse($this->taxData->priceIncludesTax()); + $this->assertFalse($this->taxData->priceIncludesTax()); $payment = $this->getMockBuilder(Payment::class) ->disableOriginalConstructor() @@ -277,32 +277,32 @@ public function testSetAmountWithoutTaxZeroSubtotal($total, $subtotal, $tax, $sh ->disableOriginalConstructor() ->getMock(); - $payment->expects(static::exactly(2)) + $payment->expects($this->exactly(2)) ->method('getBaseAmountAuthorized') ->willReturn($total); - $order->expects(static::exactly(2)) + $order->expects($this->exactly(2)) ->method('getPayment') ->willReturn($payment); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseDiscountAmount') ->willReturn($discount); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseTaxAmount') ->willReturn($tax); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseShippingAmount') ->willReturn($shipping); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getBaseSubtotal') ->willReturn($subtotal); $this->_model->setAmount($order); - static::assertEquals($expectation, $this->_model->getData()); + $this->assertEquals($expectation, $this->_model->getData()); } /** @@ -329,7 +329,7 @@ public function testSetAmountWithIncludedTax() ] ); - static::assertTrue($this->taxData->getConfig()->priceIncludesTax()); + $this->assertTrue($this->taxData->getConfig()->priceIncludesTax()); $amount = 19.65; @@ -346,17 +346,17 @@ public function testSetAmountWithIncludedTax() ->disableOriginalConstructor() ->getMock(); - $payment->expects(static::once()) + $payment->expects($this->once()) ->method('getBaseAmountAuthorized') ->willReturn($amount); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getPayment') ->willReturn($payment); $this->_model->setAmount($order); - static::assertEquals($expectation, $this->_model->getData()); + $this->assertEquals($expectation, $this->_model->getData()); } /** diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Method/Checks/SpecificationPluginTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Method/Checks/SpecificationPluginTest.php index 1b3cf081685e1..be7f0a2162c9e 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Method/Checks/SpecificationPluginTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Method/Checks/SpecificationPluginTest.php @@ -137,14 +137,14 @@ public function testAfterIsApplicable($count) { $this->setExpectations('paypal_billing_agreement', 1); - $this->billingAgreementFactoryMock->expects(static::once()) + $this->billingAgreementFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->billingAgreementMock); - $this->billingAgreementMock->expects(static::once()) + $this->billingAgreementMock->expects($this->once()) ->method('getAvailableCustomerBillingAgreements') ->with(1) ->willReturn($this->billingAgreementCollectionMock); - $this->billingAgreementCollectionMock->expects(static::once()) + $this->billingAgreementCollectionMock->expects($this->once()) ->method('count') ->willReturn($count); @@ -171,10 +171,10 @@ public function afterIsApplicableDataProvider() */ private function setExpectations($paymentMethodCode, $customerId) { - $this->paymentMethodMock->expects(static::any()) + $this->paymentMethodMock->expects($this->any()) ->method('getCode') ->willReturn($paymentMethodCode); - $this->quoteMock->expects(static::any()) + $this->quoteMock->expects($this->any()) ->method('getCustomerId') ->willReturn($customerId); } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/AvsEmsCodeMapperTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/AvsEmsCodeMapperTest.php index ea86a04206f7b..a9b0b3aaca5e8 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/AvsEmsCodeMapperTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/AvsEmsCodeMapperTest.php @@ -42,18 +42,18 @@ public function testGetCode($avsZip, $avsStreet, $expected) ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getMethod') ->willReturn(Config::METHOD_PAYFLOWPRO); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getAdditionalInformation') ->willReturn([ Info::PAYPAL_AVSZIP => $avsZip, Info::PAYPAL_AVSADDR => $avsStreet ]); - self::assertEquals($expected, $this->mapper->getCode($orderPayment)); + $this->assertEquals($expected, $this->mapper->getCode($orderPayment)); } /** @@ -70,7 +70,7 @@ public function testGetCodeWithException() ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::exactly(2)) + $orderPayment->expects($this->exactly(2)) ->method('getMethod') ->willReturn('some_payment'); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/CvvEmsCodeMapperTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/CvvEmsCodeMapperTest.php index 0b1caaf89d835..95853079a6711 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/CvvEmsCodeMapperTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/CvvEmsCodeMapperTest.php @@ -41,15 +41,15 @@ public function testGetCode($cvvCode, $expected) ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getMethod') ->willReturn(Config::METHOD_PAYFLOWPRO); - $orderPayment->expects(self::once()) + $orderPayment->expects($this->once()) ->method('getAdditionalInformation') ->willReturn([Info::PAYPAL_CVV2MATCH => $cvvCode]); - self::assertEquals($expected, $this->mapper->getCode($orderPayment)); + $this->assertEquals($expected, $this->mapper->getCode($orderPayment)); } /** @@ -66,7 +66,7 @@ public function testGetCodeWithException() ->disableOriginalConstructor() ->getMock(); - $orderPayment->expects(self::exactly(2)) + $orderPayment->expects($this->exactly(2)) ->method('getMethod') ->willReturn('some_payment'); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php index fe14f278fd96c..1c09d851d692b 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/GatewayTest.php @@ -46,7 +46,7 @@ protected function setUp() ->setMethods(['request', 'setUri']) ->disableOriginalConstructor() ->getMock(); - $this->httpClientFactoryMock->expects(static::once()) + $this->httpClientFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->zendClientMock); $this->mathRandomMock = $this->getMockBuilder(Random::class) @@ -79,25 +79,25 @@ public function testPostRequestOk() ->setMethods(['getBody']) ->disableOriginalConstructor() ->getMock(); - $zendResponseMock->expects(static::once()) + $zendResponseMock->expects($this->once()) ->method('getBody') ->willReturn($expectedResponse); - $this->zendClientMock->expects(static::once()) + $this->zendClientMock->expects($this->once()) ->method('request') ->willReturn($zendResponseMock); - $configInterfaceMock->expects(static::any()) + $configInterfaceMock->expects($this->any()) ->method('getValue') ->willReturnMap($configMap); - $this->loggerMock->expects(static::once()) + $this->loggerMock->expects($this->once()) ->method('debug'); $object = new DataObject(); $result = $this->object->postRequest($object, $configInterfaceMock); - static::assertInstanceOf(DataObject::class, $result); - static::assertArrayHasKey('result_code', $result->getData()); + $this->assertInstanceOf(DataObject::class, $result); + $this->assertArrayHasKey('result_code', $result->getData()); } /** @@ -112,9 +112,9 @@ public function testPostRequestFail() ->setMethods(['getBody']) ->disableOriginalConstructor() ->getMock(); - $zendResponseMock->expects(static::never()) + $zendResponseMock->expects($this->never()) ->method('getBody'); - $this->zendClientMock->expects(static::once()) + $this->zendClientMock->expects($this->once()) ->method('request') ->willThrowException(new \Zend_Http_Client_Exception()); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/AVSResponseTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/AVSResponseTest.php index e4c32c40f30fd..cd39543e4d8b5 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/AVSResponseTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/AVSResponseTest.php @@ -60,10 +60,10 @@ public function testValidation( $this->config->method('getValue') ->willReturnMap($configMap); - static::assertEquals($expectedResult, $this->validator->validate($response, $this->payflowproFacade)); + $this->assertEquals($expectedResult, $this->validator->validate($response, $this->payflowproFacade)); if (!$expectedResult) { - static::assertNotEmpty($response->getRespmsg()); + $this->assertNotEmpty($response->getRespmsg()); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/CVV2MatchTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/CVV2MatchTest.php index 8df9659b59a3d..9a0015cc21c19 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/CVV2MatchTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/CVV2MatchTest.php @@ -60,7 +60,7 @@ public function testValidation( \Magento\Framework\DataObject $response, $avsSecurityCodeFlag ) { - $this->payflowproFacade->expects(static::once()) + $this->payflowproFacade->expects($this->once()) ->method('getConfig') ->willReturn($this->configMock); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/IAVSResponseTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/IAVSResponseTest.php index 8b33a8afd6f76..f99cbe6ebcbe0 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/IAVSResponseTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/IAVSResponseTest.php @@ -44,7 +44,7 @@ public function testValidate($configValue, $iavs, $expected) ->willReturn($configValue); $validator = new IAVSResponse(); - self::assertEquals($expected, $validator->validate($response, $model)); + $this->assertEquals($expected, $validator->validate($response, $model)); } /** diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php index e6a994cba78c3..fb94a40550275 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php @@ -170,10 +170,10 @@ protected function buildRequestData() $this->orderMock->expects($this->once()) ->method('getBillingAddress') ->willReturn($this->addressBillingMock); - $this->orderMock->expects(static::once()) + $this->orderMock->expects($this->once()) ->method('getId') ->willReturn(1); - $this->orderMock->expects(static::once()) + $this->orderMock->expects($this->once()) ->method('getIncrementId') ->willReturn('0000001'); $this->orderMock->expects($this->once()) @@ -399,7 +399,7 @@ public function testAuthorize() $this->paymentMock->expects($this->once()) ->method('getCcExpMonth') ->willReturn('12'); - $this->paymentMock->expects(static::any()) + $this->paymentMock->expects($this->any()) ->method('getAdditionalInformation') ->willReturnMap( [ @@ -408,23 +408,23 @@ public function testAuthorize() ] ); - $this->paymentTokenFactory->expects(static::once()) + $this->paymentTokenFactory->expects($this->once()) ->method('create') ->willReturn($paymentTokenMock); - $paymentTokenMock->expects(static::once()) + $paymentTokenMock->expects($this->once()) ->method('setGatewayToken') ->with('test-pnref'); - $paymentTokenMock->expects(static::once()) + $paymentTokenMock->expects($this->once()) ->method('setTokenDetails') ->with(json_encode($ccDetails)); - $paymentTokenMock->expects(static::once()) + $paymentTokenMock->expects($this->once()) ->method('setExpiresAt') ->with('2018-01-01 00:00:00'); - $this->paymentMock->expects(static::once()) + $this->paymentMock->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $extensionAttributes->expects(static::once()) + $extensionAttributes->expects($this->once()) ->method('setVaultPaymentToken') ->with($paymentTokenMock); @@ -443,6 +443,6 @@ public function testAuthorize() */ public function testGetInfoBlockType() { - static::assertEquals(Info::class, $this->object->getInfoBlockType()); + $this->assertEquals(Info::class, $this->object->getInfoBlockType()); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/PayflowadvancedTest.php b/app/code/Magento/Paypal/Test/Unit/Model/PayflowadvancedTest.php index 1eba154e7a9bf..5746361cbeade 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/PayflowadvancedTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/PayflowadvancedTest.php @@ -26,6 +26,6 @@ protected function setUp() */ public function testGetInfoBlockType() { - static::assertEquals(Info::class, $this->model->getInfoBlockType()); + $this->assertEquals(Info::class, $this->model->getInfoBlockType()); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/PayflowlinkTest.php b/app/code/Magento/Paypal/Test/Unit/Model/PayflowlinkTest.php index 80c8194e07654..ec4bf9551d634 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/PayflowlinkTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/PayflowlinkTest.php @@ -152,7 +152,7 @@ public function testInitialize() $stateObject = new \Magento\Framework\DataObject(); $this->model->initialize(\Magento\Paypal\Model\Config::PAYMENT_ACTION_AUTH, $stateObject); - self::assertEquals($storeId, $this->model->getStore(), '{Store} should be set'); + $this->assertEquals($storeId, $this->model->getStore(), '{Store} should be set'); } /** @@ -190,6 +190,6 @@ public function dataProviderForTestIsActive() */ public function testGetInfoBlockType() { - static::assertEquals(Info::class, $this->model->getInfoBlockType()); + $this->assertEquals(Info::class, $this->model->getInfoBlockType()); } } diff --git a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php index 3e8af6b2ee766..bd4b6bbd7569e 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/PayflowproTest.php @@ -251,23 +251,23 @@ public function testCaptureWithBuildPlaceRequest() $orderMock = $this->getOrderMock(); // test case to build basic request - $paymentMock->expects(static::once()) + $paymentMock->expects($this->once()) ->method('getAdditionalInformation') ->with('pnref') ->willReturn(false); - $paymentMock->expects(static::once()) + $paymentMock->expects($this->once()) ->method('getParentTransactionId') ->willReturn(false); - $paymentMock->expects(static::exactly(2)) + $paymentMock->expects($this->exactly(2)) ->method('getOrder') ->willReturn($orderMock); $response = $this->execGatewayRequest(); $amount = 23.03; $this->payflowpro->capture($paymentMock, $amount); - static::assertEquals($response['pnref'], $paymentMock->getTransactionId()); - static::assertFalse((bool)$paymentMock->getIsTransactionPending()); + $this->assertEquals($response['pnref'], $paymentMock->getTransactionId()); + $this->assertFalse((bool)$paymentMock->getIsTransactionPending()); } /** @@ -369,15 +369,15 @@ public function testAuthorize() $paymentMock = $this->getPaymentMock(); $orderMock = $this->getOrderMock(); - $paymentMock->expects(static::exactly(2)) + $paymentMock->expects($this->exactly(2)) ->method('getOrder') ->willReturn($orderMock); $response = $this->execGatewayRequest(); $amount = 43.20; $this->payflowpro->authorize($paymentMock, $amount); - static::assertEquals($response['pnref'], $paymentMock->getTransactionId()); - static::assertFalse((bool)$paymentMock->getIsTransactionPending()); + $this->assertEquals($response['pnref'], $paymentMock->getTransactionId()); + $this->assertFalse((bool)$paymentMock->getIsTransactionPending()); } /** @@ -421,8 +421,8 @@ public function testRefund() $amount = 213.04; $this->payflowpro->refund($paymentMock, $amount); - static::assertEquals($response['pnref'], $paymentMock->getTransactionId()); - static::assertTrue($paymentMock->getIsTransactionClosed()); + $this->assertEquals($response['pnref'], $paymentMock->getTransactionId()); + $this->assertTrue($paymentMock->getIsTransactionClosed()); } /** @@ -436,10 +436,10 @@ protected function initStoreMock() ->disableOriginalConstructor() ->setMethods(['getId']) ->getMock(); - $this->storeManagerMock->expects(static::once()) + $this->storeManagerMock->expects($this->once()) ->method('getStore') ->willReturn($storeMock); - $storeMock->expects(static::once()) + $storeMock->expects($this->once()) ->method('getId') ->willReturn($storeId); } @@ -471,7 +471,7 @@ protected function execGatewayRequest() { $this->initStoreMock(); $response = $this->getGatewayResponseObject(); - $this->gatewayMock->expects(static::once()) + $this->gatewayMock->expects($this->once()) ->method('postRequest') ->with( $this->isInstanceOf(\Magento\Framework\DataObject::class), @@ -501,16 +501,16 @@ protected function getPaymentMock() 'year' => 18, 'cvv' => 123 ]; - $paymentMock->expects(static::any()) + $paymentMock->expects($this->any()) ->method('getCcNumber') ->willReturn($cardData['number']); - $paymentMock->expects(static::any()) + $paymentMock->expects($this->any()) ->method('getCcExpMonth') ->willReturn($cardData['month']); - $paymentMock->expects(static::any()) + $paymentMock->expects($this->any()) ->method('getCcExpYear') ->willReturn($cardData['year']); - $paymentMock->expects(static::any()) + $paymentMock->expects($this->any()) ->method('getCcCid') ->willReturn($cardData['cvv']); return $paymentMock; @@ -532,13 +532,13 @@ protected function getOrderMock() ->setMethods(['getBaseCurrencyCode', 'getIncrementId', 'getId', 'getBillingAddress', 'getShippingAddress']) ->getMock(); - $orderMock->expects(static::once()) + $orderMock->expects($this->once()) ->method('getId') ->willReturn($orderData['id']); - $orderMock->expects(static::once()) + $orderMock->expects($this->once()) ->method('getBaseCurrencyCode') ->willReturn($orderData['currency']); - $orderMock->expects(static::atLeastOnce()) + $orderMock->expects($this->atLeastOnce()) ->method('getIncrementId') ->willReturn($orderData['increment_id']); return $orderMock; @@ -553,12 +553,12 @@ public function testPostRequest() /** @var ConfigInterface $config */ $config = $this->createMock(ConfigInterface::class); - $this->gatewayMock->expects(static::once()) + $this->gatewayMock->expects($this->once()) ->method('postRequest') ->with($request, $config) ->willReturn($expectedResult); - static::assertSame($expectedResult, $this->payflowpro->postRequest($request, $config)); + $this->assertSame($expectedResult, $this->payflowpro->postRequest($request, $config)); } /** @@ -572,7 +572,7 @@ public function testPostRequestException() /** @var ConfigInterface $config */ $config = $this->createMock(ConfigInterface::class); - $this->gatewayMock->expects(static::once()) + $this->gatewayMock->expects($this->once()) ->method('postRequest') ->with($request, $config) ->willThrowException(new \Zend_Http_Client_Exception()); @@ -596,7 +596,7 @@ public function testAssignData() $infoInstance = $this->getMockForAbstractClass(InfoInterface::class); $this->payflowpro->setData('info_instance', $infoInstance); - $this->eventManager->expects(static::exactly(2)) + $this->eventManager->expects($this->exactly(2)) ->method('dispatch'); $this->payflowpro->assignData($dataObject); @@ -611,7 +611,7 @@ public function testAssignData() */ public function testMapGatewayResponse($postData, $expectedResponse) { - self::assertEquals( + $this->assertEquals( $this->payflowpro->mapGatewayResponse($postData, new DataObject()), $expectedResponse ); diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementTest.php index 4b14c2c4d7ef8..8382369bea587 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payment/Method/Billing/AbstractAgreementTest.php @@ -87,32 +87,32 @@ public function testAssignData() ->setMethods(['__wakeup', 'load', 'getCustomerId', 'getId', 'getReferenceId']) ->getMock(); - $this->agreementFactory->expects(static::once()) + $this->agreementFactory->expects($this->once()) ->method('create') ->willReturn($agreementModel); - $paymentInfo->expects(static::once()) + $paymentInfo->expects($this->once()) ->method('getQuote') ->willReturn($quote); - $agreementModel->expects(static::once()) + $agreementModel->expects($this->once()) ->method('load') ->with($baId); - $agreementModel->expects(static::once()) + $agreementModel->expects($this->once()) ->method('getId') ->willReturn($baId); - $agreementModel->expects(static::atLeastOnce()) + $agreementModel->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); - $agreementModel->expects(static::atLeastOnce()) + $agreementModel->expects($this->atLeastOnce()) ->method('getReferenceId') ->willReturn($referenceId); - $quote->expects(static::once()) + $quote->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $paymentInfo->expects(static::exactly(2)) + $paymentInfo->expects($this->exactly(2)) ->method('setAdditionalInformation') ->willReturnMap( [ @@ -136,7 +136,7 @@ private function parentAssignDataExpectation(DataObject $data) AbstractDataAssignObserver::DATA_CODE => $data ]; - $this->eventManagerMock->expects(static::exactly(2)) + $this->eventManagerMock->expects($this->exactly(2)) ->method('dispatch') ->willReturnMap( [ diff --git a/app/code/Magento/Paypal/Test/Unit/Model/ProTest.php b/app/code/Magento/Paypal/Test/Unit/Model/ProTest.php index c8998f0c24129..bd857bb6ddcbc 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/ProTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/ProTest.php @@ -105,27 +105,27 @@ public function testCapture() $paymentMock = $this->getPaymentMock(); $orderMock = $this->getOrderMock(); - $this->apiMock->expects(static::any()) + $this->apiMock->expects($this->any()) ->method('setAuthorizationId') ->willReturnSelf(); - $this->apiMock->expects(static::any()) + $this->apiMock->expects($this->any()) ->method('setIsCaptureComplete') ->willReturnSelf(); - $this->apiMock->expects(static::any()) + $this->apiMock->expects($this->any()) ->method('setAmount') ->willReturnSelf(); - $paymentMock->expects(static::once()) + $paymentMock->expects($this->once()) ->method('getOrder') ->willReturn($orderMock); $paymentMock->method('isCaptureFinal') ->willReturn(true); - $this->apiMock->expects(static::once()) + $this->apiMock->expects($this->once()) ->method('getTransactionId') ->willReturn(45); - $this->apiMock->expects(static::any()) + $this->apiMock->expects($this->any()) ->method('getDataUsingMethod') ->willReturn(false); @@ -147,7 +147,7 @@ protected function getInfoFactory() ->disableOriginalConstructor() ->setMethods(['isPaymentReviewRequired']) ->getMock(); - $infoFactory->expects(static::any())->method('create')->willReturn($infoMock); + $infoFactory->expects($this->any())->method('create')->willReturn($infoMock); return $infoFactory; } @@ -167,7 +167,7 @@ protected function getConfigFactory($storeId) ->setMethods(['create']) ->getMock(); - $configFactory->expects(static::any()) + $configFactory->expects($this->any()) ->method('create') ->with($configType, ['params' => [ PaypalConfig::METHOD_PAYMENT_PRO, @@ -193,9 +193,9 @@ protected function getApiFactory(ObjectManager $objectHelper) ->disableOriginalConstructor() ->getMock(); - $httpClient->expects(static::any()) + $httpClient->expects($this->any()) ->method('read') - ->will(static::returnValue( + ->will($this->returnValue( "\r\n" . 'ACK=Success&CORRELATIONID=32342431' )); @@ -203,7 +203,7 @@ protected function getApiFactory(ObjectManager $objectHelper) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $curlFactory->expects(static::any())->method('create')->willReturn($httpClient); + $curlFactory->expects($this->any())->method('create')->willReturn($httpClient); $apiType = \Magento\Paypal\Model\Api\Nvp::class; $args = $objectHelper->getConstructArguments( @@ -226,7 +226,7 @@ protected function getApiFactory(ObjectManager $objectHelper) ) ->getMock(); - $apiFactory->expects(static::any())->method('create')->with($apiType)->willReturn($this->apiMock); + $apiFactory->expects($this->any())->method('create')->with($apiType)->willReturn($this->apiMock); return $apiFactory; } @@ -243,7 +243,7 @@ protected function getPaymentMock() ]) ->getMock(); $parentTransactionId = 43; - $paymentMock->expects(static::once()) + $paymentMock->expects($this->once()) ->method('getParentTransactionId') ->willReturn($parentTransactionId); @@ -266,13 +266,13 @@ protected function getOrderMock() ->setMethods(['getBaseCurrencyCode', 'getIncrementId', 'getId', 'getBillingAddress', 'getShippingAddress']) ->getMock(); - $orderMock->expects(static::once()) + $orderMock->expects($this->once()) ->method('getId') ->willReturn($orderData['id']); - $orderMock->expects(static::once()) + $orderMock->expects($this->once()) ->method('getBaseCurrencyCode') ->willReturn($orderData['currency']); - $orderMock->expects(static::atLeastOnce()) + $orderMock->expects($this->atLeastOnce()) ->method('getIncrementId') ->willReturn($orderData['increment_id']); return $orderMock; diff --git a/app/code/Magento/Paypal/Test/Unit/Observer/AddPaypalShortcutsObserverTest.php b/app/code/Magento/Paypal/Test/Unit/Observer/AddPaypalShortcutsObserverTest.php index 7cb521073e309..4dd3125d56003 100644 --- a/app/code/Magento/Paypal/Test/Unit/Observer/AddPaypalShortcutsObserverTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Observer/AddPaypalShortcutsObserverTest.php @@ -57,7 +57,7 @@ public function testAddShortcutsButtons(array $blocks) )->disableOriginalConstructor() ->getMock(); - $eventMock->expects(self::once()) + $eventMock->expects($this->once()) ->method('getContainer') ->willReturn($shortcutButtonsMock); @@ -93,7 +93,7 @@ public function testAddShortcutsButtons(array $blocks) foreach ($blocks as $instanceName => $blockData) { $params = []; - $paypalConfigMock->expects(self::at($callIndexAvailable)) + $paypalConfigMock->expects($this->at($callIndexAvailable)) ->method('isMethodAvailable') ->with($blockData[self::PAYMENT_CODE]) ->willReturn($blockData[self::PAYMENT_AVAILABLE]); @@ -107,7 +107,7 @@ public function testAddShortcutsButtons(array $blocks) ++$callIndexSession; $params['shortcutValidator'] = 'test-shortcut-validator'; - $shortcutFactoryMock->expects(self::at($callIndexShortcutFactory)) + $shortcutFactoryMock->expects($this->at($callIndexShortcutFactory)) ->method('create') ->with('test-checkout-session') ->willReturn('test-shortcut-validator'); @@ -124,27 +124,27 @@ public function testAddShortcutsButtons(array $blocks) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $blockMock->expects(self::once()) + $blockMock->expects($this->once()) ->method('setIsInCatalogProduct') ->willReturnSelf(); - $blockMock->expects(self::once()) + $blockMock->expects($this->once()) ->method('setShowOrPosition') ->willReturnSelf(); - $layoutMock->expects(self::at($callIndexBlock)) + $layoutMock->expects($this->at($callIndexBlock)) ->method('createBlock') ->with($instanceName, '', $params) ->willReturn($blockMock); ++$callIndexBlock; } - $shortcutButtonsMock->expects(self::exactly($callIndexBlock)) + $shortcutButtonsMock->expects($this->exactly($callIndexBlock)) ->method('addShortcut') - ->with(self::isInstanceOf(ShortcutInterface::class)); - $shortcutButtonsMock->expects(self::exactly($callIndexBlock)) + ->with($this->isInstanceOf(ShortcutInterface::class)); + $shortcutButtonsMock->expects($this->exactly($callIndexBlock)) ->method('getLayout') ->willReturn($layoutMock); - $eventMock->expects(self::exactly($callIndexSession)) + $eventMock->expects($this->exactly($callIndexSession)) ->method('getCheckoutSession') ->willReturn('test-checkout-session'); diff --git a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestShippingMethodManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestShippingMethodManagementTest.php index fe4ffcab4bc4d..d9db792679aa2 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestShippingMethodManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/GuestCart/GuestShippingMethodManagementTest.php @@ -126,12 +126,12 @@ public function testEstimateByExtendedAddress() $methodObject = $this->getMockForAbstractClass(ShippingMethodInterface::class); $expectedRates = [$methodObject]; - $this->shipmentEstimationManagement->expects(static::once()) + $this->shipmentEstimationManagement->expects($this->once()) ->method('estimateByExtendedAddress') ->with($this->cartId, $address) ->willReturn($expectedRates); $carriersRates = $this->model->estimateByExtendedAddress($this->maskedCartId, $address); - static::assertEquals($expectedRates, $carriersRates); + $this->assertEquals($expectedRates, $carriersRates); } } diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/AddressTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/AddressTest.php index 242f81b222507..30ded81951069 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/AddressTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/AddressTest.php @@ -311,8 +311,8 @@ public function testValidateMinimumAmountNegative() public function testSetAndGetAppliedTaxes() { $data = ['data']; - self::assertInstanceOf(Address::class, $this->address->setAppliedTaxes($data)); - self::assertEquals($data, $this->address->getAppliedTaxes()); + $this->assertInstanceOf(Address::class, $this->address->setAppliedTaxes($data)); + $this->assertEquals($data, $this->address->getAppliedTaxes()); } /** @@ -321,7 +321,7 @@ public function testSetAndGetAppliedTaxes() public function testGetAppliedTaxesWithEmptyValue() { $this->address->setData('applied_taxes', null); - self::assertEquals([], $this->address->getAppliedTaxes()); + $this->assertEquals([], $this->address->getAppliedTaxes()); } /** diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php index ef529f643d6d4..c70f54aef6555 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/ItemTest.php @@ -1212,24 +1212,24 @@ public function testRemoveErrorInfosByParamsAllErrorsRemoved() public function testSaveItemOptions() { $optionMockDeleted = $this->createOptionMock(100); - $optionMockDeleted->expects(self::once())->method('isDeleted')->willReturn(true); - $optionMockDeleted->expects(self::once())->method('delete'); + $optionMockDeleted->expects($this->once())->method('isDeleted')->willReturn(true); + $optionMockDeleted->expects($this->once())->method('delete'); $optionMock1 = $this->createOptionMock(200); - $optionMock1->expects(self::once())->method('isDeleted')->willReturn(false); + $optionMock1->expects($this->once())->method('isDeleted')->willReturn(false); $quoteItemMock1 = $this->createPartialMock(\Magento\Quote\Model\Quote\Item::class, ['getId']); - $quoteItemMock1->expects(self::once())->method('getId')->willReturn(null); - $optionMock1->expects(self::exactly(2))->method('getItem')->willReturn($quoteItemMock1); - $optionMock1->expects(self::exactly(2))->method('setItem')->with($this->model); - $optionMock1->expects(self::once())->method('save'); + $quoteItemMock1->expects($this->once())->method('getId')->willReturn(null); + $optionMock1->expects($this->exactly(2))->method('getItem')->willReturn($quoteItemMock1); + $optionMock1->expects($this->exactly(2))->method('setItem')->with($this->model); + $optionMock1->expects($this->once())->method('save'); $optionMock2 = $this->createOptionMock(300); - $optionMock2->expects(self::once())->method('isDeleted')->willReturn(false); + $optionMock2->expects($this->once())->method('isDeleted')->willReturn(false); $quoteItemMock2 = $this->createPartialMock(\Magento\Quote\Model\Quote\Item::class, ['getId']); - $quoteItemMock2->expects(self::once())->method('getId')->willReturn(11); - $optionMock2->expects(self::exactly(2))->method('getItem')->willReturn($quoteItemMock2); - $optionMock2->expects(self::once())->method('setItem')->with($this->model); - $optionMock2->expects(self::once())->method('save'); + $quoteItemMock2->expects($this->once())->method('getId')->willReturn(11); + $optionMock2->expects($this->exactly(2))->method('getItem')->willReturn($quoteItemMock2); + $optionMock2->expects($this->once())->method('setItem')->with($this->model); + $optionMock2->expects($this->once())->method('save'); $this->model->setOptions([$optionMockDeleted, $optionMock1, $optionMock2]); $this->model->saveItemOptions(); diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/PaymentTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/PaymentTest.php index b79c23ff992b6..983127f405183 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/PaymentTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/PaymentTest.php @@ -81,7 +81,7 @@ function ($value) { public function testGetCcExpYearReturnsValidValue($databaseValue, $expectedValue) { $this->model->setData('cc_exp_year', $databaseValue); - static::assertEquals($expectedValue, $this->model->getCcExpYear()); + $this->assertEquals($expectedValue, $this->model->getCcExpYear()); } /** @@ -121,13 +121,13 @@ public function testImportDataPositiveCheck( ->disableOriginalConstructor() ->getMock(); - $quote->expects(static::once()) + $quote->expects($this->once()) ->method('getId') ->willReturn($quoteId); $this->model->setQuote($quote); $this->model->setMethodInstance($paymentMethod); - $this->eventManager->expects(static::once()) + $this->eventManager->expects($this->once()) ->method('dispatch') ->with( 'sales_quote_payment_import_data_before', @@ -136,31 +136,31 @@ public function testImportDataPositiveCheck( 'input' => new DataObject($convertedData) ] ); - $quote->expects(static::once()) + $quote->expects($this->once()) ->method('getStoreId') ->willReturn($storeId); - $quote->expects(static::once()) + $quote->expects($this->once()) ->method('collectTotals'); - $this->specificationFactory->expects(static::once()) + $this->specificationFactory->expects($this->once()) ->method('create') ->with($checks) ->willReturn($methodSpecification); - $paymentMethod->expects(static::once()) + $paymentMethod->expects($this->once()) ->method('isAvailable') ->with($quote) ->willReturn(true); - $methodSpecification->expects(static::once()) + $methodSpecification->expects($this->once()) ->method('isApplicable') ->with($paymentMethod, $quote) ->willReturn(true); - $paymentMethod->expects(static::once()) + $paymentMethod->expects($this->once()) ->method('assignData') ->with(new DataObject($dataToAssign)); - $paymentMethod->expects(static::once()) + $paymentMethod->expects($this->once()) ->method('validate'); $this->model->importData($data); diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingAssignmentProcessorTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingAssignmentProcessorTest.php index 70f5adc70203f..ea82cafabb2c5 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingAssignmentProcessorTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingAssignmentProcessorTest.php @@ -94,13 +94,13 @@ protected function setUp() $this->shippingMock = $this->getMockBuilder(ShippingInterface::class) ->getMockForAbstractClass(); - $this->quoteMock->expects(static::any()) + $this->quoteMock->expects($this->any()) ->method('getShippingAddress') ->willReturn($this->shippingAddressMock); - $this->shippingAssignmentMock->expects(static::any()) + $this->shippingAssignmentMock->expects($this->any()) ->method('getShipping') ->willReturn($this->shippingMock); - $this->shippingMock->expects(static::any()) + $this->shippingMock->expects($this->any()) ->method('getAddress') ->willReturn($this->shippingAddressMock); @@ -120,21 +120,21 @@ public function testSaveWithDeletedCartItems() { $quoteItemId = 1; - $this->shippingAssignmentMock->expects(static::once()) + $this->shippingAssignmentMock->expects($this->once()) ->method('getItems') ->willReturn([$this->createQuoteItemMock($quoteItemId, true)]); - $this->quoteMock->expects(static::atLeastOnce()) + $this->quoteMock->expects($this->atLeastOnce()) ->method('getItemById') ->with($quoteItemId) ->willReturn(null); - $this->cartItemPersisterMock->expects(static::never()) + $this->cartItemPersisterMock->expects($this->never()) ->method('save'); - $this->shippingAddressMock->expects(static::atLeastOnce()) + $this->shippingAddressMock->expects($this->atLeastOnce()) ->method('getCustomerAddressId') ->willReturn(null); - $this->addressRepositoryMock->expects(static::never()) + $this->addressRepositoryMock->expects($this->never()) ->method('getById'); - $this->shippingProcessorMock->expects(static::once()) + $this->shippingProcessorMock->expects($this->once()) ->method('save') ->with($this->shippingMock, $this->quoteMock); @@ -145,21 +145,21 @@ public function testSaveWithNotExistingCustomerAddress() { $customerAddressId = 11; - $this->shippingAssignmentMock->expects(static::atLeastOnce()) + $this->shippingAssignmentMock->expects($this->atLeastOnce()) ->method('getItems') ->willReturn([]); - $this->shippingAddressMock->expects(static::atLeastOnce()) + $this->shippingAddressMock->expects($this->atLeastOnce()) ->method('getCustomerAddressId') ->willReturn($customerAddressId); - $this->addressRepositoryMock->expects(static::once()) + $this->addressRepositoryMock->expects($this->once()) ->method('getById') ->with($customerAddressId) ->willThrowException(new NoSuchEntityException()); - $this->shippingAddressMock->expects(static::once()) + $this->shippingAddressMock->expects($this->once()) ->method('setCustomerAddressId') ->with(null) ->willReturn($this->shippingAddressMock); - $this->shippingProcessorMock->expects(static::once()) + $this->shippingProcessorMock->expects($this->once()) ->method('save') ->with($this->shippingMock, $this->quoteMock); @@ -179,10 +179,10 @@ private function createQuoteItemMock($id, $isDeleted) ->disableOriginalConstructor() ->getMock(); - $quoteItemMock->expects(static::any()) + $quoteItemMock->expects($this->any()) ->method('getItemId') ->willReturn($id); - $quoteItemMock->expects(static::any()) + $quoteItemMock->expects($this->any()) ->method('isDeleted') ->willReturn($isDeleted); diff --git a/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingProcessorTest.php b/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingProcessorTest.php index cff98e11fd4aa..a3feeb939345e 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingProcessorTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingProcessorTest.php @@ -68,27 +68,27 @@ public function testSave($method, $carrierCode, $methodCode) $address = $this->getMockForAbstractClass(AddressInterface::class); - $quote->expects(static::exactly(2)) + $quote->expects($this->exactly(2)) ->method('getId') ->willReturn($quoteId); - $shipping->expects(static::once()) + $shipping->expects($this->once()) ->method('getAddress') ->willReturn($address); - $this->shippingAddressManagement->expects(static::once()) + $this->shippingAddressManagement->expects($this->once()) ->method('assign') ->with($quoteId, $address); - $shipping->expects(static::exactly(2)) + $shipping->expects($this->exactly(2)) ->method('getMethod') ->willReturn($method); - $quote->expects(static::once()) + $quote->expects($this->once()) ->method('getItemsCount') ->willReturn(1); - $this->shippingMethodManagement->expects(static::once()) + $this->shippingMethodManagement->expects($this->once()) ->method('apply') ->with($quoteId, $carrierCode, $methodCode); diff --git a/app/code/Magento/Quote/Test/Unit/Model/QuoteRepository/SaveHandlerTest.php b/app/code/Magento/Quote/Test/Unit/Model/QuoteRepository/SaveHandlerTest.php index f6e5e0e84c49a..37a5cc3bd539a 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/QuoteRepository/SaveHandlerTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/QuoteRepository/SaveHandlerTest.php @@ -103,10 +103,10 @@ protected function setUp() ->setMethods(['getShippingAssignments']) ->getMockForAbstractClass(); - $this->quoteMock->expects(static::any()) + $this->quoteMock->expects($this->any()) ->method('getBillingAddress') ->willReturn($this->billingAddressMock); - $this->quoteMock->expects(static::any()) + $this->quoteMock->expects($this->any()) ->method('getExtensionAttributes') ->willReturn($this->extensionAttributesMock); @@ -127,34 +127,34 @@ public function testSaveForVirtualQuote() { $quoteItemMock = $this->createQuoteItemMock(false); - $this->quoteMock->expects(static::atLeastOnce()) + $this->quoteMock->expects($this->atLeastOnce()) ->method('getItems') ->willReturn([$quoteItemMock]); - $this->cartItemPersisterMock->expects(static::once()) + $this->cartItemPersisterMock->expects($this->once()) ->method('save') ->with($this->quoteMock, $quoteItemMock) ->willReturn($quoteItemMock); - $this->quoteMock->expects(static::once()) + $this->quoteMock->expects($this->once()) ->method('setLastAddedItem') ->with($quoteItemMock) ->willReturnSelf(); - $this->billingAddressMock->expects(static::atLeastOnce()) + $this->billingAddressMock->expects($this->atLeastOnce()) ->method('getCustomerAddressId') ->willReturn(null); - $this->billingAddressMock->expects(static::never()) + $this->billingAddressMock->expects($this->never()) ->method('getCustomerAddress'); - $this->billingAddressPersisterMock->expects(static::once()) + $this->billingAddressPersisterMock->expects($this->once()) ->method('save') ->with($this->quoteMock, $this->billingAddressMock); - $this->quoteMock->expects(static::atLeastOnce()) + $this->quoteMock->expects($this->atLeastOnce()) ->method('isVirtual') ->willReturn(true); - $this->extensionAttributesMock->expects(static::never()) + $this->extensionAttributesMock->expects($this->never()) ->method('getShippingAssignments'); - $this->quoteMock->expects(static::atLeastOnce()) + $this->quoteMock->expects($this->atLeastOnce()) ->method('collectTotals') ->willReturnSelf(); - $this->quoteResourceModelMock->expects(static::once()) + $this->quoteResourceModelMock->expects($this->once()) ->method('save') ->with($this->quoteMock) ->willReturnSelf(); @@ -166,33 +166,33 @@ public function testSaveWithNotExistingCustomerAddress() { $customerAddressId = 5; - $this->quoteMock->expects(static::atLeastOnce()) + $this->quoteMock->expects($this->atLeastOnce()) ->method('getItems') ->willReturn([]); - $this->quoteMock->expects(static::never()) + $this->quoteMock->expects($this->never()) ->method('setLastAddedItem'); - $this->billingAddressMock->expects(static::atLeastOnce()) + $this->billingAddressMock->expects($this->atLeastOnce()) ->method('getCustomerAddressId') ->willReturn($customerAddressId); - $this->addressRepositoryMock->expects(static::once()) + $this->addressRepositoryMock->expects($this->once()) ->method('getById') ->with($customerAddressId) ->willThrowException(new NoSuchEntityException()); - $this->billingAddressMock->expects(static::once()) + $this->billingAddressMock->expects($this->once()) ->method('setCustomerAddressId') ->willReturn(null); - $this->billingAddressPersisterMock->expects(static::once()) + $this->billingAddressPersisterMock->expects($this->once()) ->method('save') ->with($this->quoteMock, $this->billingAddressMock); - $this->quoteMock->expects(static::atLeastOnce()) + $this->quoteMock->expects($this->atLeastOnce()) ->method('isVirtual') ->willReturn(true); - $this->extensionAttributesMock->expects(static::never()) + $this->extensionAttributesMock->expects($this->never()) ->method('getShippingAssignments'); - $this->quoteMock->expects(static::atLeastOnce()) + $this->quoteMock->expects($this->atLeastOnce()) ->method('collectTotals') ->willReturnSelf(); - $this->quoteResourceModelMock->expects(static::once()) + $this->quoteResourceModelMock->expects($this->once()) ->method('save') ->with($this->quoteMock) ->willReturnSelf(); @@ -212,7 +212,7 @@ private function createQuoteItemMock($isDeleted) ->disableOriginalConstructor() ->getMock(); - $quoteItemMock->expects(static::any()) + $quoteItemMock->expects($this->any()) ->method('isDeleted') ->willReturn($isDeleted); diff --git a/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php b/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php index 3101c7d0677a9..2885bb61927e7 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/QuoteRepositoryTest.php @@ -178,32 +178,32 @@ public function testGet() { $cartId = 15; - $this->quoteFactoryMock->expects(static::once()) + $this->quoteFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->quoteMock); - $this->storeManagerMock->expects(static::once()) + $this->storeManagerMock->expects($this->once()) ->method('getStore') ->willReturn($this->storeMock); - $this->storeMock->expects(static::once()) + $this->storeMock->expects($this->once()) ->method('getId') ->willReturn(1); - $this->quoteMock->expects(static::never()) + $this->quoteMock->expects($this->never()) ->method('setSharedStoreIds'); - $this->quoteMock->expects(static::once()) + $this->quoteMock->expects($this->once()) ->method('loadByIdWithoutStore') ->with($cartId) ->willReturn($this->storeMock); - $this->quoteMock->expects(static::once()) + $this->quoteMock->expects($this->once()) ->method('getId') ->willReturn($cartId); - $this->quoteMock->expects(static::never()) + $this->quoteMock->expects($this->never()) ->method('getCustomerId'); - $this->loadHandlerMock->expects(static::once()) + $this->loadHandlerMock->expects($this->once()) ->method('load') ->with($this->quoteMock); - static::assertEquals($this->quoteMock, $this->model->get($cartId)); - static::assertEquals($this->quoteMock, $this->model->get($cartId)); + $this->assertEquals($this->quoteMock, $this->model->get($cartId)); + $this->assertEquals($this->quoteMock, $this->model->get($cartId)); } public function testGetForCustomerAfterGet() @@ -211,37 +211,37 @@ public function testGetForCustomerAfterGet() $cartId = 15; $customerId = 23; - $this->quoteFactoryMock->expects(static::exactly(2)) + $this->quoteFactoryMock->expects($this->exactly(2)) ->method('create') ->willReturn($this->quoteMock); - $this->storeManagerMock->expects(static::exactly(2)) + $this->storeManagerMock->expects($this->exactly(2)) ->method('getStore') ->willReturn($this->storeMock); - $this->storeMock->expects(static::exactly(2)) + $this->storeMock->expects($this->exactly(2)) ->method('getId') ->willReturn(1); - $this->quoteMock->expects(static::never()) + $this->quoteMock->expects($this->never()) ->method('setSharedStoreIds'); - $this->quoteMock->expects(static::once()) + $this->quoteMock->expects($this->once()) ->method('loadByIdWithoutStore') ->with($cartId) ->willReturn($this->storeMock); - $this->quoteMock->expects(static::once()) + $this->quoteMock->expects($this->once()) ->method('loadByCustomer') ->with($customerId) ->willReturn($this->storeMock); - $this->quoteMock->expects(static::exactly(3)) + $this->quoteMock->expects($this->exactly(3)) ->method('getId') ->willReturn($cartId); - $this->quoteMock->expects(static::any()) + $this->quoteMock->expects($this->any()) ->method('getCustomerId') ->willReturn($customerId); - $this->loadHandlerMock->expects(static::exactly(2)) + $this->loadHandlerMock->expects($this->exactly(2)) ->method('load') ->with($this->quoteMock); - static::assertEquals($this->quoteMock, $this->model->get($cartId)); - static::assertEquals($this->quoteMock, $this->model->getForCustomer($customerId)); + $this->assertEquals($this->quoteMock, $this->model->get($cartId)); + $this->assertEquals($this->quoteMock, $this->model->getForCustomer($customerId)); } public function testGetWithSharedStoreIds() @@ -275,31 +275,31 @@ public function testGetForCustomer() $cartId = 17; $customerId = 23; - $this->quoteFactoryMock->expects(static::once()) + $this->quoteFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->quoteMock); - $this->storeManagerMock->expects(static::once()) + $this->storeManagerMock->expects($this->once()) ->method('getStore') ->willReturn($this->storeMock); - $this->storeMock->expects(static::once()) + $this->storeMock->expects($this->once()) ->method('getId') ->willReturn(1); - $this->quoteMock->expects(static::never()) + $this->quoteMock->expects($this->never()) ->method('setSharedStoreIds'); - $this->quoteMock->expects(static::once()) + $this->quoteMock->expects($this->once()) ->method('loadByCustomer') ->with($customerId) ->willReturn($this->storeMock); - $this->quoteMock->expects(static::exactly(2)) + $this->quoteMock->expects($this->exactly(2)) ->method('getId') ->willReturn($cartId); - $this->loadHandlerMock->expects(static::once()) + $this->loadHandlerMock->expects($this->once()) ->method('load') ->with($this->quoteMock); - static::assertEquals($this->quoteMock, $this->model->getForCustomer($customerId)); - static::assertEquals($this->quoteMock, $this->model->getForCustomer($customerId)); + $this->assertEquals($this->quoteMock, $this->model->getForCustomer($customerId)); + $this->assertEquals($this->quoteMock, $this->model->getForCustomer($customerId)); } /** diff --git a/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php index 34d7707d31666..9da96f822d8c1 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php @@ -491,32 +491,32 @@ public function testEstimateByExtendedAddress() ->method('create') ->will($this->returnValue($address)); - $this->quoteRepository->expects(static::once()) + $this->quoteRepository->expects($this->once()) ->method('getActive') ->with($cartId) ->willReturn($this->quote); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('isVirtual') ->willReturn(false); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getItemsCount') ->willReturn(1); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getShippingAddress') ->willReturn($this->shippingAddress); - $this->dataProcessor->expects(static::any()) + $this->dataProcessor->expects($this->any()) ->method('buildOutputDataArray') ->willReturn($addressData); - $this->shippingAddress->expects(static::once()) + $this->shippingAddress->expects($this->once()) ->method('setCollectShippingRates') ->with(true) ->willReturnSelf(); - $this->totalsCollector->expects(static::once()) + $this->totalsCollector->expects($this->once()) ->method('collectAddressTotals') ->with($this->quote, $this->shippingAddress) ->willReturnSelf(); @@ -528,21 +528,21 @@ public function testEstimateByExtendedAddress() $methodObject = $this->getMockForAbstractClass(ShippingMethodInterface::class); $expectedRates = [$methodObject]; - $this->shippingAddress->expects(static::once()) + $this->shippingAddress->expects($this->once()) ->method('getGroupedAllShippingRates') ->willReturn([[$rate]]); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getQuoteCurrencyCode') ->willReturn($currencyCode); - $this->converter->expects(static::once()) + $this->converter->expects($this->once()) ->method('modelToDataObject') ->with($rate, $currencyCode) ->willReturn($methodObject); $carriersRates = $this->model->estimateByExtendedAddress($cartId, $address); - static::assertEquals($expectedRates, $carriersRates); + $this->assertEquals($expectedRates, $carriersRates); } /** @@ -575,32 +575,32 @@ public function testEstimateByAddressId() ->method('create') ->will($this->returnValue($address)); - $this->quoteRepository->expects(static::once()) + $this->quoteRepository->expects($this->once()) ->method('getActive') ->with($cartId) ->willReturn($this->quote); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('isVirtual') ->willReturn(false); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getItemsCount') ->willReturn(1); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getShippingAddress') ->willReturn($this->shippingAddress); - $this->dataProcessor->expects(static::any()) + $this->dataProcessor->expects($this->any()) ->method('buildOutputDataArray') ->willReturn($addressData); - $this->shippingAddress->expects(static::once()) + $this->shippingAddress->expects($this->once()) ->method('setCollectShippingRates') ->with(true) ->willReturnSelf(); - $this->totalsCollector->expects(static::once()) + $this->totalsCollector->expects($this->once()) ->method('collectAddressTotals') ->with($this->quote, $this->shippingAddress) ->willReturnSelf(); @@ -612,20 +612,20 @@ public function testEstimateByAddressId() $methodObject = $this->getMockForAbstractClass(ShippingMethodInterface::class); $expectedRates = [$methodObject]; - $this->shippingAddress->expects(static::once()) + $this->shippingAddress->expects($this->once()) ->method('getGroupedAllShippingRates') ->willReturn([[$rate]]); - $this->quote->expects(static::once()) + $this->quote->expects($this->once()) ->method('getQuoteCurrencyCode') ->willReturn($currencyCode); - $this->converter->expects(static::once()) + $this->converter->expects($this->once()) ->method('modelToDataObject') ->with($rate, $currencyCode) ->willReturn($methodObject); $carriersRates = $this->model->estimateByAddressId($cartId, $address); - static::assertEquals($expectedRates, $carriersRates); + $this->assertEquals($expectedRates, $carriersRates); } } diff --git a/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php b/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php index 01868242d0e0c..d769be5f2ef98 100644 --- a/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php +++ b/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php @@ -89,7 +89,7 @@ protected function setUp() */ public function testGetIdentities() { - static::assertEquals([Review::CACHE_TAG], $this->block->getIdentities()); + $this->assertEquals([Review::CACHE_TAG], $this->block->getIdentities()); } /** @@ -102,16 +102,16 @@ private function initCollectionMocks() ->setMethods(['addStoreFilter', 'addStatusFilter', 'addEntityFilter', 'getSize', '__wakeup']) ->getMock(); - $this->collection->expects(static::any()) + $this->collection->expects($this->any()) ->method('addStoreFilter') ->willReturnSelf(); - $this->collection->expects(static::any()) + $this->collection->expects($this->any()) ->method('addStatusFilter') ->with(Review::STATUS_APPROVED) ->willReturnSelf(); - $this->collection->expects(static::any()) + $this->collection->expects($this->any()) ->method('addEntityFilter') ->willReturnSelf(); @@ -120,7 +120,7 @@ private function initCollectionMocks() ->setMethods(['create', '__wakeup']) ->getMock(); - $this->collectionFactory->expects(static::once()) + $this->collectionFactory->expects($this->once()) ->method('create') ->willReturn($this->collection); } @@ -168,7 +168,7 @@ private function initContextMock() ->setMethods(['getStore', '__wakeup']) ->getMock(); - $this->storeManager->expects(static::any()) + $this->storeManager->expects($this->any()) ->method('getStore') ->willReturn($this->store); $this->urlBuilder = $this->getMockBuilder(\Magento\Framework\UrlInterface::class)->getMockForAbstractClass(); diff --git a/app/code/Magento/Review/Test/Unit/Model/RatingTest.php b/app/code/Magento/Review/Test/Unit/Model/RatingTest.php index c5b20b910b182..321d6c1075a98 100644 --- a/app/code/Magento/Review/Test/Unit/Model/RatingTest.php +++ b/app/code/Magento/Review/Test/Unit/Model/RatingTest.php @@ -31,6 +31,6 @@ protected function setUp() */ public function testGetIdentities() { - static::assertEquals([Review::CACHE_TAG], $this->rating->getIdentities()); + $this->assertEquals([Review::CACHE_TAG], $this->rating->getIdentities()); } } diff --git a/app/code/Magento/Review/Test/Unit/Observer/ProcessProductAfterDeleteEventObserverTest.php b/app/code/Magento/Review/Test/Unit/Observer/ProcessProductAfterDeleteEventObserverTest.php index 9d3980a99f9a4..91e3cfe63a7d7 100644 --- a/app/code/Magento/Review/Test/Unit/Observer/ProcessProductAfterDeleteEventObserverTest.php +++ b/app/code/Magento/Review/Test/Unit/Observer/ProcessProductAfterDeleteEventObserverTest.php @@ -71,7 +71,7 @@ public function testCleanupProductReviewsWithProduct() ->setMethods(['getId']) ->getMock(); - $productMock->expects(self::exactly(3)) + $productMock->expects($this->exactly(3)) ->method('getId') ->willReturn($productId); $eventMock->expects($this->once()) diff --git a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/AbstractCreateTest.php b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/AbstractCreateTest.php index e010674ca354e..54b7ee5c4ae57 100644 --- a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/AbstractCreateTest.php +++ b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/AbstractCreateTest.php @@ -79,7 +79,7 @@ public function testGetProduct($item) { $product = $this->model->getProduct($item); - self::assertInstanceOf(Product::class, $product); + $this->assertInstanceOf(Product::class, $product); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/FormTest.php b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/FormTest.php index 037e8fd1eaaad..fce30090a7428 100644 --- a/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/FormTest.php +++ b/app/code/Magento/Sales/Test/Unit/Block/Adminhtml/Order/Create/FormTest.php @@ -151,7 +151,7 @@ public function testGetOrderDataJson() $this->withQuote(); - self::assertEquals($expected, json_decode($this->block->getOrderDataJson(), true)); + $this->assertEquals($expected, json_decode($this->block->getOrderDataJson(), true)); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php b/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php index 91da34c2b8b26..aef3cd24a8c47 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php @@ -165,7 +165,7 @@ public function testSetAccountData() ->willReturn($this->createMock(RequestInterface::class)); $customer = $this->createMock(CustomerInterface::class); - $this->customerMapper->expects(self::atLeastOnce()) + $this->customerMapper->expects($this->atLeastOnce()) ->method('toFlatArray') ->willReturn(['group_id' => 1]); @@ -201,7 +201,7 @@ public function testSetAccountData() public function testUpdateQuoteItemsNotArray() { $object = $this->adminOrderCreate->updateQuoteItems('string'); - self::assertEquals($this->adminOrderCreate, $object); + $this->assertEquals($this->adminOrderCreate, $object); } public function testUpdateQuoteItemsEmptyConfiguredOption() @@ -223,12 +223,12 @@ public function testUpdateQuoteItemsEmptyConfiguredOption() $this->sessionQuote->method('getQuote') ->willReturn($quote); $this->itemUpdater->method('update') - ->with(self::equalTo($item), self::equalTo($items[1])) + ->with($this->equalTo($item), $this->equalTo($items[1])) ->willReturnSelf(); $this->adminOrderCreate->setRecollect(false); $object = $this->adminOrderCreate->updateQuoteItems($items); - self::assertEquals($this->adminOrderCreate, $object); + $this->assertEquals($this->adminOrderCreate, $object); } public function testUpdateQuoteItemsWithConfiguredOption() @@ -257,11 +257,11 @@ public function testUpdateQuoteItemsWithConfiguredOption() $expectedInfo = $items[1]; $expectedInfo['qty'] = $qty; $this->itemUpdater->method('update') - ->with(self::equalTo($item), self::equalTo($expectedInfo)); + ->with($this->equalTo($item), $this->equalTo($expectedInfo)); $this->adminOrderCreate->setRecollect(false); $object = $this->adminOrderCreate->updateQuoteItems($items); - self::assertEquals($this->adminOrderCreate, $object); + $this->assertEquals($this->adminOrderCreate, $object); } public function testApplyCoupon() @@ -286,7 +286,7 @@ public function testApplyCoupon() ->willReturnSelf(); $object = $this->adminOrderCreate->applyCoupon($couponCode); - self::assertEquals($this->adminOrderCreate, $object); + $this->assertEquals($this->adminOrderCreate, $object); } public function testGetCustomerCart() diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php index 41161379eea2a..905825d2ad453 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Address/RendererTest.php @@ -67,7 +67,7 @@ protected function setUp() $this->customerAddressBlockRendererMock = $this->getMockBuilder(CustomerAddressBlockRenderer::class) ->getMockForAbstractClass(); - $this->orderAddressMock->expects(static::any()) + $this->orderAddressMock->expects($this->any()) ->method('getOrder') ->willReturn($this->orderMock); @@ -89,17 +89,17 @@ public function testFormat() $result = 'result string'; $this->setStoreExpectations(1); - $this->customerAddressConfigMock->expects(static::atLeastOnce()) + $this->customerAddressConfigMock->expects($this->atLeastOnce()) ->method('getFormatByCode') ->with($type) ->willReturn($formatType); - $this->eventManagerMock->expects(static::once()) + $this->eventManagerMock->expects($this->once()) ->method('dispatch') ->with('customer_address_format', ['type' => $formatType, 'address' => $this->orderAddressMock]); - $this->orderAddressMock->expects(static::atLeastOnce()) + $this->orderAddressMock->expects($this->atLeastOnce()) ->method('getData') ->willReturn($addressData); - $this->customerAddressBlockRendererMock->expects(static::once()) + $this->customerAddressBlockRendererMock->expects($this->once()) ->method('renderArray') ->with($addressData, null) ->willReturn($result); @@ -112,11 +112,11 @@ public function testFormatNoRenderer() $type = 'html'; $this->setStoreExpectations(1); - $this->customerAddressConfigMock->expects(static::atLeastOnce()) + $this->customerAddressConfigMock->expects($this->atLeastOnce()) ->method('getFormatByCode') ->with($type) ->willReturn(null); - $this->eventManagerMock->expects(static::never()) + $this->eventManagerMock->expects($this->never()) ->method('dispatch'); $this->assertEquals(null, $this->orderAddressRenderer->format($this->orderAddressMock, $type)); @@ -130,10 +130,10 @@ public function testFormatNoRenderer() */ private function setStoreExpectations($storeId) { - $this->orderMock->expects(static::atLeastOnce()) + $this->orderMock->expects($this->atLeastOnce()) ->method('getStoreId') ->willReturn($storeId); - $this->customerAddressConfigMock->expects(static::atLeastOnce()) + $this->customerAddressConfigMock->expects($this->atLeastOnce()) ->method('setStore') ->with($storeId) ->willReturnSelf(); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php index 93eb56a07955c..94a2e19f694e8 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/AddressTest.php @@ -63,16 +63,16 @@ public function testGetRegionCodeRegionIsSet() $this->address->setData('region_id', $regionId); $this->address->setData('country_id', 2); - $this->regionMock->expects(static::once()) + $this->regionMock->expects($this->once()) ->method('load') ->with($regionId) ->willReturnSelf(); - $this->regionMock->expects(static::once()) + $this->regionMock->expects($this->once()) ->method('getCountryId') ->willReturn(1); - $this->regionFactoryMock->expects(static::once()) + $this->regionFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->regionMock); $this->assertEquals('region', $this->address->getRegionCode()); diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php index 01589fcd7fdb3..479f1c31ea1c2 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/InvoiceTest.php @@ -331,7 +331,7 @@ public function testCapturePaid() ->willReturnSelf(); $this->mockPay(); - self::assertEquals($this->model, $this->model->capture()); + $this->assertEquals($this->model, $this->model->capture()); } public function mockPay() @@ -370,16 +370,16 @@ public function testPay( $collection->method('getItems') ->willReturn($items); - self::assertFalse($this->model->wasPayCalled()); - self::assertEquals($this->model, $this->model->pay()); - self::assertTrue($this->model->wasPayCalled()); - self::assertEquals($expectedState, $this->model->getState()); + $this->assertFalse($this->model->wasPayCalled()); + $this->assertEquals($this->model, $this->model->pay()); + $this->assertTrue($this->model->wasPayCalled()); + $this->assertEquals($expectedState, $this->model->getState()); #second call of pay() method must do nothing $this->model->pay(); - self::assertEquals($expectedBaseTotal, $this->order->getBaseTotalPaid()); - self::assertEquals($expectedTotal, $this->order->getTotalPaid()); + $this->assertEquals($expectedBaseTotal, $this->order->getBaseTotalPaid()); + $this->assertEquals($expectedTotal, $this->order->getTotalPaid()); } /** @@ -441,7 +441,7 @@ public function testCancelOpenInvoice() $this->model->setState(Invoice::STATE_OPEN); $this->model->cancel(); - self::assertEquals(Invoice::STATE_CANCELED, $this->model->getState()); + $this->assertEquals(Invoice::STATE_CANCELED, $this->model->getState()); } /** @@ -462,7 +462,7 @@ public function testCannotCancelNotOpenedInvoice($initialInvoiceStatus, $finalIn $this->model->setState($initialInvoiceStatus); $this->model->cancel(); - self::assertEquals($finalInvoiceStatus, $this->model->getState()); + $this->assertEquals($finalInvoiceStatus, $this->model->getState()); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/AuthorizeCommandTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/AuthorizeCommandTest.php index 3c9fcf377fab9..7641161b12eb3 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/AuthorizeCommandTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/AuthorizeCommandTest.php @@ -52,7 +52,7 @@ public function testExecute( ); $this->assertOrderStateAndStatus($this->getOrder(), $expectedState, $expectedStatus); - self::assertEquals(__($expectedMessage, $this->amount), $actualReturn); + $this->assertEquals(__($expectedMessage, $this->amount), $actualReturn); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/CaptureCommandTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/CaptureCommandTest.php index 63fe196d33e12..8753fe8aed35b 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/CaptureCommandTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/CaptureCommandTest.php @@ -52,7 +52,7 @@ public function testExecute( ); $this->assertOrderStateAndStatus($this->getOrder(), $expectedState, $expectedStatus); - self::assertEquals(__($expectedMessage, $this->amount), $actualReturn); + $this->assertEquals(__($expectedMessage, $this->amount), $actualReturn); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/OrderCommandTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/OrderCommandTest.php index 7331041188f40..e25437931e0a0 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/OrderCommandTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/OrderCommandTest.php @@ -52,7 +52,7 @@ public function testExecute( ); $this->assertOrderStateAndStatus($this->getOrder(), $expectedState, $expectedStatus); - self::assertEquals(__($expectedMessage, $this->amount), $actualReturn); + $this->assertEquals(__($expectedMessage, $this->amount), $actualReturn); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php index 1b762fafe0b71..68be0ab0e13cf 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Payment/State/RegisterCaptureNotificationCommandTest.php @@ -55,7 +55,7 @@ public function testExecute( ); $this->assertOrderStateAndStatus($order, $expectedState, $expectedStatus); - self::assertEquals(__($expectedMessage, $this->amount), $actualReturn); + $this->assertEquals(__($expectedMessage, $this->amount), $actualReturn); } /** @@ -178,7 +178,7 @@ private function getCurrency() */ private function assertOrderStateAndStatus($order, $expectedState, $expectedStatus) { - self::assertEquals($expectedState, $order->getState(), 'The order {state} should match.'); - self::assertEquals($expectedStatus, $order->getStatus(), 'The order {status} should match.'); + $this->assertEquals($expectedState, $order->getState(), 'The order {state} should match.'); + $this->assertEquals($expectedStatus, $order->getStatus(), 'The order {status} should match.'); } } diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php index 30b584b8c4ebf..80832a8837eac 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php @@ -597,7 +597,7 @@ public function testAcceptApprovePaymentTrue() ->willReturn($acceptPayment); $this->payment->accept(); - self::assertEquals($baseGrandTotal, $this->payment->getBaseAmountPaidOnline()); + $this->assertEquals($baseGrandTotal, $this->payment->getBaseAmountPaidOnline()); } /** @@ -863,7 +863,7 @@ private function mockInvoice($transactionId, $countCall = 1) ->with($transactionId); $this->invoice->method('getId') ->willReturn($transactionId); - $this->order->expects(self::exactly($countCall)) + $this->order->expects($this->exactly($countCall)) ->method('getInvoiceCollection') ->willReturn([$this->invoice]); } @@ -917,13 +917,13 @@ public function testUpdateOnlineTransactionApprovedIpn() $this->invoice->setBaseGrandTotal($baseGrandTotal); $this->mockResultTrueMethods($this->transactionId, $baseGrandTotal, $message); - $this->order->expects(self::never()) + $this->order->expects($this->never()) ->method('getStoreId'); - $this->helper->expects(self::never()) + $this->helper->expects($this->never()) ->method('getMethodInstance'); - $this->paymentMethod->expects(self::never()) + $this->paymentMethod->expects($this->never()) ->method('setStore'); - $this->paymentMethod->expects(self::never()) + $this->paymentMethod->expects($this->never()) ->method('fetchTransactionInfo'); $this->payment->update($isOnline); @@ -1222,7 +1222,7 @@ public function testPay() $amountPaid = 10; $shippingCaptured = 5; - self::assertNull($this->payment->getAmountPaid()); + $this->assertNull($this->payment->getAmountPaid()); $this->mockInvoice(null); $this->invoice->setGrandTotal($amountPaid); @@ -1230,11 +1230,11 @@ public function testPay() $this->invoice->setShippingAmount($shippingCaptured); $this->invoice->setBaseShippingAmount($shippingCaptured); - self::assertSame($this->payment, $this->payment->pay($this->invoice)); - self::assertEquals($amountPaid, $this->payment->getAmountPaid()); - self::assertEquals($amountPaid, $this->payment->getBaseAmountPaid()); - self::assertEquals($shippingCaptured, $this->payment->getShippingCaptured()); - self::assertEquals($shippingCaptured, $this->payment->getBaseShippingCaptured()); + $this->assertSame($this->payment, $this->payment->pay($this->invoice)); + $this->assertEquals($amountPaid, $this->payment->getAmountPaid()); + $this->assertEquals($amountPaid, $this->payment->getBaseAmountPaid()); + $this->assertEquals($shippingCaptured, $this->payment->getShippingCaptured()); + $this->assertEquals($shippingCaptured, $this->payment->getBaseShippingCaptured()); } /** @@ -1257,8 +1257,8 @@ public function testPayWithMultipleInvoices() $this->payment->pay($this->invoice); - self::assertEquals(10, $this->payment->getAmountPaid()); - self::assertEquals(5, $this->payment->getShippingCaptured()); + $this->assertEquals(10, $this->payment->getAmountPaid()); + $this->assertEquals(5, $this->payment->getShippingCaptured()); } public function testGetOrder() @@ -1468,25 +1468,25 @@ public function testCanRefund($canRefund) public function testRefund() { $amount = 204.04; - $this->creditMemoMock->expects(static::once()) + $this->creditMemoMock->expects($this->once()) ->method('getBaseGrandTotal') ->willReturn($amount); - $this->creditMemoMock->expects(static::once()) + $this->creditMemoMock->expects($this->once()) ->method('getGrandTotal') ->willReturn($amount); - $this->creditMemoMock->expects(static::once()) + $this->creditMemoMock->expects($this->once()) ->method('getDoTransaction') ->willReturn(true); - $this->paymentMethod->expects(static::once()) + $this->paymentMethod->expects($this->once()) ->method('canRefund') ->willReturn(true); $this->mockInvoice(self::TRANSACTION_ID, 0); - $this->creditMemoMock->expects(static::once()) + $this->creditMemoMock->expects($this->once()) ->method('getInvoice') ->willReturn($this->invoice); - $this->creditMemoMock->expects(static::once()) + $this->creditMemoMock->expects($this->once()) ->method('getOrder') ->willReturn($this->order); @@ -1497,27 +1497,27 @@ public function testRefund() ->getMock(); $refundTranId = $captureTranId . '-' . Transaction::TYPE_REFUND; - $this->transactionManagerMock->expects(static::once()) + $this->transactionManagerMock->expects($this->once()) ->method('generateTransactionId') ->willReturn($refundTranId); - $captureTransaction->expects(static::once()) + $captureTransaction->expects($this->once()) ->method('getTxnId') ->willReturn($captureTranId); - $this->transactionRepositoryMock->expects(static::once()) + $this->transactionRepositoryMock->expects($this->once()) ->method('getByTransactionId') ->willReturn($captureTransaction); - $this->paymentMethod->expects(static::once()) + $this->paymentMethod->expects($this->once()) ->method('refund') ->with($this->payment, $amount); $isOnline = true; $this->getTransactionBuilderMock([], $isOnline, Transaction::TYPE_REFUND, $refundTranId); - $this->currencyMock->expects(static::once()) + $this->currencyMock->expects($this->once()) ->method('formatTxt') ->willReturn($amount); - $this->order->expects(static::once()) + $this->order->expects($this->once()) ->method('getBaseCurrency') ->willReturn($this->currencyMock); @@ -1529,10 +1529,10 @@ public function testRefund() $this->mockGetDefaultStatus(Order::STATE_CLOSED, $status); $this->assertOrderUpdated(Order::STATE_PROCESSING, $status, $message); - static::assertSame($this->payment, $this->payment->refund($this->creditMemoMock)); - static::assertEquals($amount, $this->payment->getData('amount_refunded')); - static::assertEquals($amount, $this->payment->getData('base_amount_refunded_online')); - static::assertEquals($amount, $this->payment->getData('base_amount_refunded')); + $this->assertSame($this->payment, $this->payment->refund($this->creditMemoMock)); + $this->assertEquals($amount, $this->payment->getData('amount_refunded')); + $this->assertEquals($amount, $this->payment->getData('base_amount_refunded_online')); + $this->assertEquals($amount, $this->payment->getData('base_amount_refunded')); } /** @@ -1555,12 +1555,12 @@ public function testIsCaptureFinal() $amount = 23.02; $partialAmount = 12.00; - $this->order->expects(static::exactly(2)) + $this->order->expects($this->exactly(2)) ->method('getBaseTotalDue') ->willReturn($amount); - static::assertFalse($this->payment->isCaptureFinal($partialAmount)); - static::assertTrue($this->payment->isCaptureFinal($amount)); + $this->assertFalse($this->payment->isCaptureFinal($partialAmount)); + $this->assertTrue($this->payment->isCaptureFinal($amount)); } /** @@ -1570,10 +1570,10 @@ public function testIsCaptureFinal() public function testGetShouldCloseParentTransaction() { $this->payment->setShouldCloseParentTransaction(1); - static::assertTrue($this->payment->getShouldCloseParentTransaction()); + $this->assertTrue($this->payment->getShouldCloseParentTransaction()); $this->payment->setShouldCloseParentTransaction(0); - static::assertFalse($this->payment->getShouldCloseParentTransaction()); + $this->assertFalse($this->payment->getShouldCloseParentTransaction()); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentTest.php index a7649b5387cbe..91aa95de8a5af 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentTest.php @@ -73,11 +73,11 @@ public function testGetCommentsCollection() ->with($this->shipmentModel); $collection = [$shipmentItem]; - $this->commentCollection->expects(self::once()) + $this->commentCollection->expects($this->once()) ->method('setShipmentFilter') ->with($shipmentId) ->willReturnSelf(); - $this->commentCollection->expects(self::once()) + $this->commentCollection->expects($this->once()) ->method('setCreatedAtOrder') ->willReturnSelf(); @@ -88,8 +88,8 @@ public function testGetCommentsCollection() $actual = $this->shipmentModel->getCommentsCollection(); - self::assertTrue(is_object($actual)); - self::assertEquals($this->commentCollection, $actual); + $this->assertTrue(is_object($actual)); + $this->assertEquals($this->commentCollection, $actual); } /** @@ -107,7 +107,7 @@ public function testGetComments() ->disableOriginalConstructor() ->setMethods(['setShipment']) ->getMock(); - $shipmentItem->expects(self::once()) + $shipmentItem->expects($this->once()) ->method('setShipment') ->with($this->shipmentModel); $collection = [$shipmentItem]; @@ -121,13 +121,13 @@ public function testGetComments() $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($this->commentCollection, $collection); - $this->commentCollection->expects(self::once()) + $this->commentCollection->expects($this->once()) ->method('getItems') ->willReturn($collection); $actual = $this->shipmentModel->getComments(); - self::assertTrue(is_array($actual)); - self::assertEquals($collection, $actual); + $this->assertTrue(is_array($actual)); + $this->assertEquals($collection, $actual); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php index 57a4d5f40aa36..9392438986337 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/StatusResolverTest.php @@ -24,7 +24,7 @@ public function testGetOrderStatusByState($order, $expectedReturn) { $actualReturn = (new StatusResolver())->getOrderStatusByState($order, 'new'); - self::assertEquals($expectedReturn, $actualReturn); + $this->assertEquals($expectedReturn, $actualReturn); } /** diff --git a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php index f724136eb5154..f9a9d61fe6f16 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php @@ -436,7 +436,7 @@ public function testCanReorder() $product = $this->getMockBuilder(ProductInterface::class) ->setMethods(['isSalable']) ->getMockForAbstractClass(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('isSalable') ->willReturn(true); @@ -505,7 +505,7 @@ public function testCanReorderProductNotExists() $product = $this->getMockBuilder(ProductInterface::class) ->setMethods(['isSalable']) ->getMockForAbstractClass(); - $product->expects(static::never()) + $product->expects($this->never()) ->method('isSalable'); $productCollection = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) @@ -552,7 +552,7 @@ public function testCanReorderProductNotSalable() $product = $this->getMockBuilder(ProductInterface::class) ->setMethods(['isSalable']) ->getMockForAbstractClass(); - $product->expects(static::once()) + $product->expects($this->once()) ->method('isSalable') ->willReturn(false); diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Provider/NotSyncedDataProviderTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Provider/NotSyncedDataProviderTest.php index 87e9f201eb758..13a955322bca8 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Provider/NotSyncedDataProviderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Provider/NotSyncedDataProviderTest.php @@ -27,7 +27,7 @@ public function testGetIdsEmpty() ->willReturn([]); $provider = new NotSyncedDataProvider($tMapFactory); - self::assertEquals([], $provider->getIds('main_table', 'grid_table')); + $this->assertEquals([], $provider->getIds('main_table', 'grid_table')); } public function testGetIds() @@ -49,7 +49,7 @@ public function testGetIds() ->willReturn([2, 3, 4]); $tMapFactory->method('create') - ->with(self::equalTo( + ->with($this->equalTo( [ 'array' => [$provider1, $provider2], 'type' => NotSyncedDataProviderInterface::class @@ -59,7 +59,7 @@ public function testGetIds() $provider = new NotSyncedDataProvider($tMapFactory, [$provider1, $provider2]); - self::assertEquals( + $this->assertEquals( [1, 2, 3, 4], array_values($provider->getIds('main_table', 'grid_table')) ); diff --git a/app/code/Magento/Sales/Test/Unit/Ui/Component/DataProvider/DocumentTest.php b/app/code/Magento/Sales/Test/Unit/Ui/Component/DataProvider/DocumentTest.php index 8052c06eee8d9..d6cd6b2956e76 100644 --- a/app/code/Magento/Sales/Test/Unit/Ui/Component/DataProvider/DocumentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Ui/Component/DataProvider/DocumentTest.php @@ -50,11 +50,11 @@ public function testGetStateAttribute() { $this->document->setData('state', Invoice::STATE_PAID); - $this->groupRepository->expects(static::never()) + $this->groupRepository->expects($this->never()) ->method('getById'); $attribute = $this->document->getCustomAttribute('state'); - static::assertEquals('Paid', $attribute->getValue()); + $this->assertEquals('Paid', $attribute->getValue()); } /** @@ -66,16 +66,16 @@ public function testGetCustomerGroupAttribute() $group = $this->getMockForAbstractClass(GroupInterface::class); - $this->groupRepository->expects(static::once()) + $this->groupRepository->expects($this->once()) ->method('getById') ->willReturn($group); - $group->expects(static::once()) + $group->expects($this->once()) ->method('getCode') ->willReturn('General'); $attribute = $this->document->getCustomAttribute('customer_group_id'); - static::assertEquals('General', $attribute->getValue()); + $this->assertEquals('General', $attribute->getValue()); } /** @@ -91,7 +91,7 @@ private function initAttributeValueFactoryMock() $attributeValue = new AttributeValue(); - $this->attributeValueFactory->expects(static::once()) + $this->attributeValueFactory->expects($this->once()) ->method('create') ->willReturn($attributeValue); } diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/CouponGeneratorTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/CouponGeneratorTest.php index 24ea8f2ab5efb..49083a7e0f5b3 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/CouponGeneratorTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/CouponGeneratorTest.php @@ -69,6 +69,6 @@ public function testBeforeSave() $this->couponManagementServiceMock->expects($this->once())->method('generate') ->with($this->generationSpecMock)->willReturn($expected); $actual = $this->couponGenerator->generateCodes([]); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } } diff --git a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php index 1f9aad8d4316d..d9032c10f0a09 100644 --- a/app/code/Magento/Search/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/Search/Test/Unit/Helper/DataTest.php @@ -150,12 +150,12 @@ public function queryTextDataProvider() */ public function testGetSuggestUrl(bool $isSecure) { - $this->requestMock->expects(self::once()) + $this->requestMock->expects($this->once()) ->method('isSecure') ->willReturn($isSecure); - $this->urlBuilderMock->expects(self::once()) + $this->urlBuilderMock->expects($this->once()) ->method('getUrl') - ->with(self::identicalTo('search/ajax/suggest'), self::identicalTo(['_secure' => $isSecure])); + ->with($this->identicalTo('search/ajax/suggest'), $this->identicalTo(['_secure' => $isSecure])); $this->model->getSuggestUrl(); } diff --git a/app/code/Magento/Search/Test/Unit/Model/PopularSearchTermsTest.php b/app/code/Magento/Search/Test/Unit/Model/PopularSearchTermsTest.php index 849a0c067d459..f745e7f84ef87 100644 --- a/app/code/Magento/Search/Test/Unit/Model/PopularSearchTermsTest.php +++ b/app/code/Magento/Search/Test/Unit/Model/PopularSearchTermsTest.php @@ -77,7 +77,7 @@ public function testIsCacheable($term, $terms, $expected) ->willReturn($terms); $actual = $this->popularSearchTerms->isCacheable($term, $storeId); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelGeneratorTest.php b/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelGeneratorTest.php index f97d8bb3c9400..fcba8533c2cd3 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelGeneratorTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelGeneratorTest.php @@ -89,7 +89,7 @@ public function testAddTrackingNumbersToShipment(array $info) $order = $this->getMockBuilder(\Magento\Sales\Model\Order::class) ->disableOriginalConstructor() ->getMock(); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getShippingMethod') ->with(true) ->willReturn($this->getShippingMethodMock()); @@ -100,9 +100,9 @@ public function testAddTrackingNumbersToShipment(array $info) $shipmentMock = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment::class) ->disableOriginalConstructor() ->getMock(); - $shipmentMock->expects(static::once())->method('getOrder')->willReturn($order); + $shipmentMock->expects($this->once())->method('getOrder')->willReturn($order); - $this->carrierFactory->expects(static::once()) + $this->carrierFactory->expects($this->once()) ->method('create') ->with(self::CARRIER_CODE) ->willReturn($this->getCarrierMock()); @@ -110,20 +110,20 @@ public function testAddTrackingNumbersToShipment(array $info) $labelsMock = $this->getMockBuilder(\Magento\Shipping\Model\Shipping\Labels::class) ->disableOriginalConstructor() ->getMock(); - $labelsMock->expects(static::once()) + $labelsMock->expects($this->once()) ->method('requestToShipment') ->with($shipmentMock) ->willReturn($this->getResponseMock($info)); - $this->labelsFactory->expects(static::once()) + $this->labelsFactory->expects($this->once()) ->method('create') ->willReturn($labelsMock); - $this->filesystem->expects(static::once()) + $this->filesystem->expects($this->once()) ->method('getDirectoryWrite') ->willReturn($this->createMock(\Magento\Framework\Filesystem\Directory\WriteInterface::class)); - $this->scopeConfig->expects(static::once()) + $this->scopeConfig->expects($this->once()) ->method('getValue') ->with( 'carriers/' . self::CARRIER_CODE . '/title', @@ -131,7 +131,7 @@ public function testAddTrackingNumbersToShipment(array $info) null )->willReturn(self::CARRIER_TITLE); - $this->labelsFactory->expects(static::once()) + $this->labelsFactory->expects($this->once()) ->method('create') ->willReturn($labelsMock); @@ -143,21 +143,21 @@ public function testAddTrackingNumbersToShipment(array $info) $i = 0; $trackingNumbers = is_array($info['tracking_number']) ? $info['tracking_number'] : [$info['tracking_number']]; foreach ($trackingNumbers as $trackingNumber) { - $trackMock->expects(static::at($i++)) + $trackMock->expects($this->at($i++)) ->method('setNumber') ->with($trackingNumber) ->willReturnSelf(); - $trackMock->expects(static::at($i++)) + $trackMock->expects($this->at($i++)) ->method('setCarrierCode') ->with(self::CARRIER_CODE) ->willReturnSelf(); - $trackMock->expects(static::at($i++)) + $trackMock->expects($this->at($i++)) ->method('setTitle') ->with(self::CARRIER_TITLE) ->willReturnSelf(); } - $this->trackFactory->expects(static::any()) + $this->trackFactory->expects($this->any()) ->method('create') ->willReturn($trackMock); @@ -177,7 +177,7 @@ private function getShippingMethodMock() ->disableOriginalConstructor() ->setMethods(['getCarrierCode']) ->getMock(); - $shippingMethod->expects(static::once()) + $shippingMethod->expects($this->once()) ->method('getCarrierCode') ->willReturn(self::CARRIER_CODE); @@ -193,10 +193,10 @@ private function getCarrierMock() ->disableOriginalConstructor() ->setMethods(['isShippingLabelsAvailable', 'getCarrierCode']) ->getMockForAbstractClass(); - $carrierMock->expects(static::once()) + $carrierMock->expects($this->once()) ->method('isShippingLabelsAvailable') ->willReturn(true); - $carrierMock->expects(static::once()) + $carrierMock->expects($this->once()) ->method('getCarrierCode') ->willReturn(self::CARRIER_CODE); @@ -213,13 +213,13 @@ private function getResponseMock(array $info) ->setMethods(['hasErrors', 'hasInfo', 'getInfo']) ->disableOriginalConstructor() ->getMock(); - $responseMock->expects(static::once()) + $responseMock->expects($this->once()) ->method('hasErrors') ->willReturn(false); - $responseMock->expects(static::once()) + $responseMock->expects($this->once()) ->method('hasInfo') ->willReturn(true); - $responseMock->expects(static::once()) + $responseMock->expects($this->once()) ->method('getInfo') ->willReturn([$info]); diff --git a/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelsTest.php b/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelsTest.php index 6964b321824fe..04892b6d1ae04 100644 --- a/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelsTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelsTest.php @@ -57,7 +57,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $requestFactory->expects(static::any())->method('create')->willReturn($this->request); + $requestFactory->expects($this->any())->method('create')->willReturn($this->request); $this->carrierFactory = $this->getMockBuilder(\Magento\Shipping\Model\CarrierFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) @@ -72,7 +72,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['getUser']) ->getMock(); - $authSession->expects(static::any())->method('getUser')->willReturn($this->user); + $authSession->expects($this->any())->method('getUser')->willReturn($this->user); $regionFactory = $this->getRegionFactory(); $this->scopeConfig = $this->getMockBuilder(\Magento\Framework\App\Config::class) ->disableOriginalConstructor() @@ -100,7 +100,7 @@ public function testRequestToShipment($regionId) $carrier = $this->getMockBuilder(\Magento\Shipping\Model\Carrier\AbstractCarrier::class) ->disableOriginalConstructor() ->getMock(); - $this->carrierFactory->expects(static::any())->method('create')->willReturn($carrier); + $this->carrierFactory->expects($this->any())->method('create')->willReturn($carrier); $order = $this->getMockBuilder(\Magento\Sales\Model\Order::class) ->disableOriginalConstructor() ->getMock(); @@ -112,21 +112,21 @@ public function testRequestToShipment($regionId) ->disableOriginalConstructor() ->setMethods(['getCarrierCode']) ->getMock(); - $shippingMethod->expects(static::once()) + $shippingMethod->expects($this->once()) ->method('getCarrierCode') ->willReturn('usps'); - $order->expects(static::exactly(2)) + $order->expects($this->exactly(2)) ->method('getShippingMethod') ->with(true) ->willReturn($shippingMethod); $address = $this->getRecipientAddress(); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getShippingAddress') ->willReturn($address); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getWeight') ->willReturn(2); @@ -134,11 +134,11 @@ public function testRequestToShipment($regionId) $shipment = $this->getMockBuilder(\Magento\Sales\Model\Order\Shipment::class) ->disableOriginalConstructor() ->getMock(); - $shipment->expects(static::once())->method('getOrder')->willReturn($order); - $shipment->expects(static::once())->method('getStoreId')->willReturn($storeId); - $shipment->expects(static::once())->method('getPackages')->willReturn(''); + $shipment->expects($this->once())->method('getOrder')->willReturn($order); + $shipment->expects($this->once())->method('getStoreId')->willReturn($storeId); + $shipment->expects($this->once())->method('getPackages')->willReturn(''); - $this->scopeConfig->expects(static::any()) + $this->scopeConfig->expects($this->any()) ->method('getValue') ->willReturnMap([ [Shipment::XML_PATH_STORE_REGION_ID, ScopeInterface::SCOPE_STORE, $storeId, $regionId], @@ -175,7 +175,7 @@ public function testRequestToShipmentLocalizedException($isShipmentCarrierNotNul ->with(true) ->willReturn($shippingMethod); $this->carrierFactory - ->expects(static::any()) + ->expects($this->any()) ->method('create') ->willReturn($isShipmentCarrierNotNull ? $shippingMethod : null); $shipment->expects($this->once())->method('getOrder')->willReturn($order); @@ -190,7 +190,7 @@ protected function getStoreManager() $store = $this->getMockBuilder(\Magento\Store\Model\Store::class) ->disableOriginalConstructor() ->getMock(); - $store->expects(static::any()) + $store->expects($this->any()) ->method('getBaseCurrencyCode') ->willReturn('USD'); @@ -198,7 +198,7 @@ protected function getStoreManager() ->disableOriginalConstructor() ->setMethods(['getStore']) ->getMock(); - $storeManager->expects(static::any())->method('getStore')->willReturn($store); + $storeManager->expects($this->any())->method('getStore')->willReturn($store); return $storeManager; } @@ -215,7 +215,7 @@ protected function getRegionFactory() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $regionFactory->expects(static::any())->method('create')->willReturn($this->region); + $regionFactory->expects($this->any())->method('create')->willReturn($this->region); return $regionFactory; } @@ -227,34 +227,34 @@ protected function getRecipientAddress() $address = $this->getMockBuilder(\Magento\Sales\Model\Order\Address::class) ->disableOriginalConstructor() ->getMock(); - $address->expects(static::exactly(2)) + $address->expects($this->exactly(2)) ->method('getRegionCode') ->willReturn('CO'); - $address->expects(static::exactly(2)) + $address->expects($this->exactly(2)) ->method('getFirstname') ->willReturn('Chimi'); - $address->expects(static::exactly(2)) + $address->expects($this->exactly(2)) ->method('getLastname') ->willReturn('Chung'); - $address->expects(static::once()) + $address->expects($this->once()) ->method('getCompany') ->willReturn('Software LLC'); - $address->expects(static::once()) + $address->expects($this->once()) ->method('getTelephone') ->willReturn('(231) 324-123-31'); - $address->expects(static::once()) + $address->expects($this->once()) ->method('getEmail') ->willReturn('chimi.chung@test.com'); - $address->expects(static::exactly(4)) + $address->expects($this->exactly(4)) ->method('getStreetLine') ->willReturn('66 Pearl St'); - $address->expects(static::once()) + $address->expects($this->once()) ->method('getCity') ->willReturn('Denver'); - $address->expects(static::once()) + $address->expects($this->once()) ->method('getPostcode') ->willReturn('80203'); - $address->expects(static::once()) + $address->expects($this->once()) ->method('getCountryId') ->willReturn(1); return $address; diff --git a/app/code/Magento/Signifyd/Test/Unit/Block/Adminhtml/CaseInfoTest.php b/app/code/Magento/Signifyd/Test/Unit/Block/Adminhtml/CaseInfoTest.php index 164cd8018fb69..0f035b51f21c0 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Block/Adminhtml/CaseInfoTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Block/Adminhtml/CaseInfoTest.php @@ -65,7 +65,7 @@ protected function setUp() $this->request = $this->getMockBuilder(RequestInterface::class) ->getMockForAbstractClass(); - $this->context->expects(self::once()) + $this->context->expects($this->once()) ->method('getRequest') ->willReturn($this->request); @@ -99,15 +99,15 @@ protected function setUp() */ public function testGetGuaranteeDisposition($guaranteeDisposition, $expectedLabel) { - $this->caseManagement->expects(self::once()) + $this->caseManagement->expects($this->once()) ->method('getByOrderId') ->willReturn($this->caseEntity); - $this->caseEntity->expects(self::atLeastOnce()) + $this->caseEntity->expects($this->atLeastOnce()) ->method('getGuaranteeDisposition') ->willReturn($guaranteeDisposition); - self::assertEquals( + $this->assertEquals( $expectedLabel, $this->caseInfo->getCaseGuaranteeDisposition() ); @@ -138,11 +138,11 @@ public function getGuaranteeLabelDataProvider() */ public function testCasePropertyWithEmptyCase() { - $this->caseManagement->expects(self::once()) + $this->caseManagement->expects($this->once()) ->method('getByOrderId') ->willReturn(null); - self::assertEquals( + $this->assertEquals( '', $this->caseInfo->getCaseGuaranteeDisposition() ); diff --git a/app/code/Magento/Signifyd/Test/Unit/Controller/Webhooks/HandlerTest.php b/app/code/Magento/Signifyd/Test/Unit/Controller/Webhooks/HandlerTest.php index 8b98be338b973..7a019330fe985 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Controller/Webhooks/HandlerTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Controller/Webhooks/HandlerTest.php @@ -123,7 +123,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['isDebugModeEnabled', 'getByCaseId']) ->getMock(); - $config->expects(self::any()) + $config->expects($this->any()) ->method('getByCaseId') ->willReturn(false); @@ -169,9 +169,9 @@ public function testExecuteSuccessfully() $caseEntity = $this->getMockBuilder(CaseInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->caseRepository->expects(self::once()) + $this->caseRepository->expects($this->once()) ->method('getByCaseId') - ->with(self::equalTo($caseId)) + ->with($this->equalTo($caseId)) ->willReturn($caseEntity); $caseUpdatingService = $this->getMockBuilder(UpdatingService::class) @@ -219,9 +219,9 @@ public function testExecuteCaseUpdatingServiceException() $caseEntity = $this->getMockBuilder(CaseInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->caseRepository->expects(self::once()) + $this->caseRepository->expects($this->once()) ->method('getByCaseId') - ->with(self::equalTo($caseId)) + ->with($this->equalTo($caseId)) ->willReturn($caseEntity); $caseUpdatingService = $this->getMockBuilder(UpdatingService::class) @@ -303,7 +303,7 @@ public function testExecuteWithTestEventTopic() */ public function testExecuteWithMissedCaseId() { - $this->webhookRequestValidator->expects(self::once()) + $this->webhookRequestValidator->expects($this->once()) ->method('validate') ->willReturn(true); @@ -313,18 +313,18 @@ public function testExecuteWithMissedCaseId() $webhookMessage->expects($this->once()) ->method('getEventTopic') ->willReturn('cases/creation'); - $webhookMessage->expects(self::once()) + $webhookMessage->expects($this->once()) ->method('getData') ->willReturn([ 'orderId' => '1000101' ]); - $this->webhookMessageReader->expects(self::once()) + $this->webhookMessageReader->expects($this->once()) ->method('read') ->with($this->webhookRequest) ->willReturn($webhookMessage); - $this->redirect->expects(self::once()) + $this->redirect->expects($this->once()) ->method('redirect') ->with($this->response, 'noroute', []); @@ -340,7 +340,7 @@ public function testExecuteWithNotFoundCaseEntity() { $caseId = 123; - $this->webhookRequestValidator->expects(self::once()) + $this->webhookRequestValidator->expects($this->once()) ->method('validate') ->willReturn(true); @@ -348,24 +348,24 @@ public function testExecuteWithNotFoundCaseEntity() ->disableOriginalConstructor() ->setMethods(['getData']) ->getMock(); - $webhookMessage->expects(self::once()) + $webhookMessage->expects($this->once()) ->method('getData') ->willReturn([ 'orderId' => '1000101', 'caseId' => $caseId ]); - $this->webhookMessageReader->expects(self::once()) + $this->webhookMessageReader->expects($this->once()) ->method('read') ->with($this->webhookRequest) ->willReturn($webhookMessage); - $this->caseRepository->expects(self::once()) + $this->caseRepository->expects($this->once()) ->method('getByCaseId') - ->with(self::equalTo($caseId)) + ->with($this->equalTo($caseId)) ->willReturn(null); - $this->redirect->expects(self::once()) + $this->redirect->expects($this->once()) ->method('redirect') ->with($this->response, 'noroute', []); diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceFactoryTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceFactoryTest.php index f0184c032b550..3db37f36e9e80 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceFactoryTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceFactoryTest.php @@ -76,17 +76,17 @@ protected function setUp() public function testCreateWithInactiveConfig() { $type = 'cases/creation'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('isActive') ->willReturn(false); - $this->fakeObjectManager->expects(self::once()) + $this->fakeObjectManager->expects($this->once()) ->method('create') ->with(StubUpdatingService::class) ->willReturn(new StubUpdatingService()); $instance = $this->factory->create($type); - static::assertInstanceOf(StubUpdatingService::class, $instance); + $this->assertInstanceOf(StubUpdatingService::class, $instance); } /** @@ -97,17 +97,17 @@ public function testCreateWithInactiveConfig() public function testCreateWithTestType() { $type = 'cases/test'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('isActive') ->willReturn(true); - $this->fakeObjectManager->expects(self::once()) + $this->fakeObjectManager->expects($this->once()) ->method('create') ->with(StubUpdatingService::class) ->willReturn(new StubUpdatingService()); $instance = $this->factory->create($type); - static::assertInstanceOf(StubUpdatingService::class, $instance); + $this->assertInstanceOf(StubUpdatingService::class, $instance); } /** @@ -120,11 +120,11 @@ public function testCreateWithTestType() public function testCreateWithException() { $type = 'cases/unknown'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('isActive') ->willReturn(true); - $this->generatorFactory->expects(self::once()) + $this->generatorFactory->expects($this->once()) ->method('create') ->with($type) ->willThrowException(new \InvalidArgumentException('Specified message type does not supported.')); @@ -140,14 +140,14 @@ public function testCreateWithException() public function testCreate() { $type = 'case/creation'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('isActive') ->willReturn(true); $messageGenerator = $this->getMockBuilder(GeneratorInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->generatorFactory->expects(self::once()) + $this->generatorFactory->expects($this->once()) ->method('create') ->with($type) ->willReturn($messageGenerator); @@ -156,12 +156,12 @@ public function testCreate() ->disableOriginalConstructor() ->getMock(); - $this->fakeObjectManager->expects(self::once()) + $this->fakeObjectManager->expects($this->once()) ->method('create') ->with(UpdatingService::class, ['messageGenerator' => $messageGenerator]) ->willReturn($service); $result = $this->factory->create($type); - static::assertInstanceOf(UpdatingService::class, $result); + $this->assertInstanceOf(UpdatingService::class, $result); } } diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceTest.php index 6eb7e5c37d5fc..31c832431f073 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/CaseServices/UpdatingServiceTest.php @@ -146,7 +146,7 @@ public function testUpdateWithFailedCaseSaving() $caseEntity = $this->withCaseEntity(1, $caseId, $data); - $this->caseRepository->expects(self::once()) + $this->caseRepository->expects($this->once()) ->method('save') ->willThrowException(new \Exception('Something wrong.')); @@ -169,12 +169,12 @@ public function testUpdateWithExceptionFromMessageGenerator() $caseEntity = $this->withCaseEntity(1, $caseId, $data); - $this->caseRepository->expects(self::never()) + $this->caseRepository->expects($this->never()) ->method('save') ->with($caseEntity) ->willReturn($caseEntity); - $this->messageGenerator->expects(self::once()) + $this->messageGenerator->expects($this->once()) ->method('generate') ->with($data) ->willThrowException(new GeneratorException(__('Cannot generate message.'))); @@ -199,22 +199,22 @@ public function testUpdateWithFailedCommentSaving() $caseEntity = $this->withCaseEntity(1, $caseId, $data); - $this->caseRepository->expects(self::once()) + $this->caseRepository->expects($this->once()) ->method('save') ->with($caseEntity) ->willReturn($caseEntity); - $this->orderGridUpdater->expects(self::once()) + $this->orderGridUpdater->expects($this->once()) ->method('update') ->with($data['orderId']); $message = __('Message is generated.'); - $this->messageGenerator->expects(self::once()) + $this->messageGenerator->expects($this->once()) ->method('generate') ->with($data) ->willReturn($message); - $this->commentsHistoryUpdater->expects(self::once()) + $this->commentsHistoryUpdater->expects($this->once()) ->method('addComment') ->with($caseEntity, $message) ->willThrowException(new \Exception('Something wrong')); @@ -238,30 +238,30 @@ public function testUpdate() $caseEntity = $this->withCaseEntity(21, $caseId, $data); $caseEntitySaved = clone $caseEntity; - $caseEntitySaved->expects(self::once()) + $caseEntitySaved->expects($this->once()) ->method('getGuaranteeDisposition') ->willReturn('APPROVED'); - $this->caseRepository->expects(self::once()) + $this->caseRepository->expects($this->once()) ->method('save') ->with($caseEntity) ->willReturn($caseEntitySaved); $message = __('Message is generated.'); - $this->messageGenerator->expects(self::once()) + $this->messageGenerator->expects($this->once()) ->method('generate') ->with($data) ->willReturn($message); - $this->orderGridUpdater->expects(self::once()) + $this->orderGridUpdater->expects($this->once()) ->method('update') ->with($data['orderId']); - $this->commentsHistoryUpdater->expects(self::once()) + $this->commentsHistoryUpdater->expects($this->once()) ->method('addComment') ->with($caseEntitySaved, $message); - $this->orderStateService->expects(self::once()) + $this->orderStateService->expects($this->once()) ->method('updateByCase') ->with($caseEntitySaved); @@ -287,26 +287,26 @@ private function withCaseEntity($caseEntityId, $caseId, array $data = []) ]) ->getMockForAbstractClass(); - $caseEntity->expects(self::any()) + $caseEntity->expects($this->any()) ->method('getEntityId') ->willReturn($caseEntityId); - $caseEntity->expects(self::any()) + $caseEntity->expects($this->any()) ->method('getCaseId') ->willReturn($caseId); foreach ($data as $property => $value) { $method = 'set' . ucfirst($property); if ($property === 'orderId') { - $caseEntity->expects(self::never()) + $caseEntity->expects($this->never()) ->method($method); } - $caseEntity->expects(self::any()) + $caseEntity->expects($this->any()) ->method($method) - ->with(self::equalTo($value)) + ->with($this->equalTo($value)) ->willReturnSelf(); $method = 'get' . ucfirst($property); - $caseEntity->expects(self::any()) + $caseEntity->expects($this->any()) ->method($method) ->willReturn($value); } diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CommentsHistoryUpdaterTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CommentsHistoryUpdaterTest.php index 5cbb3d8d93cdd..a0efec05b511b 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CommentsHistoryUpdaterTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/CommentsHistoryUpdaterTest.php @@ -94,14 +94,14 @@ protected function setUp() */ public function testAddCommentWithException() { - $this->caseEntity->expects(self::once()) + $this->caseEntity->expects($this->once()) ->method('getOrderId') ->willReturn(self::$orderId); $this->historyEntity->method('setStatus') ->with('') ->willReturnSelf(); - $this->historyRepository->expects(self::once()) + $this->historyRepository->expects($this->once()) ->method('save') ->with($this->historyEntity) ->willThrowException(new \Exception('Cannot save comment message.')); @@ -116,14 +116,14 @@ public function testAddCommentWithException() */ public function testAddComment() { - $this->caseEntity->expects(self::once()) + $this->caseEntity->expects($this->once()) ->method('getOrderId') ->willReturn(self::$orderId); $this->historyEntity->method('setStatus') ->with(self::$status) ->willReturnSelf(); - $this->historyRepository->expects(self::once()) + $this->historyRepository->expects($this->once()) ->method('save') ->with($this->historyEntity) ->willReturnSelf(); @@ -138,10 +138,10 @@ public function testAddComment() */ public function testAddCommentWithoutMessage() { - $this->caseEntity->expects(self::never()) + $this->caseEntity->expects($this->never()) ->method('getOrderId'); - $this->historyFactory->expects(self::never()) + $this->historyFactory->expects($this->never()) ->method('save'); $phrase = ''; diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/CustomerOrdersTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/CustomerOrdersTest.php index 02d3b4b9ad7a7..f463d4b329e54 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/CustomerOrdersTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/CustomerOrdersTest.php @@ -139,8 +139,8 @@ public function testGetCountAndTotalAmount() $actual = $this->model->getAggregatedOrdersInfo(self::$customerId); - static::assertEquals(3, $actual['aggregateOrderCount']); - static::assertEquals(169.35, $actual['aggregateOrderDollars']); + $this->assertEquals(3, $actual['aggregateOrderCount']); + $this->assertEquals(169.35, $actual['aggregateOrderDollars']); } /** diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelingServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelingServiceTest.php index f8f1d4a4522c9..76426bc7cb599 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelingServiceTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CancelingServiceTest.php @@ -107,25 +107,25 @@ protected function setUp() */ public function testCancelForOrderWithUnavailableDisposition() { - $this->guaranteeAbility->expects(self::once()) + $this->guaranteeAbility->expects($this->once()) ->method('isAvailable') - ->with(self::equalTo(self::$orderId)) + ->with($this->equalTo(self::$orderId)) ->willReturn(false); - $this->caseManagement->expects(self::never()) + $this->caseManagement->expects($this->never()) ->method('getByOrderId'); - $this->gateway->expects(self::never()) + $this->gateway->expects($this->never()) ->method('cancelGuarantee'); - $this->logger->expects(self::never()) + $this->logger->expects($this->never()) ->method('error'); - $this->updatingFactory->expects(self::never()) + $this->updatingFactory->expects($this->never()) ->method('create'); $result = $this->service->cancelForOrder(self::$orderId); - self::assertFalse($result); + $this->assertFalse($result); } /** @@ -137,20 +137,20 @@ public function testCancelForOrderWithFailedRequest() { $this->withCaseEntity(); - $this->gateway->expects(self::once()) + $this->gateway->expects($this->once()) ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) + ->with($this->equalTo(self::$caseId)) ->willThrowException(new GatewayException('Something wrong.')); - $this->logger->expects(self::once()) + $this->logger->expects($this->once()) ->method('error') - ->with(self::equalTo('Something wrong.')); + ->with($this->equalTo('Something wrong.')); - $this->updatingFactory->expects(self::never()) + $this->updatingFactory->expects($this->never()) ->method('create'); $result = $this->service->cancelForOrder(self::$orderId); - self::assertFalse($result); + $this->assertFalse($result); } /** @@ -162,27 +162,27 @@ public function testCancelForOrder() { $case = $this->withCaseEntity(); - $this->gateway->expects(self::once()) + $this->gateway->expects($this->once()) ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) + ->with($this->equalTo(self::$caseId)) ->willReturn(CaseInterface::GUARANTEE_CANCELED); - $this->logger->expects(self::never()) + $this->logger->expects($this->never()) ->method('error'); $service = $this->getMockBuilder(StubUpdatingService::class) ->setMethods(['update']) ->getMock(); - $this->updatingFactory->expects(self::once()) + $this->updatingFactory->expects($this->once()) ->method('create') ->willReturn($service); - $service->expects(self::once()) + $service->expects($this->once()) ->method('update') - ->with(self::equalTo($case), self::equalTo(['guaranteeDisposition' => CaseInterface::GUARANTEE_CANCELED])); + ->with($this->equalTo($case), $this->equalTo(['guaranteeDisposition' => CaseInterface::GUARANTEE_CANCELED])); $result = $this->service->cancelForOrder(self::$orderId); - self::assertTrue($result); + $this->assertTrue($result); } /** @@ -192,9 +192,9 @@ public function testCancelForOrder() */ private function withCaseEntity() { - $this->guaranteeAbility->expects(self::once()) + $this->guaranteeAbility->expects($this->once()) ->method('isAvailable') - ->with(self::equalTo(self::$orderId)) + ->with($this->equalTo(self::$orderId)) ->willReturn(true); $caseEntity = $this->getMockBuilder(CaseInterface::class) @@ -202,12 +202,12 @@ private function withCaseEntity() ->setMethods(['getCaseId']) ->getMockForAbstractClass(); - $this->caseManagement->expects(self::once()) + $this->caseManagement->expects($this->once()) ->method('getByOrderId') - ->with(self::equalTo(self::$orderId)) + ->with($this->equalTo(self::$orderId)) ->willReturn($caseEntity); - $caseEntity->expects(self::once()) + $caseEntity->expects($this->once()) ->method('getCaseId') ->willReturn(self::$caseId); return $caseEntity; diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php index db64b38375fe1..ae5da508ff9a3 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/Guarantee/CreationServiceTest.php @@ -96,19 +96,19 @@ public function testCreateForOrderWithNotEligibleCase() { $orderId = 1; - $this->createGuaranteeAbility->expects(self::once()) + $this->createGuaranteeAbility->expects($this->once()) ->method('isAvailable') ->with($orderId) ->willReturn(false); - $this->caseManagement->expects(self::never()) + $this->caseManagement->expects($this->never()) ->method('getByOrderId'); - $this->gateway->expects(self::never()) + $this->gateway->expects($this->never()) ->method('submitCaseForGuarantee'); $result = $this->service->createForOrder($orderId); - self::assertFalse($result); + $this->assertFalse($result); } public function testCreateForOrderWitCase() @@ -210,9 +210,9 @@ public function testCreateForOrderWithCaseUpdate() */ private function withCaseEntityExistsForOrderId($orderId, array $caseData = []) { - $this->createGuaranteeAbility->expects(self::once()) + $this->createGuaranteeAbility->expects($this->once()) ->method('isAvailable') - ->with(self::equalTo($orderId)) + ->with($this->equalTo($orderId)) ->willReturn(true); $dummyCaseEntity = $this->getMockBuilder(CaseInterface::class) diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/GeneratorFactoryTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/GeneratorFactoryTest.php index 50f87df3b694f..0beefdcab403c 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/GeneratorFactoryTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/GeneratorFactoryTest.php @@ -58,13 +58,13 @@ public function testCreate($type, $className) ->disableOriginalConstructor() ->getMock(); - $this->fakeObjectManager->expects(self::once()) + $this->fakeObjectManager->expects($this->once()) ->method('create') ->with($className) ->willReturn($generator); $instance = $this->factory->create($type); - self::assertInstanceOf($className, $instance); + $this->assertInstanceOf($className, $instance); } /** diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/PatternGeneratorTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/PatternGeneratorTest.php index 9d5f71f657a1e..f63d88b6c518d 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/PatternGeneratorTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/MessageGenerators/PatternGeneratorTest.php @@ -47,7 +47,7 @@ public function testGenerate($template, array $requiredFields, $expected) $generator = new PatternGenerator($template, $requiredFields); $actual = $generator->generate($data); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentVerificationFactoryTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/PaymentVerificationFactoryTest.php index b0f9239d43bfa..deaae45ade634 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/PaymentVerificationFactoryTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/PaymentVerificationFactoryTest.php @@ -84,12 +84,12 @@ public function testCreatePaymentCvv() { $paymentMethodCode = 'exists_payment'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) + ->with($this->equalTo($paymentMethodCode)) ->willReturnSelf(); - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('getValue') ->with('cvv_ems_adapter') ->willReturn(PaymentVerificationInterface::class); @@ -99,13 +99,13 @@ public function testCreatePaymentCvv() ->disableOriginalConstructor() ->getMock(); - $this->fakeObjectManager->expects(self::once()) + $this->fakeObjectManager->expects($this->once()) ->method('create') - ->with(self::equalTo(PaymentVerificationInterface::class)) + ->with($this->equalTo(PaymentVerificationInterface::class)) ->willReturn($cvvAdapter); $mapper = $this->factory->createPaymentCvv($paymentMethodCode); - self::assertInstanceOf(PaymentVerificationInterface::class, $mapper); + $this->assertInstanceOf(PaymentVerificationInterface::class, $mapper); } /** @@ -117,21 +117,21 @@ public function testCreateDefaultCvvMapper() { $paymentMethodCode = 'non_exists_payment'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) + ->with($this->equalTo($paymentMethodCode)) ->willReturnSelf(); - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('getValue') ->with('cvv_ems_adapter') ->willReturn(null); - $this->fakeObjectManager->expects(self::never()) + $this->fakeObjectManager->expects($this->never()) ->method('create'); $mapper = $this->factory->createPaymentCvv($paymentMethodCode); - self::assertSame($this->cvvDefaultAdapter, $mapper); + $this->assertSame($this->cvvDefaultAdapter, $mapper); } /** @@ -145,20 +145,20 @@ public function testCreateWithUnsupportedImplementation() { $paymentMethodCode = 'exists_payment'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) + ->with($this->equalTo($paymentMethodCode)) ->willReturnSelf(); - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('getValue') ->with('cvv_ems_adapter') ->willReturn(\stdClass::class); $cvvAdapter = new \stdClass(); - $this->fakeObjectManager->expects(self::once()) + $this->fakeObjectManager->expects($this->once()) ->method('create') - ->with(self::equalTo(\stdClass::class)) + ->with($this->equalTo(\stdClass::class)) ->willReturn($cvvAdapter); $this->factory->createPaymentCvv($paymentMethodCode); @@ -173,12 +173,12 @@ public function testCreatePaymentAvs() { $paymentMethodCode = 'exists_payment'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) + ->with($this->equalTo($paymentMethodCode)) ->willReturnSelf(); - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('getValue') ->with('avs_ems_adapter') ->willReturn(PaymentVerificationInterface::class); @@ -187,13 +187,13 @@ public function testCreatePaymentAvs() ->disableOriginalConstructor() ->getMock(); - $this->fakeObjectManager->expects(self::once()) + $this->fakeObjectManager->expects($this->once()) ->method('create') - ->with(self::equalTo(PaymentVerificationInterface::class)) + ->with($this->equalTo(PaymentVerificationInterface::class)) ->willReturn($avsAdapter); $mapper = $this->factory->createPaymentAvs($paymentMethodCode); - self::assertInstanceOf(PaymentVerificationInterface::class, $mapper); + $this->assertInstanceOf(PaymentVerificationInterface::class, $mapper); } /** @@ -203,20 +203,20 @@ public function testCreateDefaultAvsMapper() { $paymentMethodCode = 'non_exists_payment'; - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('setMethodCode') - ->with(self::equalTo($paymentMethodCode)) + ->with($this->equalTo($paymentMethodCode)) ->willReturnSelf(); - $this->config->expects(self::once()) + $this->config->expects($this->once()) ->method('getValue') ->with('avs_ems_adapter') ->willReturn(null); - $this->fakeObjectManager->expects(self::never()) + $this->fakeObjectManager->expects($this->never()) ->method('create'); $mapper = $this->factory->createPaymentAvs($paymentMethodCode); - self::assertSame($this->avsDefaultAdapter, $mapper); + $this->assertSame($this->avsDefaultAdapter, $mapper); } } diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php index ba82ff4619ad3..dd46b293d0c37 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydGateway/GatewayTest.php @@ -346,7 +346,7 @@ public function testCancelGuarantee() $dummyStoreId = 1; $this->withCaseEntity($caseId, $dummyStoreId); - $this->apiClient->expects(self::once()) + $this->apiClient->expects($this->once()) ->method('makeApiCall') ->with( '/cases/' . $caseId . '/guarantee', @@ -359,7 +359,7 @@ public function testCancelGuarantee() ); $result = $this->gateway->cancelGuarantee($caseId); - self::assertEquals(Gateway::GUARANTEE_CANCELED, $result); + $this->assertEquals(Gateway::GUARANTEE_CANCELED, $result); } /** @@ -375,7 +375,7 @@ public function testCancelGuaranteeWithUnexpectedDisposition() $dummyStoreId = 1; $this->withCaseEntity($caseId, $dummyStoreId); - $this->apiClient->expects(self::once()) + $this->apiClient->expects($this->once()) ->method('makeApiCall') ->with( '/cases/' . $caseId . '/guarantee', diff --git a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydOrderSessionIdTest.php b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydOrderSessionIdTest.php index 9d3061f240c21..f83ce1b3efa90 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Model/SignifydOrderSessionIdTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Model/SignifydOrderSessionIdTest.php @@ -47,7 +47,7 @@ public function testGetByQuoteId() $quoteId = 1; $signifydOrderSessionId = 'asdfzxcv'; - $this->identityGenerator->expects(self::once()) + $this->identityGenerator->expects($this->once()) ->method('generateIdForData') ->with($quoteId) ->willReturn($signifydOrderSessionId); diff --git a/app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php b/app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php index d63831b1d4a8e..e991570464af6 100644 --- a/app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php +++ b/app/code/Magento/Signifyd/Test/Unit/Observer/PlaceOrderTest.php @@ -103,7 +103,7 @@ public function testExecuteWithDisabledModule() $this->withActiveSignifydIntegration(false, $storeId); $this->withOrderEntity($orderId, $storeId); - $this->creationService->expects(self::never()) + $this->creationService->expects($this->never()) ->method('createForOrder'); $this->placeOrder->execute($this->observer); @@ -119,7 +119,7 @@ public function testExecuteWithoutOrder() $this->withActiveSignifydIntegration(true); $this->withOrderEntity(null, null); - $this->creationService->expects(self::never()) + $this->creationService->expects($this->never()) ->method('createForOrder'); $this->placeOrder->execute($this->observer); @@ -138,7 +138,7 @@ public function testExecuteWithOfflinePayment() $this->withOrderEntity($orderId, $storeId); $this->withAvailablePaymentMethod(false); - $this->creationService->expects(self::never()) + $this->creationService->expects($this->never()) ->method('createForOrder'); $this->placeOrder->execute($this->observer); @@ -160,11 +160,11 @@ public function testExecuteWithFailedCaseCreation() $this->withAvailablePaymentMethod(true); $this->creationService->method('createForOrder') - ->with(self::equalTo($orderId)) + ->with($this->equalTo($orderId)) ->willThrowException(new AlreadyExistsException($exceptionMessage)); $this->logger->method('error') - ->with(self::equalTo($exceptionMessage)); + ->with($this->equalTo($exceptionMessage)); $result = $this->placeOrder->execute($this->observer); $this->assertNull($result); @@ -186,9 +186,9 @@ public function testExecute() $this->creationService ->method('createForOrder') - ->with(self::equalTo($orderId)); + ->with($this->equalTo($orderId)); - $this->logger->expects(self::never()) + $this->logger->expects($this->never()) ->method('error'); $this->placeOrder->execute($this->observer); @@ -205,7 +205,7 @@ public function testExecuteWithOrderPendingPayment() ->willReturn(Order::STATE_PENDING_PAYMENT); $this->withAvailablePaymentMethod(true); - $this->creationService->expects(self::never()) + $this->creationService->expects($this->never()) ->method('createForOrder'); $this->placeOrder->execute($this->observer); diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CmsPageTest.php b/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CmsPageTest.php index 7bd43c5fe79ca..4297038742526 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CmsPageTest.php +++ b/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CmsPageTest.php @@ -81,7 +81,7 @@ private function getItemFactoryMock() ->disableOriginalConstructor() ->getMock(); - $itemFactoryMock->expects(self::any()) + $itemFactoryMock->expects($this->any()) ->method('create') ->willReturnCallback(function ($data) { $helper = new ObjectManager($this); @@ -103,7 +103,7 @@ private function getCmsPageFactoryMock($returnValue) ->disableOriginalConstructor() ->getMock(); - $cmsPageFactoryMock->expects(self::any()) + $cmsPageFactoryMock->expects($this->any()) ->method('create') ->willReturn($returnValue); @@ -137,7 +137,7 @@ private function getCmsPageCollectionMock($returnValue) ->disableOriginalConstructor() ->getMock(); - $sitemapCmsPageMock->expects(self::any()) + $sitemapCmsPageMock->expects($this->any()) ->method('getCollection') ->willReturn($returnValue); diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CompositeTest.php b/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CompositeTest.php index a48f756937d92..33e97eca6904f 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CompositeTest.php +++ b/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/CompositeTest.php @@ -29,7 +29,7 @@ public function testGetItems($itemResolverData, $expectedItems) foreach ($itemResolverData as $data) { $mockResolver = $this->getMockForAbstractClass(ItemProviderInterface::class); - $mockResolver->expects(self::once()) + $mockResolver->expects($this->once()) ->method('getItems') ->willReturn($data); diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/ProductTest.php b/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/ProductTest.php index 4b6dd2ac8d2fb..e0dc3e78dded8 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/ProductTest.php +++ b/app/code/Magento/Sitemap/Test/Unit/Model/ItemProvider/ProductTest.php @@ -26,7 +26,7 @@ public function testGetItemsEmpty() $resolver = new ProductItemResolver($configReaderMock, $productFactoryMock, $itemFactoryMock); - self::assertSame([], $resolver->getItems(1)); + $this->assertSame([], $resolver->getItems(1)); } /** @@ -43,13 +43,13 @@ public function testGetItems(array $products) $resolver = new ProductItemResolver($configReaderMock, $productFactoryMock, $itemFactoryMock); $items = $resolver->getItems(1); - self::assertTrue(count($items) == count($products)); + $this->assertTrue(count($items) == count($products)); foreach ($products as $index => $product) { - self::assertSame($product->getUpdatedAt(), $items[$index]->getUpdatedAt()); - self::assertSame('daily', $items[$index]->getChangeFrequency()); - self::assertSame('1.0', $items[$index]->getPriority()); - self::assertSame($product->getImages(), $items[$index]->getImages()); - self::assertSame($product->getUrl(), $items[$index]->getUrl()); + $this->assertSame($product->getUpdatedAt(), $items[$index]->getUpdatedAt()); + $this->assertSame('daily', $items[$index]->getChangeFrequency()); + $this->assertSame('1.0', $items[$index]->getPriority()); + $this->assertSame($product->getImages(), $items[$index]->getImages()); + $this->assertSame($product->getUrl(), $items[$index]->getUrl()); } } diff --git a/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributeCodesTest.php b/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributeCodesTest.php index ab21d5d71b263..30ea117fdb959 100644 --- a/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributeCodesTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributeCodesTest.php @@ -85,7 +85,7 @@ public function testGetCodes($swatchAttributeCodesCache, $expected) ->method('from') ->withConsecutive( [ - self::identicalTo( + $this->identicalTo( ['a' => self::ATTRIBUTE_TABLE], [ 'attribute_id' => 'a.attribute_id', @@ -94,7 +94,7 @@ public function testGetCodes($swatchAttributeCodesCache, $expected) ) ], [ - self::identicalTo( + $this->identicalTo( ['o' => self::ATTRIBUTE_OPTION_TABLE], ['attribute_id' => 'o.attribute_id'] ) @@ -105,8 +105,8 @@ public function testGetCodes($swatchAttributeCodesCache, $expected) // used anything for second argument because of new \Zend_Db_Expt used in code. $selectMock->method('where') ->with( - self::identicalTo('a.attribute_id IN (?)'), - self::anything() + $this->identicalTo('a.attribute_id IN (?)'), + $this->anything() ) ->willReturnSelf(); @@ -126,7 +126,7 @@ public function testGetCodes($swatchAttributeCodesCache, $expected) [self::ATTRIBUTE_TABLE], [self::ATTRIBUTE_OPTION_TABLE], [self::SWATCH_OPTION_TABLE] - )->will(self::onConsecutiveCalls( + )->will($this->onConsecutiveCalls( self::ATTRIBUTE_TABLE, self::ATTRIBUTE_OPTION_TABLE, self::SWATCH_OPTION_TABLE diff --git a/app/code/Magento/Tax/Test/Unit/Plugin/Checkout/CustomerData/CartTest.php b/app/code/Magento/Tax/Test/Unit/Plugin/Checkout/CustomerData/CartTest.php index 88dce330b1535..1d9e5932d5b57 100644 --- a/app/code/Magento/Tax/Test/Unit/Plugin/Checkout/CustomerData/CartTest.php +++ b/app/code/Magento/Tax/Test/Unit/Plugin/Checkout/CustomerData/CartTest.php @@ -101,12 +101,12 @@ public function testAfterGetSectionData() $result = $this->cart->afterGetSectionData($this->checkoutCart, $input); - self::assertArrayHasKey('subtotal_incl_tax', $result); - self::assertArrayHasKey('subtotal_excl_tax', $result); - self::assertArrayHasKey('items', $result); - self::assertTrue(is_array($result['items'])); - self::assertEquals(2, count($result['items'])); - self::assertEquals(1, $result['items'][0]['product_price']); - self::assertEquals(1, $result['items'][1]['product_price']); + $this->assertArrayHasKey('subtotal_incl_tax', $result); + $this->assertArrayHasKey('subtotal_excl_tax', $result); + $this->assertArrayHasKey('items', $result); + $this->assertTrue(is_array($result['items'])); + $this->assertEquals(2, count($result['items'])); + $this->assertEquals(1, $result['items'][0]['product_price']); + $this->assertEquals(1, $result['items'][1]['product_price']); } } diff --git a/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php b/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php index 251408d1d174d..67d3e5e9e324e 100644 --- a/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php +++ b/app/code/Magento/Theme/Test/Unit/CustomerData/MessagesTest.php @@ -46,7 +46,7 @@ public function testGetSectionData() $msg->expects($this->once()) ->method('getType') ->willReturn($msgType); - $this->messageInterpretationStrategy->expects(static::once()) + $this->messageInterpretationStrategy->expects($this->once()) ->method('interpret') ->with($msg) ->willReturn($msgText); diff --git a/app/code/Magento/Theme/Test/Unit/Model/Config/Processor/DesignThemeTest.php b/app/code/Magento/Theme/Test/Unit/Model/Config/Processor/DesignThemeTest.php index db9283c54f2d2..300fff2626228 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Config/Processor/DesignThemeTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Config/Processor/DesignThemeTest.php @@ -67,12 +67,12 @@ private function prepareThemeMock() foreach ($this->themes as $themeId => $themeFullPath) { $themeMock = $this->getMockBuilder(\Magento\Framework\View\Design\ThemeInterface::class) ->getMockForAbstractClass(); - $themeMock->expects(static::any())->method('getId')->willReturn($themeId); + $themeMock->expects($this->any())->method('getId')->willReturn($themeId); $themesMap[] = [$themeFullPath, $themeMock]; } - $this->themeList->expects(static::any())->method('getThemeByFullPath')->willReturnMap($themesMap); + $this->themeList->expects($this->any())->method('getThemeByFullPath')->willReturnMap($themesMap); } /** diff --git a/app/code/Magento/Theme/Test/Unit/Model/Design/Config/Plugin/DumpTest.php b/app/code/Magento/Theme/Test/Unit/Model/Design/Config/Plugin/DumpTest.php index 9c4a220b2e17e..e955bf200f1c2 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Design/Config/Plugin/DumpTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Design/Config/Plugin/DumpTest.php @@ -74,12 +74,12 @@ private function prepareThemeMock() foreach ($this->themes as $themeId => $themeFullPath) { $themeMock = $this->getMockBuilder(\Magento\Framework\View\Design\ThemeInterface::class) ->getMockForAbstractClass(); - $themeMock->expects(static::any())->method('getFullPath')->willReturn($themeFullPath); + $themeMock->expects($this->any())->method('getFullPath')->willReturn($themeFullPath); $themesMap[] = [$themeId, $themeMock]; } - $this->themeList->expects(static::any())->method('getItemById')->willReturnMap($themesMap); + $this->themeList->expects($this->any())->method('getItemById')->willReturnMap($themesMap); } /** diff --git a/app/code/Magento/Ui/Test/Unit/Component/ExportButtonTest.php b/app/code/Magento/Ui/Test/Unit/Component/ExportButtonTest.php index 76749e165e245..65f3fe3507226 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/ExportButtonTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/ExportButtonTest.php @@ -89,8 +89,8 @@ public function testPrepare() ->with('test_url') ->willReturnArgument(1); - self::assertNull($this->model->prepare()); - self::assertEquals( + $this->assertNull($this->model->prepare()); + $this->assertEquals( $expected, $this->model->getData() ); diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 78456968cbef1..4eaae6dd05324 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -73,7 +73,7 @@ protected function setUp() */ public function testGetComponentName() { - $this->contextMock->expects(static::never())->method('getProcessor'); + $this->contextMock->expects($this->never())->method('getProcessor'); $date = new Date( $this->contextMock, $this->uiComponentFactory, @@ -82,7 +82,7 @@ public function testGetComponentName() [] ); - static::assertTrue($date->getComponentName() === Date::NAME); + $this->assertTrue($date->getComponentName() === Date::NAME); } /** @@ -99,7 +99,7 @@ public function testPrepare($name, $filterData, $expectedCondition) $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class) ->disableOriginalConstructor() ->getMock(); - $this->contextMock->expects(static::atLeastOnce())->method('getProcessor')->willReturn($processor); + $this->contextMock->expects($this->atLeastOnce())->method('getProcessor')->willReturn($processor); /** @var FormDate $uiComponent */ $uiComponent = $this->getMockBuilder(FormDate::class) ->disableOriginalConstructor() @@ -156,21 +156,21 @@ public function testPrepare($name, $filterData, $expectedCondition) */ private function getFilterMock($name, $expectedType, $expectedDate, &$i) { - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('setConditionType') ->with($expectedType) ->willReturnSelf(); - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('setField') ->with($name) ->willReturnSelf(); - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('setValue') ->with($expectedDate) ->willReturnSelf(); $filterMock = $this->createMock(Filter::class); - $this->filterBuilderMock->expects(static::at($i++)) + $this->filterBuilderMock->expects($this->at($i++)) ->method('create') ->willReturn($filterMock); @@ -223,7 +223,7 @@ public function getPrepareDataProvider() private function processFilters($name, $filterData, $expectedCondition, $uiComponent) { if (is_string($filterData[$name])) { - $uiComponent->expects(static::once()) + $uiComponent->expects($this->once()) ->method('convertDate') ->with($filterData[$name]) ->willReturn(new \DateTime($filterData[$name])); @@ -248,7 +248,7 @@ private function processFilters($name, $filterData, $expectedCondition, $uiCompo $expectedCondition['date'], $i ); - $this->dataProviderMock->expects(static::once()) + $this->dataProviderMock->expects($this->once()) ->method('addFilter') ->with($filterMock); break; @@ -265,7 +265,7 @@ private function processFilters($name, $filterData, $expectedCondition, $uiCompo $expectedCondition['date_to'], $i ); - $this->dataProviderMock->expects(static::exactly(2)) + $this->dataProviderMock->expects($this->exactly(2)) ->method('addFilter') ->with($filterMock); break; diff --git a/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php index 57b0544182c8d..64da686151791 100644 --- a/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php @@ -155,11 +155,11 @@ public function testCollectRates() $this->scope->method('isSetFlag') ->willReturn(true); - $this->httpClient->expects(self::exactly(2)) + $this->httpClient->expects($this->exactly(2)) ->method('setParameterGet') ->withConsecutive( ['API', 'RateV4'], - ['XML', self::equalTo($expectedXml->asXML())] + ['XML', $this->equalTo($expectedXml->asXML())] ); $this->httpResponse->method('getBody') @@ -168,7 +168,7 @@ public function testCollectRates() $data = require __DIR__ . '/_files/rates_request_data.php'; $request = $this->objectManager->getObject(RateRequest::class, ['data' => $data[0]]); - self::assertNotEmpty($this->carrier->collectRates($request)->getAllRates()); + $this->assertNotEmpty($this->carrier->collectRates($request)->getAllRates()); } public function testCollectRatesWithUnavailableService() @@ -197,7 +197,7 @@ public function testReturnOfShipment() ReturnShipment::class, require __DIR__ . '/_files/return_shipment_request_data.php' ); - $this->httpClient->expects(self::exactly(2)) + $this->httpClient->expects($this->exactly(2)) ->method('setParameterGet') ->withConsecutive( ['API', 'SignatureConfirmationCertifyV3'], diff --git a/app/code/Magento/Vault/Test/Unit/Block/Customer/AccountTokensTest.php b/app/code/Magento/Vault/Test/Unit/Block/Customer/AccountTokensTest.php index 3ca9f1571236e..67dde9552f228 100644 --- a/app/code/Magento/Vault/Test/Unit/Block/Customer/AccountTokensTest.php +++ b/app/code/Magento/Vault/Test/Unit/Block/Customer/AccountTokensTest.php @@ -59,15 +59,15 @@ public function testGetPaymentTokens() $token = $this->objectManager->getObject(PaymentToken::class, [ 'data' => [PaymentTokenInterface::TYPE => AccountPaymentTokenFactory::TOKEN_TYPE_ACCOUNT] ]); - $this->tokenManagement->expects(static::once()) + $this->tokenManagement->expects($this->once()) ->method('getCustomerSessionTokens') ->willReturn([$cardToken, $token]); $actual = $this->block->getPaymentTokens(); - static::assertCount(1, $actual); + $this->assertCount(1, $actual); /** @var PaymentTokenInterface $actualToken */ $actualToken = array_pop($actual); - static::assertEquals(AccountPaymentTokenFactory::TOKEN_TYPE_ACCOUNT, $actualToken->getType()); + $this->assertEquals(AccountPaymentTokenFactory::TOKEN_TYPE_ACCOUNT, $actualToken->getType()); } } diff --git a/app/code/Magento/Vault/Test/Unit/Model/AccountPaymentTokenFactoryTest.php b/app/code/Magento/Vault/Test/Unit/Model/AccountPaymentTokenFactoryTest.php index 1ff94288d6c76..feec17c1491df 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/AccountPaymentTokenFactoryTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/AccountPaymentTokenFactoryTest.php @@ -54,7 +54,7 @@ protected function setUp() */ public function testCreate() { - $this->objectManager->expects(static::once()) + $this->objectManager->expects($this->once()) ->method('create') ->willReturn($this->paymentToken); @@ -62,7 +62,7 @@ public function testCreate() /** @var PaymentTokenInterface $paymentToken */ $paymentToken = $this->factory->create(); - static::assertInstanceOf(PaymentTokenInterface::class, $paymentToken); - static::assertEquals(AccountPaymentTokenFactory::TOKEN_TYPE_ACCOUNT, $paymentToken->getType()); + $this->assertInstanceOf(PaymentTokenInterface::class, $paymentToken); + $this->assertEquals(AccountPaymentTokenFactory::TOKEN_TYPE_ACCOUNT, $paymentToken->getType()); } } diff --git a/app/code/Magento/Vault/Test/Unit/Model/CreditCardTokenFactoryTest.php b/app/code/Magento/Vault/Test/Unit/Model/CreditCardTokenFactoryTest.php index 0ad51f3dcc75d..3ad485825dd86 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/CreditCardTokenFactoryTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/CreditCardTokenFactoryTest.php @@ -54,7 +54,7 @@ protected function setUp() */ public function testCreate() { - $this->objectManager->expects(static::once()) + $this->objectManager->expects($this->once()) ->method('create') ->willReturn($this->paymentToken); @@ -62,7 +62,7 @@ public function testCreate() /** @var PaymentTokenInterface $paymentToken */ $paymentToken = $this->factory->create(); - static::assertInstanceOf(PaymentTokenInterface::class, $paymentToken); - static::assertEquals(CreditCardTokenFactory::TOKEN_TYPE_CREDIT_CARD, $paymentToken->getType()); + $this->assertInstanceOf(PaymentTokenInterface::class, $paymentToken); + $this->assertEquals(CreditCardTokenFactory::TOKEN_TYPE_CREDIT_CARD, $paymentToken->getType()); } } diff --git a/app/code/Magento/Vault/Test/Unit/Model/CustomerTokenManagementTest.php b/app/code/Magento/Vault/Test/Unit/Model/CustomerTokenManagementTest.php index bf895211fe7e2..c2766cfc064a7 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/CustomerTokenManagementTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/CustomerTokenManagementTest.php @@ -53,9 +53,9 @@ public function testGetCustomerSessionTokensNegative($customerId, bool $isLogged { $this->customerSession->method('getCustomerId')->willReturn($customerId); $this->customerSession->method('isLoggedIn')->willReturn($isLoggedCustomer); - $this->paymentTokenManagement->expects(static::never())->method('getVisibleAvailableTokens'); + $this->paymentTokenManagement->expects($this->never())->method('getVisibleAvailableTokens'); - static::assertEquals([], $this->tokenManagement->getCustomerSessionTokens()); + $this->assertEquals([], $this->tokenManagement->getCustomerSessionTokens()); } /** @@ -75,20 +75,20 @@ public function testGetCustomerSessionTokens() $token = $this->createMock(PaymentTokenInterface::class); $expectation = [$token]; - $this->customerSession->expects(static::once()) + $this->customerSession->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $this->customerSession->expects(static::once()) + $this->customerSession->expects($this->once()) ->method('isLoggedIn') ->willReturn(true); - $this->paymentTokenManagement->expects(static::once()) + $this->paymentTokenManagement->expects($this->once()) ->method('getVisibleAvailableTokens') ->with($customerId) ->willReturn($expectation); - static::assertEquals( + $this->assertEquals( $expectation, $this->tokenManagement->getCustomerSessionTokens() ); diff --git a/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php b/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php index 00ec485b15692..c6662c616435a 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php @@ -70,7 +70,7 @@ public function testAuthorizeNoTokenMetadata(array $additionalInfo) ->disableOriginalConstructor() ->getMock(); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('getAdditionalInformation') ->willReturn($additionalInfo); @@ -106,7 +106,7 @@ public function testAuthorizeNoToken() ->getMock(); $tokenManagement = $this->createMock(PaymentTokenManagementInterface::class); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('getAdditionalInformation') ->willReturn( [ @@ -114,7 +114,7 @@ public function testAuthorizeNoToken() PaymentTokenInterface::PUBLIC_HASH => $publicHash ] ); - $tokenManagement->expects(static::once()) + $tokenManagement->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn(null); @@ -149,7 +149,7 @@ public function testAuthorize() $tokenManagement = $this->createMock(PaymentTokenManagementInterface::class); $token = $this->createMock(PaymentTokenInterface::class); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('getAdditionalInformation') ->willReturn( [ @@ -157,25 +157,25 @@ public function testAuthorize() PaymentTokenInterface::PUBLIC_HASH => $publicHash ] ); - $tokenManagement->expects(static::once()) + $tokenManagement->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn($token); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('getExtensionAttributes') ->willReturn($extensionAttributes); - $extensionAttributes->expects(static::once()) + $extensionAttributes->expects($this->once()) ->method('setVaultPaymentToken') ->with($token); - $this->vaultProvider->expects(static::atLeastOnce()) + $this->vaultProvider->expects($this->atLeastOnce()) ->method('getCode') ->willReturn($vaultProviderCode); - $commandManagerPool->expects(static::once()) + $commandManagerPool->expects($this->once()) ->method('get') ->with($vaultProviderCode) ->willReturn($commandManager); - $commandManager->expects(static::once()) + $commandManager->expects($this->once()) ->method('executeByCode') ->with( VaultPaymentInterface::VAULT_AUTHORIZE_COMMAND, @@ -185,7 +185,7 @@ public function testAuthorize() ] ); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('setMethod') ->with($vaultProviderCode); @@ -225,7 +225,7 @@ public function testCapture() ->getMock(); $authorizationTransaction = $this->createMock(TransactionInterface::class); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('getAuthorizationTransaction') ->willReturn($authorizationTransaction); @@ -244,17 +244,17 @@ public function testIsAvailable($isAvailableProvider, $isActive, $expected) $quote = $this->getMockForAbstractClass(CartInterface::class); $config = $this->getMockForAbstractClass(ConfigInterface::class); - $this->vaultProvider->expects(static::once()) + $this->vaultProvider->expects($this->once()) ->method('isAvailable') ->with($quote) ->willReturn($isAvailableProvider); - $config->expects(static::any()) + $config->expects($this->any()) ->method('getValue') ->with('active', $storeId) ->willReturn($isActive); - $quote->expects(static::any()) + $quote->expects($this->any()) ->method('getStoreId') ->willReturn($storeId); @@ -264,7 +264,7 @@ public function testIsAvailable($isAvailableProvider, $isActive, $expected) 'vaultProvider' => $this->vaultProvider ]); $actual = $model->isAvailable($quote); - static::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -289,12 +289,12 @@ public function testIsAvailableWithoutQuote() $quote = null; $config = $this->getMockForAbstractClass(ConfigInterface::class); - $this->vaultProvider->expects(static::once()) + $this->vaultProvider->expects($this->once()) ->method('isAvailable') ->with($quote) ->willReturn(true); - $config->expects(static::once()) + $config->expects($this->once()) ->method('getValue') ->with('active', $quote) ->willReturn(false); @@ -304,7 +304,7 @@ public function testIsAvailableWithoutQuote() 'config' => $config, 'vaultProvider' => $this->vaultProvider ]); - static::assertFalse($model->isAvailable($quote)); + $this->assertFalse($model->isAvailable($quote)); } /** @@ -319,17 +319,17 @@ public function testCanUseInternal($configValue, $paymentValue, $expected) $handlerPool = $this->createMock(ValueHandlerPoolInterface::class); $handler = $this->createMock(ValueHandlerInterface::class); - $handlerPool->expects(static::once()) + $handlerPool->expects($this->once()) ->method('get') ->with('can_use_internal') ->willReturn($handler); - $handler->expects(static::once()) + $handler->expects($this->once()) ->method('handle') ->with(['field' => 'can_use_internal'], null) ->willReturn($configValue); - $this->vaultProvider->expects(static::any()) + $this->vaultProvider->expects($this->any()) ->method('canUseInternal') ->willReturn($paymentValue); @@ -338,7 +338,7 @@ public function testCanUseInternal($configValue, $paymentValue, $expected) 'vaultProvider' => $this->vaultProvider, 'valueHandlerPool' => $handlerPool, ]); - static::assertEquals($expected, $model->canUseInternal()); + $this->assertEquals($expected, $model->canUseInternal()); } /** diff --git a/app/code/Magento/Vault/Test/Unit/Model/PaymentMethodListTest.php b/app/code/Magento/Vault/Test/Unit/Model/PaymentMethodListTest.php index 4db9f695dad5d..66863bd0ed7ba 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/PaymentMethodListTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/PaymentMethodListTest.php @@ -55,12 +55,12 @@ public function testGetActivePaymentList() $paymentMethodInterface2 ]; - $this->paymentMethodList->expects(static::once()) + $this->paymentMethodList->expects($this->once()) ->method('getActiveList') ->with($storeId) ->willReturn($activePayments); - $this->instanceFactory->expects(static::exactly(2)) + $this->instanceFactory->expects($this->exactly(2)) ->method('create') ->willReturnMap([ [$paymentMethodInterface1, $this->createMock(MethodInterface::class)], @@ -68,7 +68,7 @@ public function testGetActivePaymentList() ]); $vaultPayments = $this->vaultPaymentList->getActiveList($storeId); - static::assertCount(1, $vaultPayments); - static::assertInstanceOf(VaultPaymentInterface::class, $vaultPayment); + $this->assertCount(1, $vaultPayments); + $this->assertInstanceOf(VaultPaymentInterface::class, $vaultPayment); } } diff --git a/app/code/Magento/Vault/Test/Unit/Model/PaymentTokenManagementTest.php b/app/code/Magento/Vault/Test/Unit/Model/PaymentTokenManagementTest.php index 39cefb519dabd..714c0c8edc2e6 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/PaymentTokenManagementTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/PaymentTokenManagementTest.php @@ -141,36 +141,36 @@ public function testGetListByCustomerId() $searchResult = $this->getMockBuilder(PaymentTokenSearchResultsInterface::class) ->getMockForAbstractClass(); - $this->filterBuilder->expects(self::once()) + $this->filterBuilder->expects($this->once()) ->method('setField') ->with(PaymentTokenInterface::CUSTOMER_ID) ->willReturnSelf(); - $this->filterBuilder->expects(self::once()) + $this->filterBuilder->expects($this->once()) ->method('setValue') ->with(1) ->willReturnSelf(); - $this->filterBuilder->expects(self::once()) + $this->filterBuilder->expects($this->once()) ->method('create') ->willReturn($filterMock); - $this->searchCriteriaBuilder->expects(self::once()) + $this->searchCriteriaBuilder->expects($this->once()) ->method('addFilters') ->with([$filterMock]) ->willReturnSelf(); - $this->searchCriteriaBuilder->expects(self::once()) + $this->searchCriteriaBuilder->expects($this->once()) ->method('create') ->willReturn($searchCriteria); - $this->paymentTokenRepository->expects(self::once()) + $this->paymentTokenRepository->expects($this->once()) ->method('getList') ->with($searchCriteria) ->willReturn($searchResult); - $searchResult->expects(self::once()) + $searchResult->expects($this->once()) ->method('getItems') ->willReturn([$tokenMock]); - self::assertEquals([$tokenMock], $this->paymentTokenManagement->getListByCustomerId(1)); + $this->assertEquals([$tokenMock], $this->paymentTokenManagement->getListByCustomerId(1)); } /** @@ -182,17 +182,17 @@ public function testGetByPaymentId() $tokenMock = $this->getMockBuilder(PaymentTokenInterface::class) ->getMockForAbstractClass(); - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByOrderPaymentId') ->with(1) ->willReturn(['token-data']); - $this->paymentTokenFactory->expects(self::once()) + $this->paymentTokenFactory->expects($this->once()) ->method('create') ->with(['data' => ['token-data']]) ->willReturn($tokenMock); - self::assertEquals($tokenMock, $this->paymentTokenManagement->getByPaymentId(1)); + $this->assertEquals($tokenMock, $this->paymentTokenManagement->getByPaymentId(1)); } /** @@ -200,15 +200,15 @@ public function testGetByPaymentId() */ public function testGetByPaymentIdNull() { - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByOrderPaymentId') ->with(1) ->willReturn([]); - $this->paymentTokenFactory->expects(self::never()) + $this->paymentTokenFactory->expects($this->never()) ->method('create'); - self::assertEquals(null, $this->paymentTokenManagement->getByPaymentId(1)); + $this->assertEquals(null, $this->paymentTokenManagement->getByPaymentId(1)); } /** @@ -220,17 +220,17 @@ public function testGetByGatewayToken() $tokenMock = $this->getMockBuilder(PaymentTokenInterface::class) ->getMockForAbstractClass(); - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByGatewayToken') ->with('token', 1, 1) ->willReturn(['token-data']); - $this->paymentTokenFactory->expects(self::once()) + $this->paymentTokenFactory->expects($this->once()) ->method('create') ->with(['data' => ['token-data']]) ->willReturn($tokenMock); - self::assertEquals($tokenMock, $this->paymentTokenManagement->getByGatewayToken('token', 1, 1)); + $this->assertEquals($tokenMock, $this->paymentTokenManagement->getByGatewayToken('token', 1, 1)); } /** @@ -238,15 +238,15 @@ public function testGetByGatewayToken() */ public function testGetByGatewayTokenNull() { - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByGatewayToken') ->with('some-not-exists-token', 1, 1) ->willReturn([]); - $this->paymentTokenFactory->expects(self::never()) + $this->paymentTokenFactory->expects($this->never()) ->method('create'); - self::assertEquals(null, $this->paymentTokenManagement->getByGatewayToken('some-not-exists-token', 1, 1)); + $this->assertEquals(null, $this->paymentTokenManagement->getByGatewayToken('some-not-exists-token', 1, 1)); } /** @@ -254,15 +254,15 @@ public function testGetByGatewayTokenNull() */ public function testGetByPublicHash() { - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByPublicHash') ->with('some-not-exists-token', 1) ->willReturn([]); - $this->paymentTokenFactory->expects(self::never()) + $this->paymentTokenFactory->expects($this->never()) ->method('create'); - self::assertEquals(null, $this->paymentTokenManagement->getByPublicHash('some-not-exists-token', 1)); + $this->assertEquals(null, $this->paymentTokenManagement->getByPublicHash('some-not-exists-token', 1)); } /** @@ -280,33 +280,33 @@ public function testSaveTokenWithPaymentLinkNoDuplicate() $publicHash = 'some-not-existing-token'; $paymentId = 1; - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getPublicHash') ->willReturn($publicHash); - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, 1) ->willReturn([]); - $this->paymentTokenFactory->expects(self::never()) + $this->paymentTokenFactory->expects($this->never()) ->method('create'); - $tokenMock->expects(self::once()) + $tokenMock->expects($this->once()) ->method('getEntityId') ->willReturn($entityId); - $this->paymentTokenRepository->expects(self::once()) + $this->paymentTokenRepository->expects($this->once()) ->method('save') ->with($tokenMock); - $paymentMock->expects(self::once()) + $paymentMock->expects($this->once()) ->method('getEntityId') ->willReturn($paymentId); - $this->paymentTokenResourceModel->expects(static::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('addLinkToOrderPayment') ->with($entityId, $paymentId); @@ -333,40 +333,40 @@ public function testSaveTokenWithPaymentLinkWithDuplicateTokenVisible() 'entity_id' => $entityId ]; - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getPublicHash') ->willReturn($publicHash); - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn($duplicateTokenData); - $this->paymentTokenFactory->expects(self::once()) + $this->paymentTokenFactory->expects($this->once()) ->method('create') ->with(['data' => $duplicateTokenData]) ->willReturn($duplicateToken); - $tokenMock->expects(static::once()) + $tokenMock->expects($this->once()) ->method('getIsVisible') ->willReturn(true); - $duplicateToken->expects(static::once()) + $duplicateToken->expects($this->once()) ->method('getEntityId') ->willReturn($entityId); - $tokenMock->expects(self::once()) + $tokenMock->expects($this->once()) ->method('getEntityId') ->willReturn($entityId); - $this->paymentTokenRepository->expects(self::once()) + $this->paymentTokenRepository->expects($this->once()) ->method('save') ->with($tokenMock); - $paymentMock->expects(self::once()) + $paymentMock->expects($this->once()) ->method('getEntityId') ->willReturn($paymentId); - $this->paymentTokenResourceModel->expects(static::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('addLinkToOrderPayment') ->with($entityId, $paymentId); @@ -396,51 +396,51 @@ public function testSaveTokenWithPaymentLinkWithDuplicateTokenNotVisible() ]; $newHash = 'new-token2'; - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getPublicHash') ->willReturn($publicHash); - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); - $this->paymentTokenResourceModel->expects(self::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn($duplicateTokenData); - $this->paymentTokenFactory->expects(self::once()) + $this->paymentTokenFactory->expects($this->once()) ->method('create') ->with(['data' => $duplicateTokenData]) ->willReturn($duplicateToken); - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getIsVisible') ->willReturn(false); - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getCustomerId') ->willReturn($customerId); - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getGatewayToken') ->willReturn($gatewayToken); - $this->encryptor->expects(static::once()) + $this->encryptor->expects($this->once()) ->method('getHash') ->with($publicHash . $gatewayToken) ->willReturn($newHash); - $tokenMock->expects(static::once()) + $tokenMock->expects($this->once()) ->method('setPublicHash') ->with($newHash); - $this->paymentTokenRepository->expects(self::once()) + $this->paymentTokenRepository->expects($this->once()) ->method('save') ->with($tokenMock); - $tokenMock->expects(static::atLeastOnce()) + $tokenMock->expects($this->atLeastOnce()) ->method('getEntityId') ->willReturn($newEntityId); - $paymentMock->expects(self::atLeastOnce()) + $paymentMock->expects($this->atLeastOnce()) ->method('getEntityId') ->willReturn($paymentId); - $this->paymentTokenResourceModel->expects(static::once()) + $this->paymentTokenResourceModel->expects($this->once()) ->method('addLinkToOrderPayment') ->with($newEntityId, $paymentId); @@ -467,7 +467,7 @@ public function testGetVisibleAvailableTokens() '2015-01-01 00:00:00', 3 ); - $this->filterBuilder->expects(static::once()) + $this->filterBuilder->expects($this->once()) ->method('setConditionType') ->with('gt') ->willReturnSelf(); @@ -475,34 +475,34 @@ public function testGetVisibleAvailableTokens() $date = $this->getMockBuilder(\DateTime::class) ->disableOriginalConstructor() ->getMock(); - $this->dateTimeFactory->expects(static::once()) + $this->dateTimeFactory->expects($this->once()) ->method('create') ->with("now", new \DateTimeZone('UTC')) ->willReturn($date); - $date->expects(static::once()) + $date->expects($this->once()) ->method('format') ->with('Y-m-d 00:00:00') ->willReturn('2015-01-01 00:00:00'); - $this->searchCriteriaBuilder->expects(self::exactly(4)) + $this->searchCriteriaBuilder->expects($this->exactly(4)) ->method('addFilters') ->withConsecutive($customerFilter, $visibilityFilter, $isActiveFilter, $expiresAtFilter) ->willReturnSelf(); - $this->searchCriteriaBuilder->expects(self::once()) + $this->searchCriteriaBuilder->expects($this->once()) ->method('create') ->willReturn($searchCriteria); - $this->paymentTokenRepository->expects(self::once()) + $this->paymentTokenRepository->expects($this->once()) ->method('getList') ->with($searchCriteria) ->willReturn($searchResult); - $searchResult->expects(self::once()) + $searchResult->expects($this->once()) ->method('getItems') ->willReturn([$token]); - static::assertEquals( + $this->assertEquals( [$token], $this->paymentTokenManagement->getVisibleAvailableTokens($customerId) ); diff --git a/app/code/Magento/Vault/Test/Unit/Model/Ui/Adminhtml/TokensConfigProviderTest.php b/app/code/Magento/Vault/Test/Unit/Model/Ui/Adminhtml/TokensConfigProviderTest.php index e510e0928bd35..bc8d3c3b7a842 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/Ui/Adminhtml/TokensConfigProviderTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/Ui/Adminhtml/TokensConfigProviderTest.php @@ -189,20 +189,20 @@ public function testGetTokensComponentsRegisteredCustomer() { $customerId = 1; - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $this->paymentDataHelper->expects(static::once()) + $this->paymentDataHelper->expects($this->once()) ->method('getMethodInstance') ->with(self::VAULT_PAYMENT_CODE) ->willReturn($this->vaultPayment); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('isActive') ->with(self::STORE_ID) ->willReturn(true); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('getProviderCode') ->willReturn(self::VAULT_PROVIDER_CODE); @@ -217,27 +217,27 @@ public function testGetTokensComponentsRegisteredCustomer() $date = $this->getMockBuilder(\DateTime::class) ->disableOriginalConstructor() ->getMock(); - $this->dateTimeFactory->expects(static::once()) + $this->dateTimeFactory->expects($this->once()) ->method('create') ->with("now", new \DateTimeZone('UTC')) ->willReturn($date); - $date->expects(static::once()) + $date->expects($this->once()) ->method('format') ->with('Y-m-d 00:00:00') ->willReturn('2015-01-01 00:00:00'); $searchResult = $this->getMockBuilder(PaymentTokenSearchResultsInterface::class) ->getMockForAbstractClass(); - $this->paymentTokenRepository->expects(self::once()) + $this->paymentTokenRepository->expects($this->once()) ->method('getList') ->with($searchCriteria) ->willReturn($searchResult); - $searchResult->expects(self::once()) + $searchResult->expects($this->once()) ->method('getItems') ->willReturn([$token]); - static::assertEquals([$tokenUiComponent], $this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); + $this->assertEquals([$tokenUiComponent], $this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); } /** @@ -249,20 +249,20 @@ public function testGetTokensComponentsGuestCustomer() $this->initStoreMock(); - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $this->paymentDataHelper->expects(static::once()) + $this->paymentDataHelper->expects($this->once()) ->method('getMethodInstance') ->with(self::VAULT_PAYMENT_CODE) ->willReturn($this->vaultPayment); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('isActive') ->with(self::STORE_ID) ->willReturn(true); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('getProviderCode') ->willReturn(self::VAULT_PROVIDER_CODE); @@ -270,18 +270,18 @@ public function testGetTokensComponentsGuestCustomer() $token = $this->getMockBuilder(PaymentTokenInterface::class) ->getMockForAbstractClass(); - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getReordered') ->willReturn(self::ORDER_ID); - $this->orderRepository->expects(static::once()) + $this->orderRepository->expects($this->once()) ->method('get') ->with(self::ORDER_ID) ->willReturn($this->getOrderMock()); - $this->paymentTokenManagement->expects(static::once()) + $this->paymentTokenManagement->expects($this->once()) ->method('getByPaymentId') ->with(self::ORDER_PAYMENT_ENTITY_ID) ->willReturn($token); - $token->expects(static::once()) + $token->expects($this->once()) ->method('getEntityId') ->willReturn(self::ENTITY_ID); @@ -292,27 +292,27 @@ public function testGetTokensComponentsGuestCustomer() $date = $this->getMockBuilder('DateTime') ->disableOriginalConstructor() ->getMock(); - $this->dateTimeFactory->expects(static::once()) + $this->dateTimeFactory->expects($this->once()) ->method('create') ->with("now", new \DateTimeZone('UTC')) ->willReturn($date); - $date->expects(static::once()) + $date->expects($this->once()) ->method('format') ->with('Y-m-d 00:00:00') ->willReturn('2015-01-01 00:00:00'); $searchResult = $this->getMockBuilder(PaymentTokenSearchResultsInterface::class) ->getMockForAbstractClass(); - $this->paymentTokenRepository->expects(self::once()) + $this->paymentTokenRepository->expects($this->once()) ->method('getList') ->with($searchCriteria) ->willReturn($searchResult); - $searchResult->expects(self::once()) + $searchResult->expects($this->once()) ->method('getItems') ->willReturn([$token]); - static::assertEquals([$tokenUiComponent], $this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); + $this->assertEquals([$tokenUiComponent], $this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); } /** @@ -324,41 +324,41 @@ public function testGetTokensComponentsGuestCustomerOrderNotFound($exception) { $customerId = null; - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $this->paymentDataHelper->expects(static::once()) + $this->paymentDataHelper->expects($this->once()) ->method('getMethodInstance') ->with(self::VAULT_PAYMENT_CODE) ->willReturn($this->vaultPayment); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('isActive') ->with(self::STORE_ID) ->willReturn(true); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('getProviderCode') ->willReturn(self::VAULT_PROVIDER_CODE); - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getReordered') ->willReturn(self::ORDER_ID); - $this->orderRepository->expects(static::once()) + $this->orderRepository->expects($this->once()) ->method('get') ->with(self::ORDER_ID) ->willThrowException($exception); - $this->filterBuilder->expects(static::once()) + $this->filterBuilder->expects($this->once()) ->method('setField') ->with(PaymentTokenInterface::ENTITY_ID) ->willReturnSelf(); - $this->filterBuilder->expects(static::never()) + $this->filterBuilder->expects($this->never()) ->method('setValue'); - $this->searchCriteriaBuilder->expects(self::never()) + $this->searchCriteriaBuilder->expects($this->never()) ->method('addFilters'); - static::assertEmpty($this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); + $this->assertEmpty($this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); } /** @@ -380,23 +380,23 @@ public function testGetTokensComponentsEmptyComponentProvider() { $customerId = 1; - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); $this->initStoreMock(); - $this->paymentDataHelper->expects(static::once()) + $this->paymentDataHelper->expects($this->once()) ->method('getMethodInstance') ->with(self::VAULT_PAYMENT_CODE) ->willReturn($this->vaultPayment); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('isActive') ->with(self::STORE_ID) ->willReturn(false); - $this->paymentTokenRepository->expects(static::never()) + $this->paymentTokenRepository->expects($this->never()) ->method('getList'); $configProvider = new TokensConfigProvider( @@ -414,7 +414,7 @@ public function testGetTokensComponentsEmptyComponentProvider() $this->paymentDataHelper ); - static::assertEmpty($configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); + $this->assertEmpty($configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); } /** @@ -422,47 +422,47 @@ public function testGetTokensComponentsEmptyComponentProvider() */ public function testGetTokensComponentsForGuestCustomerWithoutStoredTokens() { - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getCustomerId') ->willReturn(null); - $this->paymentDataHelper->expects(static::once()) + $this->paymentDataHelper->expects($this->once()) ->method('getMethodInstance') ->with(self::VAULT_PAYMENT_CODE) ->willReturn($this->vaultPayment); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('isActive') ->with(self::STORE_ID) ->willReturn(true); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('getProviderCode') ->willReturn(self::VAULT_PROVIDER_CODE); - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getReordered') ->willReturn(self::ORDER_ID); - $this->orderRepository->expects(static::once()) + $this->orderRepository->expects($this->once()) ->method('get') ->with(self::ORDER_ID) ->willReturn($this->getOrderMock()); - $this->paymentTokenManagement->expects(static::once()) + $this->paymentTokenManagement->expects($this->once()) ->method('getByPaymentId') ->with(self::ORDER_PAYMENT_ENTITY_ID) ->willReturn(null); - $this->filterBuilder->expects(static::once()) + $this->filterBuilder->expects($this->once()) ->method('setField') ->with(PaymentTokenInterface::ENTITY_ID) ->willReturnSelf(); - $this->filterBuilder->expects(static::never()) + $this->filterBuilder->expects($this->never()) ->method('setValue'); - $this->searchCriteriaBuilder->expects(static::never()) + $this->searchCriteriaBuilder->expects($this->never()) ->method('addFilters'); - static::assertEmpty($this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); + $this->assertEmpty($this->configProvider->getTokensComponents(self::VAULT_PAYMENT_CODE)); } /** @@ -471,12 +471,12 @@ public function testGetTokensComponentsForGuestCustomerWithoutStoredTokens() private function initStoreMock() { $this->store = $this->createMock(StoreInterface::class); - $this->store->expects(static::any()) + $this->store->expects($this->any()) ->method('getId') ->willReturn(self::STORE_ID); $this->storeManager = $this->createMock(StoreManagerInterface::class); - $this->storeManager->expects(static::any()) + $this->storeManager->expects($this->any()) ->method('getStore') ->with(null) ->willReturn($this->store); @@ -495,10 +495,10 @@ private function getOrderMock() $orderPayment = $this->getMockBuilder(OrderPaymentInterface::class) ->getMockForAbstractClass(); - $order->expects(static::once()) + $order->expects($this->once()) ->method('getPayment') ->willReturn($orderPayment); - $orderPayment->expects(static::once()) + $orderPayment->expects($this->once()) ->method('getEntityId') ->willReturn(self::ORDER_PAYMENT_ENTITY_ID); @@ -513,7 +513,7 @@ private function getOrderMock() private function getTokenUiComponentProvider($token) { $tokenUiComponent = $this->createMock(TokenUiComponentInterface::class); - $this->tokenComponentProvider->expects(static::once()) + $this->tokenComponentProvider->expects($this->once()) ->method('getComponentForToken') ->with($token) ->willReturn($tokenUiComponent); @@ -577,12 +577,12 @@ private function getSearchCriteria($customerId, $entityId, $vaultProviderCode) '2015-01-01 00:00:00', 3 ); - $this->filterBuilder->expects(static::once()) + $this->filterBuilder->expects($this->once()) ->method('setConditionType') ->with('gt') ->willReturnSelf(); - $this->searchCriteriaBuilder->expects(self::exactly(4)) + $this->searchCriteriaBuilder->expects($this->exactly(4)) ->method('addFilters') ->willReturnMap( [ @@ -593,7 +593,7 @@ private function getSearchCriteria($customerId, $entityId, $vaultProviderCode) ] ); - $this->searchCriteriaBuilder->expects(self::once()) + $this->searchCriteriaBuilder->expects($this->once()) ->method('create') ->willReturn($searchCriteria); diff --git a/app/code/Magento/Vault/Test/Unit/Model/Ui/TokensConfigProviderTest.php b/app/code/Magento/Vault/Test/Unit/Model/Ui/TokensConfigProviderTest.php index 4251ff18e42aa..a38fa6773fa2a 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/Ui/TokensConfigProviderTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/Ui/TokensConfigProviderTest.php @@ -89,38 +89,38 @@ public function testGetConfig() $tokenUiComponentProvider = $this->getMockForAbstractClass(TokenUiComponentProviderInterface::class); $tokenUiComponent = $this->getMockForAbstractClass(TokenUiComponentInterface::class); - $this->storeManager->expects(static::once()) + $this->storeManager->expects($this->once()) ->method('getStore') ->willReturn($this->store); - $this->store->expects(static::once()) + $this->store->expects($this->once()) ->method('getId') ->willReturn($storeId); - $this->vaultPaymentList->expects(static::once()) + $this->vaultPaymentList->expects($this->once()) ->method('getActiveList') ->with($storeId) ->willReturn([$this->vaultPayment]); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('getProviderCode') ->willReturn($vaultProviderCode); - $this->customerTokenManagement->expects(static::once()) + $this->customerTokenManagement->expects($this->once()) ->method('getCustomerSessionTokens') ->willReturn([$token]); - $token->expects(static::once()) + $token->expects($this->once()) ->method('getPaymentMethodCode') ->willReturn($vaultProviderCode); - $tokenUiComponentProvider->expects(static::once()) + $tokenUiComponentProvider->expects($this->once()) ->method('getComponentForToken') ->with($token) ->willReturn($tokenUiComponent); - $tokenUiComponent->expects(static::once()) + $tokenUiComponent->expects($this->once()) ->method('getConfig') ->willReturn(['token_code' => 'code']); - $tokenUiComponent->expects(static::once()) + $tokenUiComponent->expects($this->once()) ->method('getName') ->willReturn('Vendor_Module/js/vault_component'); @@ -137,6 +137,6 @@ public function testGetConfig() $this->vaultPaymentList ); - static::assertEquals($expectedConfig, $configProvider->getConfig()); + $this->assertEquals($expectedConfig, $configProvider->getConfig()); } } diff --git a/app/code/Magento/Vault/Test/Unit/Model/Ui/VaultConfigProviderTest.php b/app/code/Magento/Vault/Test/Unit/Model/Ui/VaultConfigProviderTest.php index b0339d004e315..5454c3468097b 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/Ui/VaultConfigProviderTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/Ui/VaultConfigProviderTest.php @@ -86,29 +86,29 @@ public function testGetConfig($customerId, $vaultEnabled) ] ]; - $this->session->expects(static::once()) + $this->session->expects($this->once()) ->method('getCustomerId') ->willReturn($customerId); - $this->storeManager->expects(static::once()) + $this->storeManager->expects($this->once()) ->method('getStore') ->willReturn($this->store); - $this->store->expects(static::once()) + $this->store->expects($this->once()) ->method('getId') ->willReturn($storeId); - $this->vaultPaymentList->expects(static::once()) + $this->vaultPaymentList->expects($this->once()) ->method('getActiveList') ->willReturn([$this->vaultPayment]); - $this->vaultPayment->expects(static::once()) + $this->vaultPayment->expects($this->once()) ->method('getCode') ->willReturn($vaultPaymentCode); - $this->vaultPayment->expects($customerId !== null ? static::once() : static::never()) + $this->vaultPayment->expects($customerId !== null ? $this->once() : $this->never()) ->method('isActive') ->with($storeId) ->willReturn($vaultEnabled); - static::assertEquals($expectedConfiguration, $this->vaultConfigProvider->getConfig()); + $this->assertEquals($expectedConfiguration, $this->vaultConfigProvider->getConfig()); } /** diff --git a/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php b/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php index 09c17d1e58d98..04603bdc0d759 100644 --- a/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php +++ b/app/code/Magento/Vault/Test/Unit/Observer/AfterPaymentSaveObserverTest.php @@ -151,13 +151,13 @@ public function testPositiveCase($customerId, $createdAt, $token, $isActive, $me ->with($this->paymentTokenMock); } - static::assertSame($this->observer, $this->observer->execute($this->eventObserverArgMock)); + $this->assertSame($this->observer, $this->observer->execute($this->eventObserverArgMock)); $paymentToken = $this->salesOrderPaymentMock->getExtensionAttributes()->getVaultPaymentToken(); - static::assertSame($paymentToken, $this->paymentTokenMock); - static::assertEquals($token, $paymentToken->getGatewayToken()); - static::assertEquals($isActive, $paymentToken->getIsActive()); - static::assertEquals($createdAt, $paymentToken->getCreatedAt()); + $this->assertSame($paymentToken, $this->paymentTokenMock); + $this->assertEquals($token, $paymentToken->getGatewayToken()); + $this->assertEquals($isActive, $paymentToken->getIsActive()); + $this->assertEquals($createdAt, $paymentToken->getCreatedAt()); } /** diff --git a/app/code/Magento/Vault/Test/Unit/Observer/PaymentTokenAssignerTest.php b/app/code/Magento/Vault/Test/Unit/Observer/PaymentTokenAssignerTest.php index 1644d90e0731b..6c5f8ade425e6 100644 --- a/app/code/Magento/Vault/Test/Unit/Observer/PaymentTokenAssignerTest.php +++ b/app/code/Magento/Vault/Test/Unit/Observer/PaymentTokenAssignerTest.php @@ -50,7 +50,7 @@ public function testExecuteNoPublicHash() ] ); - $this->paymentTokenManagement->expects(static::never()) + $this->paymentTokenManagement->expects($this->never()) ->method('getByPublicHash'); $this->observer->execute($observer); } @@ -73,7 +73,7 @@ public function testExecuteNotOrderPaymentModel() ] ); - $this->paymentTokenManagement->expects(static::never()) + $this->paymentTokenManagement->expects($this->never()) ->method('getByPublicHash'); $this->observer->execute($observer); } @@ -96,17 +96,17 @@ public function testExecuteNoPaymentToken() $quote = $this->createMock(CartInterface::class); $customer = $this->createMock(CustomerInterface::class); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('getQuote') ->willReturn($quote); - $quote->expects(static::once()) + $quote->expects($this->once()) ->method('getCustomer') ->willReturn($customer); - $customer->expects(static::once()) + $customer->expects($this->once()) ->method('getId') ->willReturn($customerId); - $this->paymentTokenManagement->expects(static::once()) + $this->paymentTokenManagement->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn(null); @@ -118,7 +118,7 @@ public function testExecuteNoPaymentToken() ] ); - $paymentModel->expects(static::never()) + $paymentModel->expects($this->never()) ->method('setAdditionalInformation'); $this->observer->execute($observer); @@ -143,22 +143,22 @@ public function testExecuteSaveMetadata() $customer = $this->createMock(CustomerInterface::class); $paymentToken = $this->createMock(PaymentTokenInterface::class); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('getQuote') ->willReturn($quote); - $quote->expects(static::once()) + $quote->expects($this->once()) ->method('getCustomer') ->willReturn($customer); - $customer->expects(static::once()) + $customer->expects($this->once()) ->method('getId') ->willReturn($customerId); - $this->paymentTokenManagement->expects(static::once()) + $this->paymentTokenManagement->expects($this->once()) ->method('getByPublicHash') ->with($publicHash, $customerId) ->willReturn($paymentToken); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('setAdditionalInformation') ->with( [ @@ -190,10 +190,10 @@ private function getPreparedObserverWithMap(array $returnMap) ->disableOriginalConstructor() ->getMock(); - $observer->expects(static::atLeastOnce()) + $observer->expects($this->atLeastOnce()) ->method('getEvent') ->willReturn($event); - $event->expects(static::atLeastOnce()) + $event->expects($this->atLeastOnce()) ->method('getDataByKey') ->willReturnMap( $returnMap diff --git a/app/code/Magento/Vault/Test/Unit/Observer/VaultEnableAssignerTest.php b/app/code/Magento/Vault/Test/Unit/Observer/VaultEnableAssignerTest.php index 7bfbf36c82c8b..4e7a3e4d5d27d 100644 --- a/app/code/Magento/Vault/Test/Unit/Observer/VaultEnableAssignerTest.php +++ b/app/code/Magento/Vault/Test/Unit/Observer/VaultEnableAssignerTest.php @@ -47,7 +47,7 @@ public function testExecute($activeCode, $expectedBool) ); $paymentModel = $this->createMock(InfoInterface::class); - $paymentModel->expects(static::once()) + $paymentModel->expects($this->once()) ->method('setAdditionalInformation') ->with( VaultConfigProvider::IS_ACTIVE_CODE, @@ -90,7 +90,7 @@ public function testExecuteNever() ); $paymentModel = $this->createMock(InfoInterface::class); - $paymentModel->expects(static::never()) + $paymentModel->expects($this->never()) ->method('setAdditionalInformation'); $observer = $this->getPreparedObserverWithMap( @@ -118,10 +118,10 @@ private function getPreparedObserverWithMap(array $returnMap) ->disableOriginalConstructor() ->getMock(); - $observer->expects(static::atLeastOnce()) + $observer->expects($this->atLeastOnce()) ->method('getEvent') ->willReturn($event); - $event->expects(static::atLeastOnce()) + $event->expects($this->atLeastOnce()) ->method('getDataByKey') ->willReturnMap( $returnMap diff --git a/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php b/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php index aa3b956e12153..49bf7c0ca86fb 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Plugin/Ui/DataProvider/WishlistSettingsTest.php @@ -54,6 +54,6 @@ public function testAfterGetData() $expected = ['allowWishlist' => $isAllow]; $actual = $this->wishlistSettings->afterGetData($subjectMock, $result); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php index 3e935e1d7ae9b..97d37fcc30af6 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php @@ -714,14 +714,14 @@ public function testUpdateWithExtensionAttributes(): void ]; $response = $this->updateProduct($productData); - self::assertArrayHasKey(ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY, $response); - self::assertArrayHasKey($linksKey, $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]); - self::assertCount(1, $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY][$linksKey]); + $this->assertArrayHasKey(ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY, $response); + $this->assertArrayHasKey($linksKey, $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]); + $this->assertCount(1, $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY][$linksKey]); $linkData = $response[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY][$linksKey][0]; - self::assertArrayHasKey(Link::KEY_LINK_URL, $linkData); - self::assertEquals('http://example.com/downloadable.txt', $linkData[Link::KEY_LINK_URL]); + $this->assertArrayHasKey(Link::KEY_LINK_URL, $linkData); + $this->assertEquals('http://example.com/downloadable.txt', $linkData[Link::KEY_LINK_URL]); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryProductsCountTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryProductsCountTest.php index eddd456a7b866..7dd05eb369c05 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryProductsCountTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryProductsCountTest.php @@ -48,7 +48,7 @@ public function testCategoryWithSaleableProduct() QUERY; $response = $this->graphQlQuery($query); - self::assertEquals(1, $response['category']['product_count']); + $this->assertEquals(1, $response['category']['product_count']); } /** @@ -73,7 +73,7 @@ public function testCategoryWithInvisibleProduct() QUERY; $response = $this->graphQlQuery($query); - self::assertEquals(0, $response['category']['product_count']); + $this->assertEquals(0, $response['category']['product_count']); } /** @@ -93,7 +93,7 @@ public function testCategoryWithOutOfStockProductManageStockEnabled() QUERY; $response = $this->graphQlQuery($query); - self::assertEquals(0, $response['category']['product_count']); + $this->assertEquals(0, $response['category']['product_count']); } /** @@ -113,7 +113,7 @@ public function testCategoryWithOutOfStockProductManageStockDisabled() QUERY; $response = $this->graphQlQuery($query); - self::assertEquals(1, $response['category']['product_count']); + $this->assertEquals(1, $response['category']['product_count']); } /** @@ -138,6 +138,6 @@ public function testCategoryWithDisabledProduct() QUERY; $response = $this->graphQlQuery($query); - self::assertEquals(0, $response['category']['product_count']); + $this->assertEquals(0, $response['category']['product_count']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index 54e98367ab8ca..83d11ec8a1efa 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -82,31 +82,31 @@ public function testCategoriesTree() $response = $this->graphQlQuery($query, [], '', $headerMap); $responseDataObject = new DataObject($response); //Some sort of smoke testing - self::assertEquals( + $this->assertEquals( 'Ololo', $responseDataObject->getData('category/children/7/children/1/description') ); - self::assertEquals( + $this->assertEquals( 'default-category', $responseDataObject->getData('category/url_key') ); - self::assertEquals( + $this->assertEquals( [], $responseDataObject->getData('category/children/0/available_sort_by') ); - self::assertEquals( + $this->assertEquals( 'name', $responseDataObject->getData('category/children/0/default_sort_by') ); - self::assertCount( + $this->assertCount( 8, $responseDataObject->getData('category/children') ); - self::assertCount( + $this->assertCount( 2, $responseDataObject->getData('category/children/7/children') ); - self::assertEquals( + $this->assertEquals( 5, $responseDataObject->getData('category/children/7/children/1/children/0/id') ); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryWithDescriptionDirectivesTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryWithDescriptionDirectivesTest.php index c115f7124c9fc..66c204ff61c63 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryWithDescriptionDirectivesTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryWithDescriptionDirectivesTest.php @@ -62,7 +62,7 @@ public function testHtmlDirectivesRendered() QUERY; $response = $this->graphQlQuery($query); - self::assertNotContains('media url', $response['category']['description']); - self::assertContains($storeBaseUrl, $response['category']['description']); + $this->assertNotContains('media url', $response['category']['description']); + $this->assertContains($storeBaseUrl, $response['category']['description']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index 8da2702917af0..700d34e24ec8b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -40,9 +40,9 @@ public function testProductSmallImageUrlWithExistingImage() QUERY; $response = $this->graphQlQuery($query); - self::assertArrayHasKey('url', $response['products']['items'][0]['small_image']); - self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image']['url']); - self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); + $this->assertArrayHasKey('url', $response['products']['items'][0]['small_image']); + $this->assertContains('magento_image.jpg', $response['products']['items'][0]['small_image']['url']); + $this->assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php index b55c6c1d91460..4cf9bf23a45b2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php @@ -41,9 +41,9 @@ public function testProductWithBaseImage() QUERY; $response = $this->graphQlQuery($query); - self::assertContains('magento_image.jpg', $response['products']['items'][0]['image']['url']); - self::assertTrue($this->checkImageExists($response['products']['items'][0]['image']['url'])); - self::assertEquals('Image Alt Text', $response['products']['items'][0]['image']['label']); + $this->assertContains('magento_image.jpg', $response['products']['items'][0]['image']['url']); + $this->assertTrue($this->checkImageExists($response['products']['items'][0]['image']['url'])); + $this->assertEquals('Image Alt Text', $response['products']['items'][0]['image']['label']); } /** @@ -66,7 +66,7 @@ public function testProductWithoutBaseImage() } QUERY; $response = $this->graphQlQuery($query); - self::assertEquals('Simple Product', $response['products']['items'][0]['image']['label']); + $this->assertEquals('Simple Product', $response['products']['items'][0]['image']['label']); } /** @@ -89,9 +89,9 @@ public function testProductWithSmallImage() QUERY; $response = $this->graphQlQuery($query); - self::assertContains('magento_image.jpg', $response['products']['items'][0]['small_image']['url']); - self::assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); - self::assertEquals('Image Alt Text', $response['products']['items'][0]['small_image']['label']); + $this->assertContains('magento_image.jpg', $response['products']['items'][0]['small_image']['url']); + $this->assertTrue($this->checkImageExists($response['products']['items'][0]['small_image']['url'])); + $this->assertEquals('Image Alt Text', $response['products']['items'][0]['small_image']['label']); } /** @@ -114,9 +114,9 @@ public function testProductWithThumbnail() QUERY; $response = $this->graphQlQuery($query); - self::assertContains('magento_image.jpg', $response['products']['items'][0]['thumbnail']['url']); - self::assertTrue($this->checkImageExists($response['products']['items'][0]['thumbnail']['url'])); - self::assertEquals('Image Alt Text', $response['products']['items'][0]['thumbnail']['label']); + $this->assertContains('magento_image.jpg', $response['products']['items'][0]['thumbnail']['url']); + $this->assertTrue($this->checkImageExists($response['products']['items'][0]['thumbnail']['url'])); + $this->assertEquals('Image Alt Text', $response['products']['items'][0]['thumbnail']['label']); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index 99de6088b19a7..c1fc1649e1b5c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -1120,11 +1120,11 @@ public function testFilterProductsThatAreOutOfStockWithConfigSettings() ->clean(\Magento\Framework\App\Config::CACHE_TAG); $response = $this->graphQlQuery($query); $responseObject = new DataObject($response); - self::assertEquals( + $this->assertEquals( 'simple_visible_in_stock', $responseObject->getData('products/items/0/sku') ); - self::assertEquals( + $this->assertEquals( 'Simple Product Visible and InStock', $responseObject->getData('products/items/0/name') ); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductTextAttributesTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductTextAttributesTest.php index 999e1cc7fca3d..0d1ad1d3ec580 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductTextAttributesTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductTextAttributesTest.php @@ -134,9 +134,9 @@ public function testHtmlDirectivesRendering() QUERY; $response = $this->graphQlQuery($query); - self::assertContains($assertionCmsBlockText, $response['products']['items'][0]['description']['html']); - self::assertNotContains('{{block id', $response['products']['items'][0]['description']['html']); - self::assertContains($assertionCmsBlockText, $response['products']['items'][0]['short_description']['html']); - self::assertNotContains('{{block id', $response['products']['items'][0]['short_description']['html']); + $this->assertContains($assertionCmsBlockText, $response['products']['items'][0]['description']['html']); + $this->assertNotContains('{{block id', $response['products']['items'][0]['description']['html']); + $this->assertContains($assertionCmsBlockText, $response['products']['items'][0]['short_description']['html']); + $this->assertNotContains('{{block id', $response['products']['items'][0]['short_description']['html']); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index a7c83aba89f0a..1fc032976a76d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -260,16 +260,16 @@ public function testQueryAllFieldsSimpleProduct() $this->assertTierPrices($product, $response['products']['items'][0]); $this->assertArrayHasKey('websites', $response['products']['items'][0]); $this->assertWebsites($product, $response['products']['items'][0]['websites']); - self::assertEquals( + $this->assertEquals( 'Movable Position 2', $responseObject->getData('products/items/0/categories/1/name') ); - self::assertEquals( + $this->assertEquals( 'Filter category', $responseObject->getData('products/items/0/categories/2/name') ); $storeManager = ObjectManager::getInstance()->get(\Magento\Store\Model\StoreManagerInterface::class); - self::assertEquals( + $this->assertEquals( $storeManager->getStore()->getBaseUrl() . 'simple-product.html', $responseObject->getData('products/items/0/canonical_url') ); @@ -644,8 +644,8 @@ public function testProductPrices() $secondProduct->setId( $secondProduct->getData($metadataPool->getMetadata(ProductInterface::class)->getLinkField()) ); - self::assertNotNull($response['products']['items'][0]['price'], "price must be not null"); - self::assertCount(2, $response['products']['items']); + $this->assertNotNull($response['products']['items'][0]['price'], "price must be not null"); + $this->assertCount(2, $response['products']['items']); $this->assertBaseFields($firstProduct, $response['products']['items'][0]); $this->assertBaseFields($secondProduct, $response['products']['items'][1]); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php index 57f526b1cb2f7..a67653ae7767e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php @@ -56,12 +56,12 @@ public function testGetCmsBlock() QUERY; $response = $this->graphQlQuery($query); - self::assertArrayHasKey('cmsBlocks', $response); - self::assertArrayHasKey('items', $response['cmsBlocks']); + $this->assertArrayHasKey('cmsBlocks', $response); + $this->assertArrayHasKey('items', $response['cmsBlocks']); - self::assertEquals($cmsBlockData['identifier'], $response['cmsBlocks']['items'][0]['identifier']); - self::assertEquals($cmsBlockData['title'], $response['cmsBlocks']['items'][0]['title']); - self::assertEquals($renderedContent, $response['cmsBlocks']['items'][0]['content']); + $this->assertEquals($cmsBlockData['identifier'], $response['cmsBlocks']['items'][0]['identifier']); + $this->assertEquals($cmsBlockData['title'], $response['cmsBlocks']['items'][0]['title']); + $this->assertEquals($renderedContent, $response['cmsBlocks']['items'][0]['content']); } /** @@ -155,14 +155,14 @@ public function testGetEnabledAndDisabledCmsBlockInOneRequest() try { $this->graphQlQuery($query); - self::fail('Response should contains errors.'); + $this->fail('Response should contains errors.'); } catch (ResponseContainsErrorsException $e) { $responseData = $e->getResponseData(); } - self::assertNotEmpty($responseData); - self::assertEquals('enabled_block', $responseData['data']['cmsBlocks']['items'][0]['identifier']); - self::assertEquals( + $this->assertNotEmpty($responseData); + $this->assertEquals('enabled_block', $responseData['data']['cmsBlocks']['items'][0]['identifier']); + $this->assertEquals( 'The CMS block with the "disabled_block" ID doesn\'t exist.', $responseData['errors'][0]['message'] ); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php index 53eb80335ff21..2c49d9470b0f2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GetAddressesTest.php @@ -60,7 +60,7 @@ public function testGetCustomerWithAddresses() is_array([$response['customer']['addresses']]), " Addresses field must be of an array type." ); - self::assertEquals($customer->getId(), $response['customer']['id']); + $this->assertEquals($customer->getId(), $response['customer']['id']); $this->assertCustomerAddressesFields($customer, $response); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CouponTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CouponTest.php index 1f8ad06a9f8ed..1e3f9678e7a91 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CouponTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CouponTest.php @@ -58,8 +58,8 @@ public function testApplyCouponToGuestCartWithItems() $query = $this->prepareAddCouponRequestQuery($maskedQuoteId, $couponCode); $response = $this->graphQlQuery($query); - self::assertArrayHasKey("applyCouponToCart", $response); - self::assertEquals($couponCode, $response['applyCouponToCart']['cart']['applied_coupon']['code']); + $this->assertArrayHasKey("applyCouponToCart", $response); + $this->assertEquals($couponCode, $response['applyCouponToCart']['cart']['applied_coupon']['code']); } /** @@ -79,8 +79,8 @@ public function testApplyCouponTwice() $query = $this->prepareAddCouponRequestQuery($maskedQuoteId, $couponCode); $response = $this->graphQlQuery($query); - self::assertArrayHasKey("applyCouponToCart", $response); - self::assertEquals($couponCode, $response['applyCouponToCart']['cart']['applied_coupon']['code']); + $this->assertArrayHasKey("applyCouponToCart", $response); + $this->assertEquals($couponCode, $response['applyCouponToCart']['cart']['applied_coupon']['code']); self::expectExceptionMessage('A coupon is already applied to the cart. Please remove it to apply another'); $this->graphQlQuery($query); @@ -153,8 +153,8 @@ public function testRemoveCoupon() $query = $this->prepareRemoveCouponRequestQuery($maskedQuoteId); $response = $this->graphQlQuery($query); - self::assertArrayHasKey('removeCouponFromCart', $response); - self::assertSame('', $response['removeCouponFromCart']['cart']['applied_coupon']['code']); + $this->assertArrayHasKey('removeCouponFromCart', $response); + $this->assertSame('', $response['removeCouponFromCart']['cart']['applied_coupon']['code']); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CreateEmptyCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CreateEmptyCartTest.php index 6e819b523ec82..dfff20f8fe716 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CreateEmptyCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/CreateEmptyCartTest.php @@ -49,14 +49,14 @@ public function testCreateEmptyCartForGuest() QUERY; $response = $this->graphQlQuery($query); - self::assertArrayHasKey('createEmptyCart', $response); + $this->assertArrayHasKey('createEmptyCart', $response); $maskedCartId = $response['createEmptyCart']; /** @var CartInterface $guestCart */ $guestCart = $this->guestCartRepository->get($maskedCartId); - self::assertNotNull($guestCart->getId()); - self::assertNull($guestCart->getCustomer()->getId()); + $this->assertNotNull($guestCart->getId()); + $this->assertNull($guestCart->getCustomer()->getId()); } /** @@ -79,13 +79,13 @@ public function testCreateEmptyCartForRegisteredCustomer() $response = $this->graphQlQuery($query, [], '', $headerMap); - self::assertArrayHasKey('createEmptyCart', $response); + $this->assertArrayHasKey('createEmptyCart', $response); $maskedCartId = $response['createEmptyCart']; /* guestCartRepository is used for registered customer to get the cart hash */ $guestCart = $this->guestCartRepository->get($maskedCartId); - self::assertNotNull($guestCart->getId()); - self::assertEquals(1, $guestCart->getCustomer()->getId()); + $this->assertNotNull($guestCart->getId()); + $this->assertEquals(1, $guestCart->getCustomer()->getId()); } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php index a023d37895c23..d880b4763518e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php @@ -94,9 +94,9 @@ public function testSetNewGuestShippingAddressOnCart() QUERY; $response = $this->graphQlQuery($query); - self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); + $this->assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); $cartResponse = $response['setShippingAddressesOnCart']['cart']; - self::assertArrayHasKey('addresses', $cartResponse); + $this->assertArrayHasKey('addresses', $cartResponse); $shippingAddressResponse = current($cartResponse['addresses']); $this->assertNewShippingAddressFields($shippingAddressResponse); } @@ -347,9 +347,9 @@ public function testSetNewRegisteredCustomerShippingAddressOnCart() QUERY; $response = $this->graphQlQuery($query, [], '', $headerMap); - self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); + $this->assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); $cartResponse = $response['setShippingAddressesOnCart']['cart']; - self::assertArrayHasKey('addresses', $cartResponse); + $this->assertArrayHasKey('addresses', $cartResponse); $shippingAddressResponse = current($cartResponse['addresses']); $this->assertNewShippingAddressFields($shippingAddressResponse); } @@ -405,9 +405,9 @@ public function testSetSavedRegisteredCustomerShippingAddressOnCart() QUERY; $response = $this->graphQlQuery($query, [], '', $headerMap); - self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); + $this->assertArrayHasKey('cart', $response['setShippingAddressesOnCart']); $cartResponse = $response['setShippingAddressesOnCart']['cart']; - self::assertArrayHasKey('addresses', $cartResponse); + $this->assertArrayHasKey('addresses', $cartResponse); $shippingAddressResponse = current($cartResponse['addresses']); $this->assertSavedShippingAddressFields($shippingAddressResponse); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php index 7e77284c6b220..81d6c692bacc4 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php @@ -76,12 +76,12 @@ public function testSetShippingMethodOnCart() $response = $this->sendRequestWithToken($query); - self::assertArrayHasKey('setShippingMethodsOnCart', $response); - self::assertArrayHasKey('cart', $response['setShippingMethodsOnCart']); - self::assertEquals($maskedQuoteId, $response['setShippingMethodsOnCart']['cart']['cart_id']); + $this->assertArrayHasKey('setShippingMethodsOnCart', $response); + $this->assertArrayHasKey('cart', $response['setShippingMethodsOnCart']); + $this->assertEquals($maskedQuoteId, $response['setShippingMethodsOnCart']['cart']['cart_id']); $addressesInformation = $response['setShippingMethodsOnCart']['cart']['addresses']; - self::assertCount(2, $addressesInformation); - self::assertEquals( + $this->assertCount(2, $addressesInformation); + $this->assertEquals( $addressesInformation[0]['selected_shipping_method']['code'], $shippingCarrierCode . '_' . $shippingMethodCode ); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php index 7448b165fc234..0e88e41b8094d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/VariablesSupportQueryTest.php @@ -68,12 +68,12 @@ public function testQueryObjectVariablesSupport() /** @var \Magento\Catalog\Model\Product $product */ $product = $this->productRepository->get($productSku, false, null, true); - self::assertArrayHasKey('products', $response); - self::assertArrayHasKey('items', $response['products']); - self::assertEquals(1, count($response['products']['items'])); - self::assertArrayHasKey(0, $response['products']['items']); - self::assertEquals($product->getSku(), $response['products']['items'][0]['sku']); - self::assertEquals( + $this->assertArrayHasKey('products', $response); + $this->assertArrayHasKey('items', $response['products']); + $this->assertEquals(1, count($response['products']['items'])); + $this->assertArrayHasKey(0, $response['products']['items']); + $this->assertEquals($product->getSku(), $response['products']['items'][0]['sku']); + $this->assertEquals( $minPrice, $response['products']['items'][0]['price']['minimalPrice']['amount']['value'] ); diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php index c14a82e3c3668..58241f6d2bd52 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoAddCommentTest.php @@ -79,8 +79,8 @@ public function testCreditmemoAddComment() $result = $this->_webApiCall($serviceInfo, $requestData); - self::assertNotEmpty($result); - self::assertNotEmpty($result[Comment::ENTITY_ID]); - self::assertEquals($creditmemo->getId(), $result[Comment::PARENT_ID]); + $this->assertNotEmpty($result); + $this->assertNotEmpty($result[Comment::ENTITY_ID]); + $this->assertEquals($creditmemo->getId(), $result[Comment::PARENT_ID]); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCommentsListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCommentsListTest.php index 43c6a8fef7867..cd57af2f44331 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCommentsListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoCommentsListTest.php @@ -65,9 +65,9 @@ public function testCreditmemoCommentsList() $result = $this->_webApiCall($serviceInfo, ['id' => $creditmemo->getEntityId()]); - self::assertNotEmpty($result['items']); + $this->assertNotEmpty($result['items']); $item = $result['items'][0]; - self::assertNotEmpty($item[CreditmemoCommentInterface::ENTITY_ID]); - self::assertEquals($comment, $item[CreditmemoCommentInterface::COMMENT]); + $this->assertNotEmpty($item[CreditmemoCommentInterface::ENTITY_ID]); + $this->assertEquals($comment, $item[CreditmemoCommentInterface::COMMENT]); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php index db96728e206be..44c7fdbea2758 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderGetTest.php @@ -82,34 +82,34 @@ public function testOrderGet(): void $result = $this->makeServiceCall(self::ORDER_INCREMENT_ID); foreach ($expectedOrderData as $field => $value) { - self::assertArrayHasKey($field, $result); - self::assertEquals($value, $result[$field]); + $this->assertArrayHasKey($field, $result); + $this->assertEquals($value, $result[$field]); } - self::assertArrayHasKey('payment', $result); + $this->assertArrayHasKey('payment', $result); foreach ($expectedPayments as $field => $value) { - self::assertEquals($value, $result['payment'][$field]); + $this->assertEquals($value, $result['payment'][$field]); } - self::assertArrayHasKey('billing_address', $result); + $this->assertArrayHasKey('billing_address', $result); foreach ($expectedBillingAddressNotEmpty as $field) { - self::assertArrayHasKey($field, $result['billing_address']); + $this->assertArrayHasKey($field, $result['billing_address']); } - self::assertArrayHasKey('extension_attributes', $result); - self::assertArrayHasKey('shipping_assignments', $result['extension_attributes']); + $this->assertArrayHasKey('extension_attributes', $result); + $this->assertArrayHasKey('shipping_assignments', $result['extension_attributes']); $shippingAssignments = $result['extension_attributes']['shipping_assignments']; - self::assertCount(1, $shippingAssignments); + $this->assertCount(1, $shippingAssignments); $shippingAddress = $shippingAssignments[0]['shipping']['address']; foreach ($expectedShippingAddress as $key => $value) { - self::assertArrayHasKey($key, $shippingAddress); - self::assertEquals($value, $shippingAddress[$key]); + $this->assertArrayHasKey($key, $shippingAddress); + $this->assertEquals($value, $shippingAddress[$key]); } //check that nullable fields were marked as optional and were not sent foreach ($result as $value) { - self::assertNotNull($value); + $this->assertNotNull($value); } } @@ -128,13 +128,13 @@ public function testOrderGetExtensionAttributes(): void $result = $this->makeServiceCall(self::ORDER_INCREMENT_ID); $appliedTaxes = $result['extension_attributes']['applied_taxes']; - self::assertEquals($expectedTax['code'], $appliedTaxes[0]['code']); + $this->assertEquals($expectedTax['code'], $appliedTaxes[0]['code']); $appliedTaxes = $result['extension_attributes']['item_applied_taxes']; - self::assertEquals($expectedTax['type'], $appliedTaxes[0]['type']); - self::assertNotEmpty($appliedTaxes[0]['applied_taxes']); - self::assertEquals(true, $result['extension_attributes']['converting_from_quote']); - self::assertArrayHasKey('payment_additional_info', $result['extension_attributes']); - self::assertNotEmpty($result['extension_attributes']['payment_additional_info']); + $this->assertEquals($expectedTax['type'], $appliedTaxes[0]['type']); + $this->assertNotEmpty($appliedTaxes[0]['applied_taxes']); + $this->assertEquals(true, $result['extension_attributes']['converting_from_quote']); + $this->assertArrayHasKey('payment_additional_info', $result['extension_attributes']); + $this->assertNotEmpty($result['extension_attributes']['payment_additional_info']); } /** @@ -158,9 +158,9 @@ public function testGetOrderWithProductOption(): void $result = $this->makeServiceCall(self::ORDER_INCREMENT_ID); $bundleProduct = $this->getBundleProduct($result['items']); - self::assertNotEmpty($bundleProduct, '"Bundle Product" should not be empty.'); - self::assertNotEmpty($bundleProduct['product_option'], '"Product Option" should not be empty.'); - self::assertEquals($expected, $bundleProduct['product_option']); + $this->assertNotEmpty($bundleProduct, '"Bundle Product" should not be empty.'); + $this->assertNotEmpty($bundleProduct['product_option'], '"Product Option" should not be empty.'); + $this->assertEquals($expected, $bundleProduct['product_option']); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php index 054f91a295fd9..1c78851c0c87c 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentAddTrackTest.php @@ -70,9 +70,9 @@ public function testShipmentAddTrack() $result = $this->_webApiCall($this->getServiceInfo(), ['entity' => $trackData]); - self::assertNotEmpty($result); - self::assertNotEmpty($result[ShipmentTrackInterface::ENTITY_ID]); - self::assertEquals($shipment->getId(), $result[ShipmentTrackInterface::PARENT_ID]); + $this->assertNotEmpty($result); + $this->assertNotEmpty($result[ShipmentTrackInterface::ENTITY_ID]); + $this->assertEquals($shipment->getId(), $result[ShipmentTrackInterface::PARENT_ID]); } /** * Returns details about API endpoints and services. diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php index e4435af1818c7..e2b53a9478cf2 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentRemoveTrackTest.php @@ -94,7 +94,7 @@ public function testShipmentRemoveTrack() $result = $this->_webApiCall($serviceInfo, ['id' => $trackEntity->getEntityId()]); - self::assertTrue($result); + $this->assertTrue($result); $this->assertNoAvailableTrackItems($shipment->getId()); } @@ -115,6 +115,6 @@ private function assertNoAvailableTrackItems($shipmentId) ->getList($searchCriteria) ->getItems(); - self::assertEmpty($items); + $this->assertEmpty($items); } } diff --git a/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php b/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php index f6167a06c6436..77dfcbe543db6 100644 --- a/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Search/Api/SearchTest.php @@ -45,10 +45,10 @@ public function testExistingProductSearch() $response = $this->_webApiCall($serviceInfo, $searchCriteria); - self::assertArrayHasKey('search_criteria', $response); - self::assertArrayHasKey('items', $response); - self::assertGreaterThan(0, count($response['items'])); - self::assertGreaterThan(0, $response['items'][0]['id']); + $this->assertArrayHasKey('search_criteria', $response); + $this->assertArrayHasKey('items', $response); + $this->assertGreaterThan(0, count($response['items'])); + $this->assertGreaterThan(0, $response['items'][0]['id']); } /** @@ -61,9 +61,9 @@ public function testNonExistentProductSearch() $response = $this->_webApiCall($serviceInfo, $searchCriteria); - self::assertArrayHasKey('search_criteria', $response); - self::assertArrayHasKey('items', $response); - self::assertEquals(0, count($response['items'])); + $this->assertArrayHasKey('search_criteria', $response); + $this->assertArrayHasKey('items', $response); + $this->assertEquals(0, count($response['items'])); } /** diff --git a/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponseTest.php b/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponseTest.php index 28d4395e7e413..da1555c3cc0ba 100644 --- a/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponseTest.php +++ b/dev/tests/integration/testsuite/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponseTest.php @@ -33,8 +33,8 @@ public function testUnauthorizedRequest() $this->getRequest()->setPostValue($data); $this->dispatch(self::$entryPoint); - self::assertEquals(302, $this->getResponse()->getHttpResponseCode()); - self::assertEmpty($this->getResponse()->getBody()); + $this->assertEquals(302, $this->getResponse()->getHttpResponseCode()); + $this->assertEmpty($this->getResponse()->getBody()); } /** @@ -57,7 +57,7 @@ public function testSuccess() ]; $this->getRequest()->setPostValue($data); $this->dispatch(self::$entryPoint); - self::assertEquals(200, $this->getResponse()->getHttpResponseCode()); - self::assertContains('/sales/order/view', $this->getResponse()->getBody()); + $this->assertEquals(200, $this->getResponse()->getHttpResponseCode()); + $this->assertContains('/sales/order/view', $this->getResponse()->getBody()); } } diff --git a/dev/tests/integration/testsuite/Magento/Authorizenet/Model/Directpost/RequestTest.php b/dev/tests/integration/testsuite/Magento/Authorizenet/Model/Directpost/RequestTest.php index 8f3cce9679953..30787af7c5a19 100644 --- a/dev/tests/integration/testsuite/Magento/Authorizenet/Model/Directpost/RequestTest.php +++ b/dev/tests/integration/testsuite/Magento/Authorizenet/Model/Directpost/RequestTest.php @@ -58,7 +58,7 @@ public function testSetDataFromOrder() ->setMethods(['getConfigData']) ->getMock(); - $payment->expects(static::exactly(2)) + $payment->expects($this->exactly(2)) ->method('getConfigData') ->willReturnMap([ ['email_customer', null, $customerEmail], @@ -67,10 +67,10 @@ public function testSetDataFromOrder() $result = $this->request->setDataFromOrder($this->order, $payment); - static::assertEquals('US', $result->getXCountry()); - static::assertEquals('UK', $result->getXShipToCountry()); - static::assertEquals($customerEmail, $result->getXEmailCustomer()); - static::assertEquals($merchantEmail, $result->getXMerchantEmail()); + $this->assertEquals('US', $result->getXCountry()); + $this->assertEquals('UK', $result->getXShipToCountry()); + $this->assertEquals($customerEmail, $result->getXEmailCustomer()); + $this->assertEquals($merchantEmail, $result->getXMerchantEmail()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Authorizenet/Model/DirectpostTest.php b/dev/tests/integration/testsuite/Magento/Authorizenet/Model/DirectpostTest.php index ba4c4efd78f1b..54f7dfcabfedc 100644 --- a/dev/tests/integration/testsuite/Magento/Authorizenet/Model/DirectpostTest.php +++ b/dev/tests/integration/testsuite/Magento/Authorizenet/Model/DirectpostTest.php @@ -70,7 +70,7 @@ public function testCapture() ->setMethods(['setUri', 'setConfig', 'setParameterPost', 'setMethod', 'request']) ->getMock(); - $this->httpClientFactory->expects(static::once()) + $this->httpClientFactory->expects($this->once()) ->method('create') ->willReturn($httpClient); @@ -78,7 +78,7 @@ public function testCapture() ->disableOriginalConstructor() ->setMethods(['getBody']) ->getMock(); - $response->expects(static::once()) + $response->expects($this->once()) ->method('getBody') ->willReturn( "1(~)1(~)1(~)This transaction has been approved.(~)AWZFTG(~)P(~){$transactionId}(~)100000002(~) @@ -89,16 +89,16 @@ public function testCapture() (~)(~)(~)(~)(~)(~)(~)(~)(~)(~)(~)(~)" ); - $httpClient->expects(static::once()) + $httpClient->expects($this->once()) ->method('request') ->willReturn($response); $this->directPost->capture($payment, $amount); - static::assertEquals($transactionId, $payment->getTransactionId()); - static::assertFalse($payment->getIsTransactionClosed()); - static::assertEquals('US', $payment->getOrder()->getBillingAddress()->getCountryId()); - static::assertEquals('UK', $payment->getOrder()->getShippingAddress()->getCountryId()); + $this->assertEquals($transactionId, $payment->getTransactionId()); + $this->assertFalse($payment->getIsTransactionClosed()); + $this->assertEquals('US', $payment->getOrder()->getBillingAddress()->getCountryId()); + $this->assertEquals('UK', $payment->getOrder()->getShippingAddress()->getCountryId()); } /** @@ -126,7 +126,7 @@ public function testProcessWithFdsFilterActionReportOnly($filterAction, $orderId $payment = $this->getPayment($orderId); $this->objectManager->removeSharedInstance(TransactionService::class); - static::assertEquals($expectedOrderState, $payment->getOrder()->getState()); + $this->assertEquals($expectedOrderState, $payment->getOrder()->getState()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Block/Form/ContainerTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Block/Form/ContainerTest.php index 9424deb295d52..d1ab5b9820392 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Block/Form/ContainerTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Block/Form/ContainerTest.php @@ -56,7 +56,7 @@ public function testGetMethods() $actual = $this->container->getMethods(); /** @var MethodInterface $paymentMethod */ foreach ($actual as $paymentMethod) { - static::assertNotContains($paymentMethod->getCode(), [ + $this->assertNotContains($paymentMethod->getCode(), [ PayPalConfigProvider::PAYPAL_VAULT_CODE, PayPalConfigProvider::PAYPAL_CODE ]); } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Block/VaultTokenRendererTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Block/VaultTokenRendererTest.php index 4bd4461cebe75..a1670e7a1b87b 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Block/VaultTokenRendererTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Block/VaultTokenRendererTest.php @@ -53,15 +53,15 @@ public function testGetPaymentTokens() $tokens = $this->tokenBlock->getPaymentTokens(); - static::assertCount(1, $tokens); + $this->assertCount(1, $tokens); /** @var PaymentTokenInterface $vaultToken */ $vaultToken = array_pop($tokens); - static::assertTrue($vaultToken->getIsActive()); - static::assertTrue($vaultToken->getIsVisible()); - static::assertEquals($token, $vaultToken->getGatewayToken()); - static::assertEquals(ConfigProvider::PAYPAL_CODE, $vaultToken->getPaymentMethodCode()); - static::assertEquals(AccountPaymentTokenFactory::TOKEN_TYPE_ACCOUNT, $vaultToken->getType()); + $this->assertTrue($vaultToken->getIsActive()); + $this->assertTrue($vaultToken->getIsVisible()); + $this->assertEquals($token, $vaultToken->getGatewayToken()); + $this->assertEquals(ConfigProvider::PAYPAL_CODE, $vaultToken->getPaymentMethodCode()); + $this->assertEquals(AccountPaymentTokenFactory::TOKEN_TYPE_ACCOUNT, $vaultToken->getType()); } } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Invoice/CreateTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Invoice/CreateTest.php index d6ea08a2f7ca3..f01eb667d6f9a 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Invoice/CreateTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Invoice/CreateTest.php @@ -71,8 +71,8 @@ public function testCreatePartialInvoiceWithNonDefaultMerchantAccount(): void $order = $this->getOrder('100000002'); $this->adapter->method('sale') - ->with(self::callback(function ($request) { - self::assertEquals('USA_Merchant', $request['merchantAccountId']); + ->with($this->callback(function ($request) { + $this->assertEquals('USA_Merchant', $request['merchantAccountId']); return true; })) ->willReturn($this->getTransactionStub()); @@ -82,7 +82,7 @@ public function testCreatePartialInvoiceWithNonDefaultMerchantAccount(): void $this->dispatch($uri); self::assertSessionMessages( - self::equalTo(['The invoice has been created.']), + $this->equalTo(['The invoice has been created.']), MessageInterface::TYPE_SUCCESS ); } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Order/PaymentReviewTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Order/PaymentReviewTest.php index bb7b04f53dd6d..012dedd1c5f1a 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Order/PaymentReviewTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Order/PaymentReviewTest.php @@ -63,15 +63,15 @@ public function testExecuteAccept() $orderId = $this->order->getEntityId(); $this->dispatch('backend/sales/order/reviewPayment/action/accept/order_id/' . $orderId); - static::assertRedirect(static::stringContains('sales/order/view/order_id/' . $orderId)); + static::assertRedirect($this->stringContains('sales/order/view/order_id/' . $orderId)); static::assertSessionMessages( - static::equalTo(['The payment has been accepted.']), + $this->equalTo(['The payment has been accepted.']), MessageInterface::TYPE_SUCCESS ); $order = $this->orderRepository->get($orderId); - static::assertEquals(Order::STATE_COMPLETE, $order->getState()); - static::assertEquals(Order::STATE_COMPLETE, $order->getStatus()); + $this->assertEquals(Order::STATE_COMPLETE, $order->getState()); + $this->assertEquals(Order::STATE_COMPLETE, $order->getStatus()); } /** @@ -92,21 +92,21 @@ public function testExecuteDeny() $payment->setMethodInstance($adapter); $this->orderRepository->save($this->order); - $adapter->expects(static::once()) + $adapter->expects($this->once()) ->method('denyPayment') ->with($payment) ->willReturn(true); $this->dispatch('backend/sales/order/reviewPayment/action/deny/order_id/' . $orderId); - static::assertRedirect(static::stringContains('sales/order/view/order_id/' . $orderId)); + static::assertRedirect($this->stringContains('sales/order/view/order_id/' . $orderId)); static::assertSessionMessages( - static::equalTo(['The payment has been denied.']), + $this->equalTo(['The payment has been denied.']), MessageInterface::TYPE_SUCCESS ); $order = $this->orderRepository->get($orderId); - static::assertEquals(Order::STATE_CANCELED, $order->getState()); - static::assertEquals(Order::STATE_CANCELED, $order->getStatus()); + $this->assertEquals(Order::STATE_CANCELED, $order->getState()); + $this->assertEquals(Order::STATE_CANCELED, $order->getStatus()); } } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Payment/GetClientTokenTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Payment/GetClientTokenTest.php index cc5ddc7dc97bf..36195f900c7ed 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Payment/GetClientTokenTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Adminhtml/Payment/GetClientTokenTest.php @@ -163,9 +163,9 @@ private function perform($merchantId, $publicKey, $privateKey) */ private function performAsserts($clientToken, $merchantId, $publicKey, $privateKey) { - self::assertEquals('client_token', $clientToken); - self::assertEquals(Configuration::merchantId(), $merchantId); - self::assertEquals(Configuration::publicKey(), $publicKey); - self::assertEquals(Configuration::privateKey(), $privateKey); + $this->assertEquals('client_token', $clientToken); + $this->assertEquals(Configuration::merchantId(), $merchantId); + $this->assertEquals(Configuration::publicKey(), $publicKey); + $this->assertEquals(Configuration::privateKey(), $privateKey); } } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Cards/DeleteActionTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Cards/DeleteActionTest.php index eae831743f9cd..6f422925fcc56 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Cards/DeleteActionTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Cards/DeleteActionTest.php @@ -31,7 +31,7 @@ public function testExecute() $tokenManagement = $this->_objectManager->get(CustomerTokenManagement::class); $tokens = $tokenManagement->getCustomerSessionTokens(); - static::assertCount(1, $tokens); + $this->assertCount(1, $tokens); $vaultToken = array_pop($tokens); @@ -45,9 +45,9 @@ public function testExecute() ->setMethod(Request::METHOD_POST); $this->dispatch('vault/cards/deleteaction'); - static::assertTrue($this->getResponse()->isRedirect()); - static::assertRedirect(static::stringContains('vault/cards/listaction')); - static::assertSessionMessages(static::equalTo(['Stored Payment Method was successfully removed'])); - static::assertEmpty($tokenManagement->getCustomerSessionTokens()); + $this->assertTrue($this->getResponse()->isRedirect()); + static::assertRedirect($this->stringContains('vault/cards/listaction')); + static::assertSessionMessages($this->equalTo(['Stored Payment Method was successfully removed'])); + $this->assertEmpty($tokenManagement->getCustomerSessionTokens()); } } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Paypal/PlaceOrderTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Paypal/PlaceOrderTest.php index 4f2b0fd67840d..b84093b33d56a 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Controller/Paypal/PlaceOrderTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Controller/Paypal/PlaceOrderTest.php @@ -98,14 +98,14 @@ public function testExecuteWithFailedOrder() $this->getRequest()->setMethod(HttpRequest::METHOD_POST); $this->dispatch('braintree/paypal/placeOrder'); - self::assertRedirect(self::stringContains('checkout/cart')); + self::assertRedirect($this->stringContains('checkout/cart')); self::assertSessionMessages( - self::equalTo(['The order #' . $reservedOrderId . ' cannot be processed.']), + $this->equalTo(['The order #' . $reservedOrderId . ' cannot be processed.']), MessageInterface::TYPE_ERROR ); $order = $this->getOrder($reservedOrderId); - self::assertEquals('canceled', $order->getState()); + $this->assertEquals('canceled', $order->getState()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Model/PaymentMethodListTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Model/PaymentMethodListTest.php index a4194807ccb86..13f7ea1bfcd4b 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Model/PaymentMethodListTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Model/PaymentMethodListTest.php @@ -43,7 +43,7 @@ public function testGetList() { $vaultPayments = $this->paymentMethodList->getList($this->storeId); - static::assertNotEmpty($vaultPayments); + $this->assertNotEmpty($vaultPayments); $paymentCodes = array_map(function (VaultPaymentInterface $payment) { return $payment->getCode(); @@ -53,7 +53,7 @@ public function testGetList() PayPalConfigProvider::PAYPAL_VAULT_CODE, ConfigProvider::CC_VAULT_CODE ]; - static::assertNotEmpty(array_intersect($expectedCodes, $paymentCodes)); + $this->assertNotEmpty(array_intersect($expectedCodes, $paymentCodes)); } /** @@ -63,10 +63,10 @@ public function testGetActiveList() { $vaultPayments = $this->paymentMethodList->getActiveList($this->storeId); - static::assertNotEmpty($vaultPayments); + $this->assertNotEmpty($vaultPayments); $paymentCodes = array_map(function ($payment) { return $payment->getCode(); }, $vaultPayments); - static::assertContains(PayPalConfigProvider::PAYPAL_VAULT_CODE, $paymentCodes); + $this->assertContains(PayPalConfigProvider::PAYPAL_VAULT_CODE, $paymentCodes); } } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php index 9ef62145b47b7..cb295f8c8de3e 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/Adminhtml/PayPal/TokenUiComponentProviderTest.php @@ -51,12 +51,12 @@ public function testGetComponentForToken() $component = $this->tokenComponentProvider->getComponentForToken($paymentToken); $config = $component->getConfig(); - static::assertNotEmpty($config[TokenUiComponentProviderInterface::COMPONENT_DETAILS]); - static::assertNotEmpty($config[TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH]); - static::assertEquals(ConfigProvider::PAYPAL_VAULT_CODE, $config['code']); + $this->assertNotEmpty($config[TokenUiComponentProviderInterface::COMPONENT_DETAILS]); + $this->assertNotEmpty($config[TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH]); + $this->assertEquals(ConfigProvider::PAYPAL_VAULT_CODE, $config['code']); $details = $config[TokenUiComponentProviderInterface::COMPONENT_DETAILS]; - static::assertEquals($payerEmail, $details['payerEmail']); - static::assertNotEmpty($details['icon']); + $this->assertEquals($payerEmail, $details['payerEmail']); + $this->assertNotEmpty($details['icon']); } } diff --git a/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/TokensConfigProviderTest.php b/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/TokensConfigProviderTest.php index 1cedad46f46f4..1d5feaaf2dad9 100644 --- a/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/TokensConfigProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/Braintree/Model/Ui/TokensConfigProviderTest.php @@ -79,9 +79,9 @@ public function testGetConfig() $session->setCustomerId($customerId); $actual = $this->configProvider->getConfig()['payment']['vault']; - static::assertCount(1, $actual); - static::assertNotEmpty($actual[$item]); - static::assertEquals(PayPalConfigProvider::PAYPAL_VAULT_CODE, $actual[$item]['config']['code']); - static::assertEquals($payerEmail, $actual[$item]['config']['details']['payerEmail']); + $this->assertCount(1, $actual); + $this->assertNotEmpty($actual[$item]); + $this->assertEquals(PayPalConfigProvider::PAYPAL_VAULT_CODE, $actual[$item]['config']['code']); + $this->assertEquals($payerEmail, $actual[$item]['config']['details']['payerEmail']); } } diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/ProductTest.php index 4303577e6c435..cecd0274a36b9 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/ProductTest.php @@ -138,7 +138,7 @@ public function testMultipleStores() $storeRepository = $this->objectManager->get(StoreRepositoryInterface::class); $store = $storeRepository->get('fixture_second_store'); - self::assertNotEquals($store->getId(), $bundle->getStoreId()); + $this->assertNotEquals($store->getId(), $bundle->getStoreId()); /** @var StoreManagerInterface $storeManager */ $storeManager = $this->objectManager->get(StoreManagerInterface::class); @@ -148,7 +148,7 @@ public function testMultipleStores() ->setCopyFromView(true); $updatedBundle = $productRepository->save($bundle); - self::assertEquals($store->getId(), $updatedBundle->getStoreId()); + $this->assertEquals($store->getId(), $updatedBundle->getStoreId()); } /** diff --git a/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Export/RowCustomizerTest.php b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Export/RowCustomizerTest.php index c26f5860f2375..c226d82b22550 100644 --- a/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Export/RowCustomizerTest.php +++ b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Export/RowCustomizerTest.php @@ -112,6 +112,6 @@ function ($input) { 'name' . '_' . $store->getCode() => array_column($bundleValues, 'name' . '_' . $store->getCode())[0], ]; - self::assertSame($expectedNames, $actualNames); + $this->assertSame($expectedNames, $actualNames); } } diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php index c0a720229a00d..8fccfd4c6e135 100644 --- a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForBackendObserverTest.php @@ -55,6 +55,6 @@ public function testLoginAttemptsRemovedAfterSuccessfulLogin() */ $captchaLog = $captchaLogFactory->create(); - self::assertEquals(0, $captchaLog->countAttemptsByUserLogin($login)); + $this->assertEquals(0, $captchaLog->countAttemptsByUserLogin($login)); } } diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php index c09211b020b30..f61f40363e396 100644 --- a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendAccountEditObserverTest.php @@ -48,6 +48,6 @@ public function testAccountEditRemovesFailedAttempts() */ $captchaLog = $captchaLogFactory->create(); - self::assertEquals(0, $captchaLog->countAttemptsByUserLogin($customerEmail)); + $this->assertEquals(0, $captchaLog->countAttemptsByUserLogin($customerEmail)); } } diff --git a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php index f8dd80595f936..cd37340d0338c 100644 --- a/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Captcha/Observer/ResetAttemptForFrontendObserverTest.php @@ -55,6 +55,6 @@ public function testSuccesfulLoginRemovesFailedAttempts() */ $captchaLog = $captchaLogFactory->create(); - self::assertEquals(0, $captchaLog->countAttemptsByUserLogin($customerEmail)); + $this->assertEquals(0, $captchaLog->countAttemptsByUserLogin($customerEmail)); } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php index 049e7c8d20119..f393aab92b14b 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php @@ -76,13 +76,13 @@ public function testProductUpdateCustomAttribute(): void $resourceModel = $product->getResourceCollection() ->getEntity(); - self::assertInstanceOf( + $this->assertInstanceOf( Flat::class, $resourceModel, 'Product should be received from flat resource' ); - self::assertEquals( + $this->assertEquals( 'changed flat attribute', $product->getFlatAttribute(), 'Product flat attribute should be able to change.' diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php index a32b476fe75ff..99289267d83e5 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php @@ -74,7 +74,7 @@ public function testProductUpdate(): void ->setScheduled(false); $isScheduled = $this->processor->getIndexer() ->isScheduled(); - self::assertFalse( + $this->assertFalse( $isScheduled, 'Indexer is in scheduled mode when turned to update on save mode' ); @@ -92,12 +92,12 @@ public function testProductUpdate(): void $layer->setCurrentCategory($category); /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */ $productCollection = $layer->getProductCollection(); - self::assertTrue( + $this->assertTrue( $productCollection->isEnabledFlat(), 'Product collection is not using flat resource when flat is on' ); - self::assertEquals( + $this->assertEquals( 2, $productCollection->count(), 'Product collection items count must be exactly 2' @@ -106,7 +106,7 @@ public function testProductUpdate(): void foreach ($productCollection as $product) { /** @var $product \Magento\Catalog\Model\Product */ if ($product->getSku() === 'simple') { - self::assertEquals( + $this->assertEquals( 'Updated Product', $product->getName(), 'Product name from flat does not match with updated name' diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php index 1ed0057ca2486..2f7b61a1f4355 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductGettersTest.php @@ -219,7 +219,7 @@ public function testGetAttributeTextArray() 'Option 3', 'Option 4 "!@#$%^&*' ]; - self::assertEquals( + $this->assertEquals( $expected, $product->getAttributeText('multiselect_attribute') ); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php index d4016b2bfa8d4..42d5507dbcbe6 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductRepositoryTest.php @@ -73,8 +73,8 @@ public function testGetProduct(string $sku) : void $expectedSku = 'simple'; $product = $this->productRepository->get($sku); - self::assertNotEmpty($product); - self::assertEquals($expectedSku, $product->getSku()); + $this->assertNotEmpty($product); + $this->assertEquals($expectedSku, $product->getSku()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php index 904af7f334080..7b36adb920000 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php @@ -140,8 +140,8 @@ public function testAddAttributeToSort(string $productSku, string $order) { /** @var Collection $productCollection */ $this->collection->addAttributeToSort('is_saleable', $order); - self::assertEquals(2, $this->collection->count()); - self::assertSame($productSku, $this->collection->getFirstItem()->getSku()); + $this->assertEquals(2, $this->collection->count()); + $this->assertSame($productSku, $this->collection->getFirstItem()->getSku()); } /** @@ -185,7 +185,7 @@ public function testJoinTable() . ' LEFT JOIN `' . $urlRewriteTable . '` AS `alias` ON (alias.entity_id =e.entity_id)' . ' AND (alias.entity_type = \'product\')'; - self::assertContains($expected, str_replace(PHP_EOL, '', $sql)); + $this->assertContains($expected, str_replace(PHP_EOL, '', $sql)); } /** diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php index 7954e2c36227f..4ed415ef79a8b 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/ProductTest.php @@ -47,6 +47,6 @@ public function testGetAttributeRawValue() $product = $productRepository->get($sku); $actual = $this->model->getAttributeRawValue($product->getId(), $attribute, null); - self::assertEquals($product->getName(), $actual); + $this->assertEquals($product->getName(), $actual); } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php index 4e8eaf70824db..160d99ad08ff1 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Plugin/Model/AttributeSetRepository/RemoveProductsTest.php @@ -28,7 +28,7 @@ public function testRemoveProductsIsRegistered() { $pluginInfo = Bootstrap::getObjectManager()->get(PluginList::class) ->get(AttributeSetRepositoryInterface::class, []); - self::assertSame(RemoveProducts::class, $pluginInfo['remove_products']['instance']); + $this->assertSame(RemoveProducts::class, $pluginInfo['remove_products']['instance']); } /** @@ -50,8 +50,8 @@ public function testAfterDelete() $urlRewriteCollection->addFieldToFilter('entity_type', 'product'); $urlRewriteCollection->addFieldToFilter('entity_id', $product->getId()); - self::assertSame(1, $urlRewriteCollection->getSize()); - self::assertSame(1, $productCollection->getSize()); + $this->assertSame(1, $urlRewriteCollection->getSize()); + $this->assertSame(1, $productCollection->getSize()); $attributeSetRepository = Bootstrap::getObjectManager()->get(AttributeSetRepositoryInterface::class); $attributeSetRepository->deleteById($attributeSet->getAttributeSetId()); @@ -62,7 +62,7 @@ public function testAfterDelete() $urlRewriteCollection->addFieldToFilter('entity_type', 'product'); $urlRewriteCollection->addFieldToFilter('entity_id', $product->getId()); - self::assertSame(0, $urlRewriteCollection->getSize()); - self::assertSame(0, $productCollection->getSize()); + $this->assertSame(0, $urlRewriteCollection->getSize()); + $this->assertSame(0, $productCollection->getSize()); } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php index ee52ec09e3e2a..f4119eeccc166 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php @@ -73,7 +73,7 @@ protected function setUp() public function testRenderingByDefault() { $html = $this->finalPriceBox->toHtml(); - self::assertContains('5.99', $html); + $this->assertContains('5.99', $html); $this->assertGreaterThanOrEqual( 1, \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( @@ -103,7 +103,7 @@ public function testRenderingAccordingToIsProductListFlag($flag) { $this->finalPriceBox->setData('is_product_list', $flag); $html = $this->finalPriceBox->toHtml(); - self::assertContains('5.99', $html); + $this->assertContains('5.99', $html); $this->assertGreaterThanOrEqual( 1, \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php index c212d4c0d971a..bb995b6e2488d 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Export/ProductTest.php @@ -319,7 +319,7 @@ public function testExportWithMedia() $data = $csv->getData($varDirectory->getAbsolutePath('test_product_with_image.csv')); foreach ($data[0] as $columnNumber => $columnName) { if ($columnName === 'hide_from_product_page') { - self::assertSame($image['file'], $data[2][$columnNumber]); + $this->assertSame($image['file'], $data[2][$columnNumber]); } } } @@ -378,7 +378,7 @@ public function testExportWithCustomOptions(): void } } - self::assertSame($expectedData, $customOptionData); + $this->assertSame($expectedData, $customOptionData); } /** diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index c4c6d3ba2d1d2..e3b20ba950604 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -819,7 +819,7 @@ public function testSaveMediaImage() */ public function testSaveMediaImageError() { - $this->logger->expects(self::once())->method('critical'); + $this->logger->expects($this->once())->method('critical'); $this->importDataForMediaTest('import_media.csv', 1); } @@ -1127,7 +1127,7 @@ private function assertProductRequestPath($storeCode, $expected) $product->setStoreId($storeId); $product->load($id); $product->getProductUrl(); - self::assertEquals($expected, $product->getRequestPath()); + $this->assertEquals($expected, $product->getRequestPath()); $registry->unregister('current_category'); } @@ -2220,8 +2220,8 @@ public function testImportImageForNonDefaultStore() $mediaGallery = $product->getData('media_gallery'); foreach ($mediaGallery['images'] as $image) { $image['file'] === '/m/a/magento_image.jpg' - ? self::assertSame('1', $image['disabled']) - : self::assertSame('0', $image['disabled']); + ? $this->assertSame('1', $image['disabled']) + : $this->assertSame('0', $image['disabled']); } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php index 6105aba9201e2..704eda7854daf 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php @@ -223,10 +223,10 @@ public function testConfigurableWithOptions(int $quantity, string $errorMessageR $result = $cart->addProduct($product, $request); if (empty($errorMessageRegexp)) { - self::assertEquals('Configurable Product', $result->getName()); + $this->assertEquals('Configurable Product', $result->getName()); } } catch (LocalizedException $e) { - self::assertEquals(1, preg_match($errorMessageRegexp, $e->getMessage())); + $this->assertEquals(1, preg_match($errorMessageRegexp, $e->getMessage())); } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/AddStockItemsObserverTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/AddStockItemsObserverTest.php index 71af5d102a8d7..1bc0940c55aad 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/AddStockItemsObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/AddStockItemsObserverTest.php @@ -31,8 +31,8 @@ public function testAddStockItemsToProductCollection() $collection->setQuote($quote); /** @var Quote\Item $quoteItem */ foreach ($collection->getItems() as $quoteItem) { - self::assertNotEmpty($quoteItem->getProduct()->getExtensionAttributes()->getStockItem()); - self::assertInstanceOf( + $this->assertNotEmpty($quoteItem->getProduct()->getExtensionAttributes()->getStockItem()); + $this->assertInstanceOf( StockItemInterface::class, $quoteItem->getProduct()->getExtensionAttributes()->getStockItem() ); diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php index 1203ca191b459..6d981cf8e34a2 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Model/ProductUrlRewriteGeneratorTest.php @@ -50,8 +50,8 @@ public function testGenerateWithSpecificCategoryUrlKey() return $url->getRequestPath(); }, $urls); - self::assertTrue(in_array('p002.html', $actualUrls)); - self::assertTrue(in_array('cat-1/p002.html', $actualUrls)); - self::assertTrue(in_array('cat-1-2/p002.html', $actualUrls)); + $this->assertTrue(in_array('p002.html', $actualUrls)); + $this->assertTrue(in_array('cat-1/p002.html', $actualUrls)); + $this->assertTrue(in_array('cat-1-2/p002.html', $actualUrls)); } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php index 402db06a0bbc9..91b337ef9b7bd 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandlerTest.php @@ -72,7 +72,7 @@ public function testGenerateProductUrlRewrites() 'cat-1-2/p002.html', // the Secondary store with Category URL key '/p002.html', // an anchor URL the Secondary store ]; - self::assertEquals($expected, $actual, 'Generated URLs rewrites do not match.'); + $this->assertEquals($expected, $actual, 'Generated URLs rewrites do not match.'); } /** diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php index c740609773b90..3c7ec111d7e64 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/FulltextGridSearchTest.php @@ -32,10 +32,10 @@ public function testSearchByTitle(string $query, int $expectedRows, array $expec $this->dispatch($url); $response = $this->getResponse(); $data = json_decode($response->getBody(), true); - self::assertEquals($expectedRows, $data['totalRecords']); + $this->assertEquals($expectedRows, $data['totalRecords']); $titleList = array_column($data['items'], 'title'); - self::assertEquals($expectedTitles, $titleList); + $this->assertEquals($expectedTitles, $titleList); } /** diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php index b71507ae43f9f..6ecd291e8b5ab 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Controller/Adminhtml/ProductTest.php @@ -41,7 +41,7 @@ public function testSaveActionAssociatedProductIds() /** @var $product Product */ $product = $objectManager->get(Registry::class)->registry('current_product'); $configurableProductLinks = array_values($product->getExtensionAttributes()->getConfigurableProductLinks()); - self::assertEquals( + $this->assertEquals( $associatedProductIds, $configurableProductLinks, 'Product links are not available in the registry' @@ -50,7 +50,7 @@ public function testSaveActionAssociatedProductIds() /** @var $product \Magento\Catalog\Api\Data\ProductInterface */ $product = $objectManager->get(ProductRepositoryInterface::class)->getById(1, false, null, true); $configurableProductLinks = array_values($product->getExtensionAttributes()->getConfigurableProductLinks()); - self::assertEquals( + $this->assertEquals( $associatedProductIds, $configurableProductLinks, 'Product links are not available in the database' diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php index 70cc0136cfb1c..546453706d938 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/SaveHandlerTest.php @@ -68,7 +68,7 @@ public function testExecuteWithConfigurableProductLinksChanged(): void $childrenIds = $this->product->getTypeInstance()->getChildrenIds($this->product->getId()); $savedChildrenIds = [reset($childrenIds[0])]; - self::assertEquals($newChildrenIds, $savedChildrenIds); + $this->assertEquals($newChildrenIds, $savedChildrenIds); } /** @@ -85,7 +85,7 @@ public function testExecuteWithConfigurableProductLinksNotChanged(): void $this->handler->execute($product); $newProductLinks = $this->getCurrentProductLinks(); - self::assertEquals($oldProductLinks, $newProductLinks); + $this->assertEquals($oldProductLinks, $newProductLinks); } /** diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php index 78fa4733a2562..d40ff5381dc6a 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php @@ -268,7 +268,7 @@ public function testGetUsedProductsCached() $products = $this->getUsedProducts(); $productsCached = $this->getUsedProducts(); - self::assertEquals( + $this->assertEquals( array_keys($products), array_keys($productsCached) ); @@ -525,8 +525,8 @@ public function testSaveProductRelationsOneChild() $oldChildrenIds = reset($oldChildrenIds); $oneChildId = reset($oldChildrenIds); - self::assertNotEmpty($oldChildrenIds); - self::assertNotEmpty($oneChildId); + $this->assertNotEmpty($oldChildrenIds); + $this->assertNotEmpty($oneChildId); $product = $this->productRepository->getById($this->product->getId()); @@ -536,7 +536,7 @@ public function testSaveProductRelationsOneChild() $this->productRepository->save($product); - self::assertEquals( + $this->assertEquals( [ [ $oneChildId => $oneChildId @@ -555,7 +555,7 @@ public function testSaveProductRelationsNoChildren() $childrenIds = $this->product->getTypeInstance() ->getChildrenIds($this->product->getId()); - self::assertNotEmpty(reset($childrenIds)); + $this->assertNotEmpty(reset($childrenIds)); $product = $this->productRepository->getById($this->product->getId(), true); @@ -565,7 +565,7 @@ public function testSaveProductRelationsNoChildren() $this->productRepository->save($product); - self::assertEquals( + $this->assertEquals( [ [] ], diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php index 8add544881c76..bac6cf7f97e2a 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/LowestPriceOptionProviderTest.php @@ -39,9 +39,9 @@ public function testGetProductsIfOneOfChildIsDisabled() { $configurableProduct = $this->productRepository->get('configurable', false, null, true); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(10, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(10, $lowestPriceChildrenProduct->getPrice()); // load full aggregation root $lowestPriceChildProduct = $this->productRepository->get( @@ -58,9 +58,9 @@ public function testGetProductsIfOneOfChildIsDisabled() $this->storeManager->setCurrentStore($currentStoreId); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(20, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(20, $lowestPriceChildrenProduct->getPrice()); } /** @@ -70,9 +70,9 @@ public function testGetProductsIfOneOfChildIsDisabledPerStore() { $configurableProduct = $this->productRepository->get('configurable', false, null, true); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(10, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(10, $lowestPriceChildrenProduct->getPrice()); // load full aggregation root $lowestPriceChildProduct = $this->productRepository->get( @@ -90,9 +90,9 @@ public function testGetProductsIfOneOfChildIsDisabledPerStore() $this->storeManager->setCurrentStore($currentStoreId); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(20, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(20, $lowestPriceChildrenProduct->getPrice()); } /** @@ -102,9 +102,9 @@ public function testGetProductsIfOneOfChildIsOutOfStock() { $configurableProduct = $this->productRepository->get('configurable', false, null, true); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(10, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(10, $lowestPriceChildrenProduct->getPrice()); // load full aggregation root $lowestPriceChildProduct = $this->productRepository->get( @@ -117,9 +117,9 @@ public function testGetProductsIfOneOfChildIsOutOfStock() $stockItem->setIsInStock(0); $this->productRepository->save($lowestPriceChildProduct); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(20, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(20, $lowestPriceChildrenProduct->getPrice()); } /** @@ -130,9 +130,9 @@ public function testGetProductsIfOneOfChildrenIsAssignedToOtherWebsite() { $configurableProduct = $this->productRepository->getById(1, false, null, true); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(10, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(10, $lowestPriceChildrenProduct->getPrice()); /** @var \Magento\Store\Api\WebsiteRepositoryInterface $webSiteRepository */ $webSiteRepository = Bootstrap::getObjectManager()->get(\Magento\Store\Api\WebsiteRepositoryInterface::class); @@ -145,9 +145,9 @@ public function testGetProductsIfOneOfChildrenIsAssignedToOtherWebsite() $this->productRepository->save($lowestPriceChildrenProduct); $lowestPriceChildrenProducts = $this->createLowestPriceOptionsProvider()->getProducts($configurableProduct); - self::assertCount(1, $lowestPriceChildrenProducts); + $this->assertCount(1, $lowestPriceChildrenProducts); $lowestPriceChildrenProduct = reset($lowestPriceChildrenProducts); - self::assertEquals(20, $lowestPriceChildrenProduct->getPrice()); + $this->assertEquals(20, $lowestPriceChildrenProduct->getPrice()); } /** diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php index dc5c07ad8dc2c..1cc155fd00912 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerTest.php @@ -61,7 +61,7 @@ public function testFullReindexIfChildHasSpecialPrice() /** @var Product[] $items */ $items = array_values($collection->getItems()); - self::assertEquals(10, $items[0]->getData('min_price')); + $this->assertEquals(10, $items[0]->getData('min_price')); $this->indexerProcessor->reindexAll(); @@ -73,7 +73,7 @@ public function testFullReindexIfChildHasSpecialPrice() /** @var Product $item */ $item = $collection->getFirstItem(); - self::assertEquals($specialPrice, $item->getData('min_price')); + $this->assertEquals($specialPrice, $item->getData('min_price')); } /** @@ -98,6 +98,6 @@ public function testOnSaveIndexationIfChildHasSpecialPrice() /** @var Product $item */ $item = $collection->getFirstItem(); - self::assertEquals($specialPrice, $item->getData('min_price')); + $this->assertEquals($specialPrice, $item->getData('min_price')); } } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php index 578cb47d14676..f468160311462 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php @@ -70,7 +70,7 @@ public function testFullReindexIfChildHasSpecialPrice() /** @var Product[] $items */ $items = array_values($collection->getItems()); - self::assertEquals(10, $items[0]->getData('min_price')); + $this->assertEquals(10, $items[0]->getData('min_price')); $this->indexerProcessor->reindexAll(); @@ -82,7 +82,7 @@ public function testFullReindexIfChildHasSpecialPrice() /** @var Product $item */ $item = $collection->getFirstItem(); - self::assertEquals($specialPrice, $item->getData('min_price')); + $this->assertEquals($specialPrice, $item->getData('min_price')); } /** @@ -107,6 +107,6 @@ public function testOnSaveIndexationIfChildHasSpecialPrice() /** @var Product $item */ $item = $collection->getFirstItem(); - self::assertEquals($specialPrice, $item->getData('min_price')); + $this->assertEquals($specialPrice, $item->getData('min_price')); } } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php index 7edcf55f572f5..7e50e944653a5 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceTest.php @@ -51,7 +51,7 @@ public function testPriceInfoIfChildHasSpecialPrice() /** @var FinalPrice $finalPrice */ $finalPrice = $priceInfo->getPrice(FinalPrice::PRICE_CODE); - self::assertEquals($specialPrice, $finalPrice->getMinimalPrice()->getValue()); + $this->assertEquals($specialPrice, $finalPrice->getMinimalPrice()->getValue()); } /** @@ -77,8 +77,8 @@ public function testSortingOfProductsIfChildHasNotSpecialPrice() /** @var Product[] $items */ $items = array_values($collection->getItems()); - self::assertEquals('configurable', $items[0]->getSku()); - self::assertEquals('simple_77', $items[1]->getSku()); + $this->assertEquals('configurable', $items[0]->getSku()); + $this->assertEquals('simple_77', $items[1]->getSku()); } /** @@ -109,7 +109,7 @@ public function testSortingOfProductsIfChildHasSpecialPrice() /** @var Product[] $items */ $items = array_values($collection->getItems()); - self::assertEquals('simple_77', $items[0]->getSku()); - self::assertEquals('configurable', $items[1]->getSku()); + $this->assertEquals('simple_77', $items[0]->getSku()); + $this->assertEquals('configurable', $items[1]->getSku()); } } diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php index 0e191f4a90147..16a8da0ddd480 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagTest.php @@ -80,7 +80,7 @@ protected function setUp() public function testRenderingByDefault() { $html = $this->finalPriceBox->toHtml(); - self::assertContains('5.99', $html); + $this->assertContains('5.99', $html); $this->assertGreaterThanOrEqual( 1, \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( @@ -116,7 +116,7 @@ public function testRenderingAccordingToIsProductListFlag($flag, $count) { $this->finalPriceBox->setData('is_product_list', $flag); $html = $this->finalPriceBox->toHtml(); - self::assertContains('5.99', $html); + $this->assertContains('5.99', $html); $this->assertEquals( 1, \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php index b2e4fe6af3243..907fbf40d8d07 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Render/FinalPriceBox/RenderingBasedOnIsProductListFlagWithDimensionTest.php @@ -88,7 +88,7 @@ protected function setUp() public function testRenderingByDefault() { $html = $this->finalPriceBox->toHtml(); - self::assertContains('5.99', $html); + $this->assertContains('5.99', $html); $this->assertGreaterThanOrEqual( 1, \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( @@ -124,7 +124,7 @@ public function testRenderingAccordingToIsProductListFlag($flag, $count) { $this->finalPriceBox->setData('is_product_list', $flag); $html = $this->finalPriceBox->toHtml(); - self::assertContains('5.99', $html); + $this->assertContains('5.99', $html); $this->assertEquals( 1, \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath( diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php index 761064ed61fcf..fa274c3d5ed7e 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php @@ -82,7 +82,7 @@ public function testMassAssignGroupAction() ->setMethod(HttpRequest::METHOD_POST); $this->dispatch('backend/customer/index/massAssignGroup'); $this->assertSessionMessages( - self::equalTo(['A total of 1 record(s) were updated.']), + $this->equalTo(['A total of 1 record(s) were updated.']), MessageInterface::TYPE_SUCCESS ); $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); @@ -117,7 +117,7 @@ public function testLargeGroupMassAssignGroupAction() ->setMethod(HttpRequest::METHOD_POST); $this->dispatch('backend/customer/index/massAssignGroup'); $this->assertSessionMessages( - self::equalTo(['A total of 5 record(s) were updated.']), + $this->equalTo(['A total of 5 record(s) were updated.']), MessageInterface::TYPE_SUCCESS ); $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php index eea94bb3f9867..2fdb8ea253b18 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php @@ -134,17 +134,17 @@ public function failedRequestDataProvider(): array return [ [ 'ids' => [], - 'constraint' => self::equalTo(['An item needs to be selected. Select and try again.']), + 'constraint' => $this->equalTo(['An item needs to be selected. Select and try again.']), 'messageType' => MessageInterface::TYPE_ERROR, ], [ 'ids' => [111], - 'constraint' => self::isEmpty(), + 'constraint' => $this->isEmpty(), 'messageType' => null, ], [ 'ids' => null, - 'constraint' => self::equalTo(['An item needs to be selected. Select and try again.']), + 'constraint' => $this->equalTo(['An item needs to be selected. Select and try again.']), 'messageType' => MessageInterface::TYPE_ERROR, ] ]; @@ -160,12 +160,12 @@ public function successRequestDataProvider(): array return [ [ 'customerEmails' => ['customer1@example.com'], - 'constraint' => self::equalTo(['A total of 1 record(s) were deleted.']), + 'constraint' => $this->equalTo(['A total of 1 record(s) were deleted.']), 'messageType' => MessageInterface::TYPE_SUCCESS, ], [ 'customerEmails' => ['customer2@example.com', 'customer3@example.com'], - 'constraint' => self::equalTo(['A total of 2 record(s) were deleted.']), + 'constraint' => $this->equalTo(['A total of 2 record(s) were deleted.']), 'messageType' => MessageInterface::TYPE_SUCCESS, ], ]; diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php index c2fc7b1b58756..2129d6912b7f6 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -82,7 +82,7 @@ public function testMassSubscriberAction() // Assertions $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); $this->assertSessionMessages( - self::equalTo(['A total of 2 record(s) were updated.']), + $this->equalTo(['A total of 2 record(s) were updated.']), MessageInterface::TYPE_SUCCESS ); $this->assertEquals( @@ -114,7 +114,7 @@ public function testMassSubscriberActionNoSelection() $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); $this->assertSessionMessages( - self::equalTo(['An item needs to be selected. Select and try again.']), + $this->equalTo(['An item needs to be selected. Select and try again.']), MessageInterface::TYPE_ERROR ); } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Section/LoadTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Section/LoadTest.php index 3db22b8379850..b7a2f2ca6e3b5 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Section/LoadTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Section/LoadTest.php @@ -16,6 +16,6 @@ public function testLoadInvalidSection() $this->dispatch( '/customer/section/load/?sections=sectiongetResponse()->getBody()); + $this->assertEquals(json_encode($expected), $this->getResponse()->getBody()); } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php index 381c580f55e60..000f4d65b0eea 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/AddressRepositoryTest.php @@ -503,7 +503,7 @@ public function testSaveAddressWithRestrictedCountries() ]; $address = $this->addressFactory->create(['data' => $addressData]); $saved = $this->repository->save($address); - self::assertNotEmpty($saved->getId()); + $this->assertNotEmpty($saved->getId()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Developer/Console/Command/SourceThemeDeployCommandTest.php b/dev/tests/integration/testsuite/Magento/Developer/Console/Command/SourceThemeDeployCommandTest.php index d5dd68a52b554..ba4243f15d0d6 100644 --- a/dev/tests/integration/testsuite/Magento/Developer/Console/Command/SourceThemeDeployCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Developer/Console/Command/SourceThemeDeployCommandTest.php @@ -79,7 +79,7 @@ public function testExecute() $this->clearStaticDirectory(); - self::assertEmpty($error, implode($error)); + $this->assertEmpty($error, implode($error)); } /** @@ -121,7 +121,7 @@ private function getInputMock() $inputMock = $this->getMockBuilder(InputInterface::class) ->getMockForAbstractClass(); - $inputMock->expects(self::exactly(4)) + $inputMock->expects($this->exactly(4)) ->method('getOption') ->willReturnMap( [ @@ -131,7 +131,7 @@ private function getInputMock() ['type', self::TYPE_TEST_VALUE] ] ); - $inputMock->expects(self::once()) + $inputMock->expects($this->once()) ->method('getArgument') ->with('file') ->willReturn($this->compiledFiles); diff --git a/dev/tests/integration/testsuite/Magento/Directory/Model/CurrencyConfigTest.php b/dev/tests/integration/testsuite/Magento/Directory/Model/CurrencyConfigTest.php index b620d9097b4be..62f5673717030 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/Model/CurrencyConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Directory/Model/CurrencyConfigTest.php @@ -78,23 +78,23 @@ public function testGetConfigCurrencies(string $areaCode, array $expected) $storeManager->setCurrentStore($store->getId()); if ($areaCode === Area::AREA_ADMINHTML) { - self::assertEquals($expected['allowed'], $this->currency->getConfigAllowCurrencies()); - self::assertEquals($expected['base'], $this->currency->getConfigBaseCurrencies()); - self::assertEquals($expected['default'], $this->currency->getConfigDefaultCurrencies()); + $this->assertEquals($expected['allowed'], $this->currency->getConfigAllowCurrencies()); + $this->assertEquals($expected['base'], $this->currency->getConfigBaseCurrencies()); + $this->assertEquals($expected['default'], $this->currency->getConfigDefaultCurrencies()); } else { /** @var StoreManagerInterface $storeManager */ $storeManager = Bootstrap::getObjectManager()->get(StoreManagerInterface::class); foreach ($storeManager->getStores() as $store) { $storeManager->setCurrentStore($store->getId()); - self::assertEquals( + $this->assertEquals( $expected[$store->getCode()]['allowed'], $this->currency->getConfigAllowCurrencies() ); - self::assertEquals( + $this->assertEquals( $expected[$store->getCode()]['base'], $this->currency->getConfigBaseCurrencies() ); - self::assertEquals( + $this->assertEquals( $expected[$store->getCode()]['default'], $this->currency->getConfigDefaultCurrencies() ); diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php b/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php index 60c2a41fae49f..70c17cbc34004 100644 --- a/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php +++ b/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php @@ -70,9 +70,9 @@ public function testUploadProhibitedExtensions($fileName) $body = $this->getResponse()->getBody(); $result = Bootstrap::getObjectManager()->get(Json::class)->unserialize($body); - self::assertArrayHasKey('errorcode', $result); - self::assertEquals(0, $result['errorcode']); - self::assertEquals('Disallowed file type.', $result['error']); + $this->assertArrayHasKey('errorcode', $result); + $this->assertEquals(0, $result['errorcode']); + $this->assertEquals('Disallowed file type.', $result['error']); } /** diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php index fcd8226aec50c..24714530b3b8f 100644 --- a/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php @@ -67,9 +67,9 @@ protected function tearDown() public function testExecute() { $fulltextIndexer = $this->getIndexer(FulltextIndexer::INDEXER_ID); - self::assertTrue($fulltextIndexer->isValid(), 'Fulltext indexer should be valid.'); + $this->assertTrue($fulltextIndexer->isValid(), 'Fulltext indexer should be valid.'); $categoryIndexer = $this->getIndexer(CategoryIndexer::INDEXER_ID); - self::assertTrue($categoryIndexer->isValid(), 'Category indexer should be valid.'); + $this->assertTrue($categoryIndexer->isValid(), 'Category indexer should be valid.'); $category = $this->getCategory('Category 1'); $productIdList = $this->getProductIdList(['simple1', 'simple2', 'simple3']); @@ -83,14 +83,14 @@ public function testExecute() $this->getRequest()->setMethod('POST'); $this->dispatch('backend/catalog/category/save'); $this->assertSessionMessages( - self::equalTo(['You saved the category.']), + $this->equalTo(['You saved the category.']), MessageInterface::TYPE_SUCCESS ); $fulltextIndexer = $this->getIndexer(FulltextIndexer::INDEXER_ID); - self::assertTrue($fulltextIndexer->isInvalid(), 'Fulltext indexer should be invalidated.'); + $this->assertTrue($fulltextIndexer->isInvalid(), 'Fulltext indexer should be invalidated.'); $categoryIndexer = $this->getIndexer(CategoryIndexer::INDEXER_ID); - self::assertTrue($categoryIndexer->isInvalid(), 'Category indexer should be invalidated.'); + $this->assertTrue($categoryIndexer->isInvalid(), 'Category indexer should be invalidated.'); } /** diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php index d40ce9e8a0706..6e98c823e24a0 100644 --- a/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php @@ -76,7 +76,7 @@ public function testSearchAll() { $this->reindexAll(); $result = $this->searchByName('Configurable Product'); - self::assertGreaterThanOrEqual(2, $result); + $this->assertGreaterThanOrEqual(2, $result); } /** @@ -90,10 +90,10 @@ public function testSearchSpecificProduct() { $this->reindexAll(); $result = $this->searchByName('12345'); - self::assertCount(1, $result); + $this->assertCount(1, $result); $specificProduct = $this->productRepository->get('configurable_12345'); - self::assertEquals($specificProduct->getId(), $result[0]['_id']); + $this->assertEquals($specificProduct->getId(), $result[0]['_id']); } /** diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php index 9ac778da91f29..93516a11392ed 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/App/Filesystem/CreatePdfFileTest.php @@ -39,18 +39,18 @@ public function testGenerateFileFromString() $contentTypeHeader = $response->getHeader('Content-type'); /* Check the system returns the correct type */ - self::assertEquals("Content-Type: $contentType", $contentTypeHeader->toString()); + $this->assertEquals("Content-Type: $contentType", $contentTypeHeader->toString()); $varDirectory = $filesystem->getDirectoryRead(DirectoryList::VAR_DIR); $varDirectory->isFile($filename); /* Check the file is generated */ - self::assertTrue($varDirectory->isFile($filename)); + $this->assertTrue($varDirectory->isFile($filename)); /* Check the file is removed after generation if the corresponding option is set */ $fileContent = ['type' => 'string', 'value' => '', 'rm' => true]; $fileFactory->create($filename, $fileContent, DirectoryList::VAR_DIR, $contentType); - self::assertFalse($varDirectory->isFile($filename)); + $this->assertFalse($varDirectory->isFile($filename)); } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Config/ConverterTest.php b/dev/tests/integration/testsuite/Magento/Framework/Config/ConverterTest.php index 5b39a2afb9d6c..069a952bbed56 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Config/ConverterTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Config/ConverterTest.php @@ -29,7 +29,7 @@ public function testParseVarElement($sourceString, $expected) $document->loadXML($sourceString); $actual = $this->converter->convert($document); - self::assertEquals( + $this->assertEquals( $expected, $actual ); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Console/CliTest.php b/dev/tests/integration/testsuite/Magento/Framework/Console/CliTest.php index 7a439d84ce563..db35c071fad80 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Console/CliTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Console/CliTest.php @@ -103,7 +103,7 @@ public function testDocumentRootIsPublic($isPub, $params) $documentRootResolver = $cliReflection->getMethod('documentRootResolver'); $documentRootResolver->setAccessible(true); - self::assertEquals($params, $documentRootResolver->invoke($cli)); + $this->assertEquals($params, $documentRootResolver->invoke($cli)); } /** diff --git a/dev/tests/integration/testsuite/Magento/Framework/Data/Argument/Interpreter/BaseStringUtilsTest.php b/dev/tests/integration/testsuite/Magento/Framework/Data/Argument/Interpreter/BaseStringUtilsTest.php index c437eb509462d..83a6820c86a14 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Data/Argument/Interpreter/BaseStringUtilsTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Data/Argument/Interpreter/BaseStringUtilsTest.php @@ -42,7 +42,7 @@ protected function setUp() $translateRenderer = $this->getMockBuilder(RendererInterface::class) ->setMethods(['render']) ->getMockForAbstractClass(); - $translateRenderer->expects(self::never())->method('render'); + $translateRenderer->expects($this->never())->method('render'); \Magento\Framework\Phrase::setRenderer($translateRenderer); } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php b/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php index 5f53e62165502..f1d7f030894d4 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Filesystem/Driver/FileTest.php @@ -117,10 +117,10 @@ public function testSymlinks(): void $linkName = $destinationDirectory . '/link'; - self::assertTrue($this->driver->isWritable($destinationDirectory)); - self::assertTrue($this->driver->symlink($sourceDirectory, $linkName)); - self::assertTrue($this->driver->isExists($linkName)); - self::assertTrue($this->driver->deleteDirectory($linkName)); + $this->assertTrue($this->driver->isWritable($destinationDirectory)); + $this->assertTrue($this->driver->symlink($sourceDirectory, $linkName)); + $this->assertTrue($this->driver->isExists($linkName)); + $this->assertTrue($this->driver->deleteDirectory($linkName)); } /** diff --git a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/Config/Reader/DomTest.php b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/Config/Reader/DomTest.php index 0b222ea289171..1f84cd2544841 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/Config/Reader/DomTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/ObjectManager/Config/Reader/DomTest.php @@ -66,7 +66,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); /** check arguments won't be translated for ObjectManager, even if has attribute 'translate'=true. */ - $renderer->expects(self::never()) + $renderer->expects($this->never()) ->method('render'); Phrase::setRenderer($renderer); diff --git a/dev/tests/integration/testsuite/Magento/GiftMessage/Observer/SalesEventQuoteMergeTest.php b/dev/tests/integration/testsuite/Magento/GiftMessage/Observer/SalesEventQuoteMergeTest.php index 0902c35568ee3..cf48dc562277d 100644 --- a/dev/tests/integration/testsuite/Magento/GiftMessage/Observer/SalesEventQuoteMergeTest.php +++ b/dev/tests/integration/testsuite/Magento/GiftMessage/Observer/SalesEventQuoteMergeTest.php @@ -35,6 +35,6 @@ public function testQuoteMerge() ] ); - self::assertEquals($giftMessageId, $targetQuote->getGiftMessageId()); + $this->assertEquals($giftMessageId, $targetQuote->getGiftMessageId()); } } diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php index ed283d196e69c..1cace6f90d7af 100644 --- a/dev/tests/integration/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php +++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/Model/Product/Type/GroupedTest.php @@ -166,14 +166,14 @@ public function testOutOfStockSubProduct(bool $outOfStockShown, array $data, arr /** @var Grouped $groupedProduct */ $groupedProduct = $this->objectManager->get(Grouped::class); $actual = $groupedProduct->prepareForCartAdvanced($buyRequest, $product, Grouped::PROCESS_MODE_FULL); - self::assertEquals( + $this->assertEquals( count($expected), count($actual) ); /** @var Product $product */ foreach ($actual as $product) { $sku = $product->getSku(); - self::assertEquals( + $this->assertEquals( $expected[$sku], $product->getCartQty(), "Failed asserting that Product Cart Quantity matches expected" diff --git a/dev/tests/integration/testsuite/Magento/Multishipping/Model/Checkout/Type/MultishippingTest.php b/dev/tests/integration/testsuite/Magento/Multishipping/Model/Checkout/Type/MultishippingTest.php index b4222c0d0189d..e78f530329f96 100644 --- a/dev/tests/integration/testsuite/Magento/Multishipping/Model/Checkout/Type/MultishippingTest.php +++ b/dev/tests/integration/testsuite/Magento/Multishipping/Model/Checkout/Type/MultishippingTest.php @@ -105,8 +105,8 @@ public function testGetCustomerDefaultAddress($addressType) $addressId = $this->model->$methodName(); $address = $this->addressRepository->getById($addressId); - self::assertEquals($secondFixtureAddressId, $address->getId(), "Invalid address loaded."); - self::assertEquals( + $this->assertEquals($secondFixtureAddressId, $address->getId(), "Invalid address loaded."); + $this->assertEquals( $secondFixtureAddressStreet, $address->getStreet(), "Street in default {$addressType} address is invalid." @@ -120,7 +120,7 @@ public function testGetCustomerDefaultAddress($addressType) $address = $this->addressRepository->getById($addressId); - self::assertEquals( + $this->assertEquals( $secondFixtureAddressId, $address->getId(), "Method results are not cached properly." @@ -161,8 +161,8 @@ public function testGetCustomerDefaultAddressDefaultAddressNotSet($addressType) $addressId = $this->model->$methodName(); $address = $this->addressRepository->getById($addressId); - self::assertEquals($firstFixtureAddressId, $address->getId(), "Invalid address loaded."); - self::assertEquals( + $this->assertEquals($firstFixtureAddressId, $address->getId(), "Invalid address loaded."); + $this->assertEquals( $firstFixtureAddressStreet, $address->getStreet(), "Street in default {$addressType} address is invalid." @@ -199,7 +199,7 @@ public function testGetCustomerDefaultAddressCustomerWithoutAddresses($addressTy $methodName = 'getCustomerDefault' . ucfirst($addressType) . 'Address'; $address = $this->model->$methodName(); - self::assertNull($address, "When customer has no addresses, null is expected."); + $this->assertNull($address, "When customer has no addresses, null is expected."); } /** @@ -230,7 +230,7 @@ public function testCreateOrders() $this->model->createOrders(); $orderList = $this->getOrderList((int)$quote->getId()); - self::assertCount(3, $orderList); + $this->assertCount(3, $orderList); /** * @var Order $firstOrder @@ -433,7 +433,7 @@ private function performOrderAddressAssertions(OrderAddressInterface $address, a { foreach ($expected as $key => $item) { $methodName = 'get' . ucfirst($key); - self::assertEquals($item, $address->$methodName(), 'The "'. $key . '" does not match.'); + $this->assertEquals($item, $address->$methodName(), 'The "'. $key . '" does not match.'); } } @@ -474,6 +474,6 @@ private function findAddressInQuote(array $searchAddress, Quote $quote) */ private function performOrderTotalAssertions(float $total, float $expected) { - self::assertEquals($expected, $total, 'Order total amount does not match.'); + $this->assertEquals($expected, $total, 'Order total amount does not match.'); } } diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php index abdefdbe4782b..6caf6f461e40b 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/ConfigTest.php @@ -48,13 +48,13 @@ protected function setUp() public function testGetActiveMethods() { $paymentMethods = $this->model->getActiveMethods(); - static::assertNotEmpty($paymentMethods); + $this->assertNotEmpty($paymentMethods); /** @var \Magento\Payment\Model\MethodInterface $method */ foreach ($paymentMethods as $method) { - static::assertNotEmpty($method->getCode()); - static::assertTrue($method->isActive()); - static::assertEquals(0, $method->getStore()); + $this->assertNotEmpty($method->getCode()); + $this->assertTrue($method->isActive()); + $this->assertEquals(0, $method->getStore()); } } diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Payflow/SilentPostTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Payflow/SilentPostTest.php index 81a9587d36f4a..e330bfce4f03c 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Controller/Payflow/SilentPostTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Controller/Payflow/SilentPostTest.php @@ -77,11 +77,11 @@ public function testSuccessfulNotification($resultCode, $orderState, $orderStatu $this->dispatch('paypal/payflow/silentPost'); - self::assertEquals(200, $this->getResponse()->getStatusCode()); + $this->assertEquals(200, $this->getResponse()->getStatusCode()); $order = $this->getOrder($orderIncrementId); - self::assertEquals($orderState, $order->getState()); - self::assertEquals($orderStatus, $order->getStatus()); + $this->assertEquals($orderState, $order->getState()); + $this->assertEquals($orderStatus, $order->getStatus()); } /** @@ -117,13 +117,13 @@ public function testFraudulentNotification() $this->_objectManager->addSharedInstance($logger, Monolog::class); $exception = new CommandException(__('Response message from PayPal gateway')); - $logger->expects(self::once()) + $logger->expects($this->once()) ->method('critical') - ->with(self::equalTo($exception)); + ->with($this->equalTo($exception)); $this->dispatch('paypal/payflow/silentPost'); - self::assertEquals(200, $this->getResponse()->getStatusCode()); + $this->assertEquals(200, $this->getResponse()->getStatusCode()); $this->_objectManager->removeSharedInstance(Monolog::class); } diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Api/PayflowNvpTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Api/PayflowNvpTest.php index 1b3d6aef39aa9..58c15ebc21937 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Api/PayflowNvpTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Api/PayflowNvpTest.php @@ -103,7 +103,7 @@ public function testRequestLineItems() 'https://payflowpro.paypal.com/transaction', '1.1', ['PAYPAL-NVP: Y'], - self::equalTo($request) + $this->equalTo($request) ); $this->httpClient->method('read') diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Hostedpro/RequestTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Hostedpro/RequestTest.php index 93bd7f62a9916..1ec16d0e8e39e 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Hostedpro/RequestTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Hostedpro/RequestTest.php @@ -45,7 +45,7 @@ public function testSetOrder() $this->model->setOrder($order); $addressData = require(__DIR__ . '/../../_files/address_data.php'); - static::assertEquals($incrementId, $this->model->getInvoice()); + $this->assertEquals($incrementId, $this->model->getInvoice()); $this->assertAddress($addressData, 'billing'); $this->assertAddress($addressData); @@ -61,12 +61,12 @@ protected function assertAddress(array $address, $type = '') { $type = !empty($type) ? $type . '_' : ''; - static::assertEquals($address['firstname'], $this->model->getData($type.'first_name')); - static::assertEquals($address['lastname'], $this->model->getData($type.'last_name')); - static::assertEquals($address['city'], $this->model->getData($type.'city')); - static::assertEquals($address['region'], $this->model->getData($type.'state')); - static::assertEquals($address['country_id'], $this->model->getData($type.'country')); - static::assertEquals($address['postcode'], $this->model->getData($type.'zip')); - static::assertEquals($address['street'], $this->model->getData($type.'address1')); + $this->assertEquals($address['firstname'], $this->model->getData($type.'first_name')); + $this->assertEquals($address['lastname'], $this->model->getData($type.'last_name')); + $this->assertEquals($address['city'], $this->model->getData($type.'city')); + $this->assertEquals($address['region'], $this->model->getData($type.'state')); + $this->assertEquals($address['country_id'], $this->model->getData($type.'country')); + $this->assertEquals($address['postcode'], $this->model->getData($type.'zip')); + $this->assertEquals($address['street'], $this->model->getData($type.'address1')); } } diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/HostedproTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/HostedproTest.php index 41b1ed18ba272..1932f1e1e6601 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/HostedproTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/HostedproTest.php @@ -65,7 +65,7 @@ public function testInitialize() $this->model->setInfoInstance($payment); - $this->api->expects(static::once()) + $this->api->expects($this->once()) ->method('call') ->willReturn([ 'EMAILLINK' => 'https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/' @@ -74,9 +74,9 @@ public function testInitialize() $state = $this->objectManager->create(DataObject::class); $this->model->initialize(Config::PAYMENT_ACTION_AUTH, $state); - static::assertEquals(Order::STATE_PENDING_PAYMENT, $state->getState()); - static::assertEquals(Order::STATE_PENDING_PAYMENT, $state->getStatus()); - static::assertFalse($state->getIsNotified()); + $this->assertEquals(Order::STATE_PENDING_PAYMENT, $state->getState()); + $this->assertEquals(Order::STATE_PENDING_PAYMENT, $state->getStatus()); + $this->assertFalse($state->getIsNotified()); } /** @@ -89,7 +89,7 @@ protected function getConfig() ->disableOriginalConstructor() ->setMethods(['getValue']) ->getMock(); - $config->expects(static::any()) + $config->expects($this->any()) ->method('getValue') ->with('payment_action') ->willReturn(Config::PAYMENT_ACTION_AUTH); @@ -108,10 +108,10 @@ protected function getProFactory() ->getMock(); $config = $this->getConfig(); - $pro->expects(static::any()) + $pro->expects($this->any()) ->method('getConfig') ->willReturn($config); - $pro->expects(static::any()) + $pro->expects($this->any()) ->method('getApi') ->willReturn($this->api); @@ -119,7 +119,7 @@ protected function getProFactory() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $proFactory->expects(static::once()) + $proFactory->expects($this->once()) ->method('create') ->willReturn($pro); return $proFactory; diff --git a/dev/tests/integration/testsuite/Magento/Paypal/Model/Payflow/Service/Request/SecureTokenTest.php b/dev/tests/integration/testsuite/Magento/Paypal/Model/Payflow/Service/Request/SecureTokenTest.php index 04fb36312f300..f78fca2ef4813 100644 --- a/dev/tests/integration/testsuite/Magento/Paypal/Model/Payflow/Service/Request/SecureTokenTest.php +++ b/dev/tests/integration/testsuite/Magento/Paypal/Model/Payflow/Service/Request/SecureTokenTest.php @@ -165,7 +165,7 @@ private function execute( $self = $this; $this->gateway->method('postRequest') /** @var DataObject $request */ - ->with(self::callback(function ($request) use ($self, $expPartner, $expVendor, $expUser, $expPwd) { + ->with($this->callback(function ($request) use ($self, $expPartner, $expVendor, $expUser, $expPwd) { $self->performAssertion($expPartner, $request->getPartner(), '{Partner}'); $self->performAssertion($expVendor, $request->getVendor(), '{Vendor}'); $self->performAssertion($expUser, $request->getUser(), '{User}'); @@ -189,7 +189,7 @@ private function execute( */ private function performAssertion(string $expected, string $actual, string $property): void { - self::assertEquals($expected, $actual, "$property should match."); + $this->assertEquals($expected, $actual, "$property should match."); } /** diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/MaskedQuoteIdToQuoteIdTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/MaskedQuoteIdToQuoteIdTest.php index 8d4a2ab4899ac..ea25465c68474 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/MaskedQuoteIdToQuoteIdTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/MaskedQuoteIdToQuoteIdTest.php @@ -34,7 +34,7 @@ public function testMaskedIdToQuoteId() $maskedQuoteId = $this->guestCartManagement->createEmptyCart(); $quoteId = $this->maskedQuoteIdToQuoteId->execute($maskedQuoteId); - self::assertGreaterThan(0, $quoteId); + $this->assertGreaterThan(0, $quoteId); } public function testMaskedQuoteIdToQuoteIdForNonExistentQuote() diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteIdToMaskedQuoteIdTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteIdToMaskedQuoteIdTest.php index 9301b76104d14..6b37042733752 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteIdToMaskedQuoteIdTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteIdToMaskedQuoteIdTest.php @@ -45,7 +45,7 @@ public function testMaskedQuoteId() $this->quoteResource->load($quote, 'test01', 'reserved_order_id'); $maskedQuoteId = $this->quoteIdToMaskedQuoteId->execute((int) $quote->getId()); - self::assertNotEmpty($maskedQuoteId); + $this->assertNotEmpty($maskedQuoteId); } public function testMaskedQuoteIdWithNonExistentQuoteId() diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteManagementTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteManagementTest.php index 356117f2b3dc8..b5ca8891704fc 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteManagementTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteManagementTest.php @@ -57,11 +57,11 @@ public function testSubmit() $order = $orderRepository->get($orderId); $orderItems = $order->getItems(); - self::assertCount(3, $orderItems); + $this->assertCount(3, $orderItems); foreach ($orderItems as $orderItem) { if ($orderItem->getProductType() == Type::TYPE_SIMPLE) { - self::assertNotEmpty($orderItem->getParentItem(), 'Parent is not set for child product'); - self::assertNotEmpty($orderItem->getParentItemId(), 'Parent is not set for child product'); + $this->assertNotEmpty($orderItem->getParentItem(), 'Parent is not set for child product'); + $this->assertNotEmpty($orderItem->getParentItemId(), 'Parent is not set for child product'); } } } diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php index 72c5d7736a30d..cab08812ad0f4 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php @@ -556,8 +556,8 @@ public function testMerge( $customerQuote->merge($guestQuote); $mergedItemItem = $customerQuote->getItemByProduct($product); - self::assertEquals($expectedOrderGiftMessageId, $customerQuote->getGiftMessageId()); - self::assertEquals($expectedItemGiftMessageId, $mergedItemItem->getGiftMessageId()); + $this->assertEquals($expectedOrderGiftMessageId, $customerQuote->getGiftMessageId()); + $this->assertEquals($expectedItemGiftMessageId, $mergedItemItem->getGiftMessageId()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Review/Observer/ProcessProductAfterDeleteEventObserverTest.php b/dev/tests/integration/testsuite/Magento/Review/Observer/ProcessProductAfterDeleteEventObserverTest.php index 8c1fd8eca70f9..58fda7088a672 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Observer/ProcessProductAfterDeleteEventObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Observer/ProcessProductAfterDeleteEventObserverTest.php @@ -32,12 +32,12 @@ public function testReviewIsRemovedWhenProductDeleted() $reviewsCollection = $objectManager->get(ReviewCollectionFactory::class)->create(); $reviewsCollection->addEntityFilter('product', $product->getId()); - self::assertEquals(1, $reviewsCollection->count()); + $this->assertEquals(1, $reviewsCollection->count()); /* Remove product and ensure that the product review is removed as well */ $productRepository->delete($product); $reviewsCollection->clear(); - self::assertEquals(0, $reviewsCollection->count()); + $this->assertEquals(0, $reviewsCollection->count()); } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php index f5a22ec19ccf3..44bf924e5d4bf 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AddressTest.php @@ -76,8 +76,8 @@ public function testGetAddressCollection() ->willReturn($customer->getId()); $actual = $this->block->getAddressCollection(); - self::assertNotEmpty($actual); - self::assertEquals($addresses, $actual); + $this->assertNotEmpty($actual); + $this->assertEquals($addresses, $actual); } /** @@ -139,7 +139,7 @@ public function testGetAddressCollectionJson() ]; $actual = json_decode($this->block->getAddressCollectionJson(), true); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** @@ -161,7 +161,7 @@ public function testGetAddressAsString() ]; $address = $this->objectManager->create(AddressInterface::class, ['data' => $data]); $expected = 'John Smith, Green str, 67, Culver City, California 90230, United States'; - self::assertEquals($expected, $this->block->getAddressAsString($address)); + $this->assertEquals($expected, $this->block->getAddressAsString($address)); } public function testGetForm() @@ -185,11 +185,11 @@ public function testGetForm() ]; $form = $this->block->getForm(); - self::assertEquals(1, $form->getElements()->count(), 'Form has invalid number of fieldsets'); + $this->assertEquals(1, $form->getElements()->count(), 'Form has invalid number of fieldsets'); /** @var Fieldset $fieldset */ $fieldset = $form->getElements()[0]; - self::assertEquals( + $this->assertEquals( count($expectedFields), $fieldset->getElements()->count(), 'Form has invalid number of fields' @@ -197,7 +197,7 @@ public function testGetForm() /** @var AbstractElement $element */ foreach ($fieldset->getElements() as $element) { - self::assertTrue( + $this->assertTrue( in_array($element->getId(), $expectedFields), sprintf('Unexpected field "%s" in form.', $element->getId()) ); @@ -206,7 +206,7 @@ public function testGetForm() /** @var \Magento\Framework\Data\Form\Element\Select $countryIdField */ $countryIdField = $fieldset->getElements()->searchById('country_id'); $actual = Xpath::getElementsCountForXpath('//option', $countryIdField->getElementHtml()); - self::assertEquals($this->getNumberOfCountryOptions(), $actual); + $this->assertEquals($this->getNumberOfCountryOptions(), $actual); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php index abdbab2c24d16..2a9db48a9fe9f 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/FormTest.php @@ -103,7 +103,7 @@ public function testOrderDataJson() 'quote_id' => $quote->getId() ]; - self::assertEquals($expected, json_decode($this->block->getOrderDataJson(), true)); + $this->assertEquals($expected, json_decode($this->block->getOrderDataJson(), true)); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php index e2638b5df1f88..3d668d130748f 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php @@ -52,7 +52,7 @@ public function testExecuteWithPaymentOperation() $this->dispatch('backend/sales/order_create/save'); $this->assertSessionMessages( - self::equalTo(['Transaction has been declined.']), + $this->equalTo(['Transaction has been declined.']), MessageInterface::TYPE_ERROR ); @@ -60,8 +60,8 @@ public function testExecuteWithPaymentOperation() $customerRepository = $this->_objectManager->get(CustomerRepositoryInterface::class); $customer = $customerRepository->get($email); - self::assertNotEmpty($session->getCustomerId()); - self::assertEquals($customer->getId(), $session->getCustomerId()); + $this->assertNotEmpty($session->getCustomerId()); + $this->assertEquals($customer->getId(), $session->getCustomerId()); $this->_objectManager->removeSharedInstance(OrderService::class); } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php index a07616474a410..793c2357542e0 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreateTest.php @@ -368,17 +368,17 @@ public function testSyncBetweenQuoteAddresses() ); $this->dispatch('backend/sales/order_create/loadBlock/block/shipping_address'); - self::assertEquals(200, $this->getResponse()->getHttpResponseCode()); + $this->assertEquals(200, $this->getResponse()->getHttpResponseCode()); $updatedQuote = $quoteRepository->get($quote->getId()); $billingAddress = $updatedQuote->getBillingAddress(); - self::assertEquals($data['region_id'], $billingAddress->getRegionId()); - self::assertEquals($data['country_id'], $billingAddress->getCountryId()); + $this->assertEquals($data['region_id'], $billingAddress->getRegionId()); + $this->assertEquals($data['country_id'], $billingAddress->getCountryId()); $shippingAddress = $updatedQuote->getShippingAddress(); - self::assertEquals($data['city'], $shippingAddress->getCity()); - self::assertEquals($data['street'], $shippingAddress->getStreet()); + $this->assertEquals($data['city'], $shippingAddress->getCity()); + $this->assertEquals($data['street'], $shippingAddress->getStreet()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php index b1a8d8e685226..4b4da677f69ee 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/AdminOrder/CreateTest.php @@ -59,12 +59,12 @@ public function testInitFromOrderShippingAddressSameAsBillingWhenEmpty() /** @var $order Order */ $order = $this->objectManager->create(Order::class); $order->loadByIncrementId('100000001'); - self::assertNull($order->getShippingAddress()); + $this->assertNull($order->getShippingAddress()); $this->objectManager->get(Registry::class)->unregister('rule_data'); $this->model->initFromOrder($order); - self::assertNull($order->getShippingAddress()); + $this->assertNull($order->getShippingAddress()); } /** @@ -88,12 +88,12 @@ public function testInitFromOrderAndCreateOrderFromQuoteWithAdditionalOptions() $quoteItems = $orderCreate->getQuote()->getItemsCollection(); - self::assertEquals(1, $quoteItems->count()); + $this->assertEquals(1, $quoteItems->count()); $quoteItem = $quoteItems->getFirstItem(); $quoteItemOptions = $quoteItem->getOptionsByCode(); - self::assertEquals( + $this->assertEquals( $serializer->serialize(['additional_option_key' => 'additional_option_value']), $quoteItemOptions['additional_options']->getValue() ); @@ -115,7 +115,7 @@ public function testInitFromOrderAndCreateOrderFromQuoteWithAdditionalOptions() $newOrder = $this->model->createOrder(); $newOrderItems = $newOrder->getItemsCollection(); - self::assertEquals(1, $newOrderItems->count()); + $this->assertEquals(1, $newOrderItems->count()); $order->loadByIncrementId('100000001'); $this->assertEquals($newOrder->getRealOrderId(), $order->getRelationChildRealId()); @@ -123,7 +123,7 @@ public function testInitFromOrderAndCreateOrderFromQuoteWithAdditionalOptions() $newOrderItem = $newOrderItems->getFirstItem(); - self::assertEquals( + $this->assertEquals( ['additional_option_key' => 'additional_option_value'], $newOrderItem->getProductOptionByCode('additional_options') ); @@ -141,7 +141,7 @@ public function testInitFromOrderShippingAddressSameAsBillingWhenSame() $order = $this->objectManager->create(Order::class); $order->loadByIncrementId('100000001'); - self::assertNull($order->getShippingAddress()->getSameAsBilling()); + $this->assertNull($order->getShippingAddress()->getSameAsBilling()); /** @var OrderAddressExtensionInterface $shippingExtAttributes */ $shippingExtAttributes = $this->objectManager->get(OrderAddressExtensionInterfaceFactory::class) @@ -158,7 +158,7 @@ public function testInitFromOrderShippingAddressSameAsBillingWhenSame() $this->objectManager->get(Registry::class)->unregister('rule_data'); $this->model->initFromOrder($order); - self::assertTrue($order->getShippingAddress()->getSameAsBilling()); + $this->assertTrue($order->getShippingAddress()->getSameAsBilling()); } /** @@ -173,12 +173,12 @@ public function testInitFromOrderShippingAddressSameAsBillingWhenDifferent() $order = $this->objectManager->create(Order::class); $order->loadByIncrementId('100000002'); - self::assertNull($order->getShippingAddress()->getSameAsBilling()); + $this->assertNull($order->getShippingAddress()->getSameAsBilling()); $this->objectManager->get(Registry::class)->unregister('rule_data'); $this->model->initFromOrder($order); - self::assertFalse($order->getShippingAddress()->getSameAsBilling()); + $this->assertFalse($order->getShippingAddress()->getSameAsBilling()); } /** @@ -192,18 +192,18 @@ public function testInitFromOrderCcInformationDeleted() $order->loadByIncrementId('100000001'); $payment = $order->getPayment(); - self::assertEquals('5', $payment->getCcExpMonth()); - self::assertEquals('2016', $payment->getCcExpYear()); - self::assertEquals('AE', $payment->getCcType()); - self::assertEquals('0005', $payment->getCcLast4()); + $this->assertEquals('5', $payment->getCcExpMonth()); + $this->assertEquals('2016', $payment->getCcExpYear()); + $this->assertEquals('AE', $payment->getCcType()); + $this->assertEquals('0005', $payment->getCcLast4()); $this->objectManager->get(Registry::class)->unregister('rule_data'); $payment = $this->model->initFromOrder($order)->getQuote()->getPayment(); - self::assertNull($payment->getCcExpMonth()); - self::assertNull($payment->getCcExpYear()); - self::assertNull($payment->getCcType()); - self::assertNull($payment->getCcLast4()); + $this->assertNull($payment->getCcExpMonth()); + $this->assertNull($payment->getCcExpYear()); + $this->assertNull($payment->getCcType()); + $this->assertNull($payment->getCcLast4()); } /** @@ -222,13 +222,13 @@ public function testInitFromOrderWithEmptyPaymentDetails() $initOrder = $this->model->initFromOrder($order); $payment = $initOrder->getQuote()->getPayment(); - self::assertEquals($initOrder->getQuote()->getId(), $payment->getData('quote_id')); + $this->assertEquals($initOrder->getQuote()->getId(), $payment->getData('quote_id')); $payment->unsetData('quote_id'); - self::assertEmpty($payment->getMethod()); - self::assertEmpty($payment->getAdditionalInformation()); - self::assertEmpty($payment->getAdditionalData()); - self::assertEmpty($payment->getData()); + $this->assertEmpty($payment->getMethod()); + $this->assertEmpty($payment->getAdditionalInformation()); + $this->assertEmpty($payment->getAdditionalData()); + $this->assertEmpty($payment->getData()); } /** @@ -239,7 +239,7 @@ public function testGetCustomerWishlistNoCustomerId() /** @var SessionQuote $session */ $session = $this->objectManager->create(SessionQuote::class); $session->setCustomerId(null); - self::assertFalse( + $this->assertFalse( $this->model->getCustomerWishlist(true), 'If customer ID is not set to session, false is expected to be returned.' ); @@ -261,17 +261,17 @@ public function testGetCustomerWishlist() /** Test new wishlist creation for the customer specified above */ /** @var \Magento\Wishlist\Model\Wishlist $wishlist */ $wishlist = $this->model->getCustomerWishlist(true); - self::assertInstanceOf( + $this->assertInstanceOf( \Magento\Wishlist\Model\Wishlist::class, $wishlist, 'New Wish List is expected to be created if existing Customer does not have one yet.' ); - self::assertEquals(0, $wishlist->getItemsCount(), 'New Wish List must be empty just after creation.'); + $this->assertEquals(0, $wishlist->getItemsCount(), 'New Wish List must be empty just after creation.'); /** Add new item to wishlist and try to get it using getCustomerWishlist once again */ $wishlist->addNewItem($productIdFromFixture)->save(); $updatedWishlist = $this->model->getCustomerWishlist(true); - self::assertEquals( + $this->assertEquals( 1, $updatedWishlist->getItemsCount(), 'Wish List must contain a Product which was added to it earlier.' @@ -279,12 +279,12 @@ public function testGetCustomerWishlist() /** Try to load wishlist from cache in the class after it is deleted from DB */ $wishlist->delete(); - self::assertSame( + $this->assertSame( $updatedWishlist, $this->model->getCustomerWishlist(false), 'Wish List cached in class variable is expected to be returned.' ); - self::assertNotSame( + $this->assertNotSame( $updatedWishlist, $this->model->getCustomerWishlist(true), 'New Wish List is expected to be created when cache is forced to be refreshed.' @@ -299,7 +299,7 @@ public function testSetBillingAddress() $addressData = $this->getValidAddressData(); /** Validate data before creating address object */ $this->model->setIsValidate(true)->setBillingAddress($addressData); - self::assertInstanceOf( + $this->assertInstanceOf( Quote\Address::class, $this->model->getBillingAddress(), 'Billing address object was not created.' @@ -319,8 +319,8 @@ public function testSetBillingAddress() $result = $this->model->getBillingAddress()->getData(); foreach ($expectedAddressData as $key => $value) { - self::assertArrayHasKey($key, $result); - self::assertEquals($value, $result[$key]); + $this->assertArrayHasKey($key, $result); + $this->assertEquals($value, $result[$key]); } } @@ -352,11 +352,11 @@ public function testSetBillingAddressValidationErrors() foreach ($this->messageManager->getMessages()->getItems() as $validationError) { $errorMessages[] = $validationError->getText(); } - self::assertTrue( + $this->assertTrue( in_array('Billing Address: "First Name" is a required value.', $errorMessages), 'Expected validation message is absent.' ); - self::assertTrue( + $this->assertTrue( in_array('Billing Address: "Last Name" is a required value.', $errorMessages), 'Expected validation message is absent.' ); @@ -402,7 +402,7 @@ public function testCreateOrderNewCustomerDifferentAddresses() /** @var Customer $customer */ $customer = $this->objectManager->create(Customer::class); $customer->load($order->getCustomerId()); - self::assertEquals( + $this->assertEquals( $firstNameForShippingAddress, $customer->getPrimaryShippingAddress()->getFirstname(), 'Shipping address is saved incorrectly.' @@ -443,7 +443,7 @@ public function testCreateOrderNewCustomer() $order = $this->model->createOrder(); //Check, order considering decimal qty in product. foreach ($order->getItems() as $orderItem) { - self::assertTrue($orderItem->getIsQtyDecimal()); + $this->assertTrue($orderItem->getIsQtyDecimal()); } $this->verifyCreatedOrder($order, $shippingMethod); } @@ -576,7 +576,7 @@ public function testCreateOrderExistingCustomerDifferentAddresses() ->getById($order->getCustomerId()); $address = $this->objectManager->get(AddressRepositoryInterface::class) ->getById($customer->getDefaultShipping()); - self::assertEquals( + $this->assertEquals( $firstNameForShippingAddress, $address->getFirstname(), 'Shipping address is saved incorrectly.' @@ -641,11 +641,11 @@ public function testGetCustomerCartExistingCart() /** SUT execution */ $customerQuote = $this->model->getCustomerCart(); - self::assertEquals($quoteFixture->getId(), $customerQuote->getId(), 'Quote ID is invalid.'); + $this->assertEquals($quoteFixture->getId(), $customerQuote->getId(), 'Quote ID is invalid.'); /** Try to load quote once again to ensure that caching works correctly */ $customerQuoteFromCache = $this->model->getCustomerCart(); - self::assertSame($customerQuote, $customerQuoteFromCache, 'Customer quote caching does not work correctly.'); + $this->assertSame($customerQuote, $customerQuoteFromCache, 'Customer quote caching does not work correctly.'); } /** @@ -671,8 +671,8 @@ public function testMoveQuoteItemToCart() $item = $customerQuote->getAllVisibleItems()[0]; $this->model->moveQuoteItem($item, 'cart', 3); - self::assertEquals(4, $item->getQty(), 'Number of Qty isn\'t correct for Quote item.'); - self::assertEquals(3, $item->getQtyToAdd(), 'Number of added qty isn\'t correct for Quote item.'); + $this->assertEquals(4, $item->getQty(), 'Number of Qty isn\'t correct for Quote item.'); + $this->assertEquals(3, $item->getQtyToAdd(), 'Number of added qty isn\'t correct for Quote item.'); } /** @@ -692,8 +692,8 @@ public function testGetCustomerCartNewCart() /** SUT execution */ $customerQuote = $this->model->getCustomerCart(); - self::assertNotEmpty($customerQuote->getId(), 'Quote ID is invalid.'); - self::assertEquals( + $this->assertNotEmpty($customerQuote->getId(), 'Quote ID is invalid.'); + $this->assertEquals( $customerEmailFromFixture, $customerQuote->getCustomerEmail(), 'Customer data is preserved incorrectly in a newly quote.' @@ -758,34 +758,34 @@ private function preparePreconditionsForCreateOrder( /** Check preconditions */ - self::assertEquals( + $this->assertEquals( 0, $this->messageManager->getMessages()->getCount(), "Precondition failed: Errors occurred before SUT execution." ); /** Selectively check quote data */ $createOrderData = $this->model->getData(); - self::assertEquals( + $this->assertEquals( $shippingMethod, $createOrderData['shipping_method'], 'Precondition failed: Shipping method specified in create order model is invalid' ); - self::assertEquals( + $this->assertEquals( 'FirstName', $createOrderData['billing_address']['firstname'], 'Precondition failed: Address data is invalid in create order model' ); - self::assertEquals( + $this->assertEquals( 'Simple Product', $this->model->getQuote()->getItemByProduct($product)->getData('name'), 'Precondition failed: Quote items data is invalid in create order model' ); - self::assertEquals( + $this->assertEquals( $customerEmail, $this->model->getQuote()->getCustomer()->getEmail(), 'Precondition failed: Customer data is invalid in create order model' ); - self::assertEquals( + $this->assertEquals( $paymentMethod, $this->model->getQuote()->getPayment()->getData('method'), 'Precondition failed: Payment method data is invalid in create order model' @@ -802,19 +802,19 @@ private function verifyCreatedOrder($order, $shippingMethod) { /** Selectively check order data */ $orderData = $order->getData(); - self::assertNotEmpty($orderData['increment_id'], 'Order increment ID is empty.'); - self::assertEquals($this->model->getQuote()->getId(), $orderData['quote_id'], 'Quote ID is invalid.'); - self::assertEquals( + $this->assertNotEmpty($orderData['increment_id'], 'Order increment ID is empty.'); + $this->assertEquals($this->model->getQuote()->getId(), $orderData['quote_id'], 'Quote ID is invalid.'); + $this->assertEquals( $this->model->getQuote()->getCustomer()->getEmail(), $orderData['customer_email'], 'Customer email is invalid.' ); - self::assertEquals( + $this->assertEquals( $this->model->getQuote()->getCustomer()->getFirstname(), $orderData['customer_firstname'], 'Customer first name is invalid.' ); - self::assertEquals($shippingMethod, $orderData['shipping_method'], 'Shipping method is invalid.'); + $this->assertEquals($shippingMethod, $orderData['shipping_method'], 'Shipping method is invalid.'); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/GridAsyncInsertTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/GridAsyncInsertTest.php index c300993cb220d..e47427e1071b6 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/GridAsyncInsertTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/GridAsyncInsertTest.php @@ -82,7 +82,7 @@ public function testExecuteAsyncUpdateOrderGrid() $this->orderRepository->save($order); $gridRow = $this->getGridRow($order->getEntityId()); - self::assertNotEquals($order->getStatus(), $gridRow['status']); + $this->assertNotEquals($order->getStatus(), $gridRow['status']); $this->gridAsyncInsert->asyncInsert(); $this->performUpdateAssertions($order); @@ -133,7 +133,7 @@ private function performUpdateAssertions(OrderInterface $order) { $gridRow = $this->getGridRow($order->getEntityId()); - self::assertEquals($order->getStatus(), $gridRow['status']); - self::assertEquals($order->getUpdatedAt(), $gridRow['updated_at']); + $this->assertEquals($order->getStatus(), $gridRow['status']); + $this->assertEquals($order->getUpdatedAt(), $gridRow['updated_at']); } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreditmemoFactoryTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreditmemoFactoryTest.php index f76a5c83700e7..fc10ffc6e330b 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreditmemoFactoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreditmemoFactoryTest.php @@ -54,7 +54,7 @@ public function testCreateByOrder(array $creditmemoData, $expectedQty) $order = $this->getOrder('100000001'); $creditmemoData = $this->prepareCreditMemoData($order, $creditmemoData); $creditmemo = $this->creditmemoFactory->createByOrder($order, $creditmemoData); - self::assertEquals($expectedQty, $creditmemo->getTotalQty(), 'Creditmemo has wrong total qty.'); + $this->assertEquals($expectedQty, $creditmemo->getTotalQty(), 'Creditmemo has wrong total qty.'); } /** @@ -96,7 +96,7 @@ public function testCreateByInvoice() { $invoice = $this->getInvoice('100000001'); $creditmemo = $this->creditmemoFactory->createByInvoice($invoice); - self::assertEquals(14, $creditmemo->getTotalQty(), 'Creditmemo has wrong total qty.'); + $this->assertEquals(14, $creditmemo->getTotalQty(), 'Creditmemo has wrong total qty.'); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentDocumentFactoryTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentDocumentFactoryTest.php index 7f0ec2ae92f89..3375a08c68ce9 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentDocumentFactoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentDocumentFactoryTest.php @@ -75,6 +75,6 @@ public function testCreate(): void $this->shipmentCreationArgumentsInterface ); $shipmentExtensionAttributes = $shipment->getExtensionAttributes(); - self::assertEquals('test_value', $shipmentExtensionAttributes->getTestAttributeValue()); + $this->assertEquals('test_value', $shipmentExtensionAttributes->getTestAttributeValue()); } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php index 1d04a79ae3f84..c2208602b9f59 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/ShipmentTest.php @@ -69,7 +69,7 @@ public function testPackages() $shipment->setPackages($packages); $saved = $this->shipmentRepository->save($shipment); - self::assertEquals($packages, $saved->getPackages()); + $this->assertEquals($packages, $saved->getPackages()); } /** @@ -95,7 +95,7 @@ public function testAddTrack() $shipment->addTrack($track); $this->shipmentRepository->save($shipment); $saved = $this->shipmentRepository->get((int)$shipment->getEntityId()); - self::assertNotEmpty($saved->getTracks()); + $this->assertNotEmpty($saved->getTracks()); } /** @@ -120,8 +120,8 @@ public function testAddComment() $actual = array_map(function (CommentInterface $comment) { return $comment->getComment(); }, $comments); - self::assertEquals(2, count($actual)); - self::assertEquals([$message1, $message2], $actual); + $this->assertEquals(2, count($actual)); + $this->assertEquals([$message1, $message2], $actual); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/ResourceModel/Order/Grid/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/ResourceModel/Order/Grid/CollectionTest.php index 1649706a51f6b..a3221268a6ed3 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Model/ResourceModel/Order/Grid/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/ResourceModel/Order/Grid/CollectionTest.php @@ -33,13 +33,13 @@ public function testCollectionCreate(): void $mapper->setAccessible(true); $map = $mapper->invoke($gridCollection); - self::assertInternalType('array', $map); - self::assertArrayHasKey('fields', $map); - self::assertInternalType('array', $map['fields']); - self::assertCount(count($tableDescription), $map['fields']); + $this->assertInternalType('array', $map); + $this->assertArrayHasKey('fields', $map); + $this->assertInternalType('array', $map['fields']); + $this->assertCount(count($tableDescription), $map['fields']); foreach ($map['fields'] as $mappedName) { - self::assertContains('main_table.', $mappedName); + $this->assertContains('main_table.', $mappedName); } } } diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/GenerateFixturesCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/GenerateFixturesCommandTest.php index eaa8b2f6fdbbf..05d4ee278aba0 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/GenerateFixturesCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/GenerateFixturesCommandTest.php @@ -125,13 +125,13 @@ public function testExecute() ); $this->indexerCommand->execute([]); - static::assertEquals( + $this->assertEquals( Cli::RETURN_SUCCESS, $this->indexerCommand->getStatusCode(), $this->indexerCommand->getDisplay(true) ); - static::assertEquals( + $this->assertEquals( Cli::RETURN_SUCCESS, $this->commandTester->getStatusCode(), $this->commandTester->getDisplay(true) diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/PriceIndexerDimensionsModeSetCommandTest.php b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/PriceIndexerDimensionsModeSetCommandTest.php index c25dc65ccd73c..24ab0b2fbd9f3 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/PriceIndexerDimensionsModeSetCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/PriceIndexerDimensionsModeSetCommandTest.php @@ -82,7 +82,7 @@ public function testSwitchMode($previousMode, $currentMode) $this->assertContains($expectedOutput, $actualOutput); - static::assertEquals( + $this->assertEquals( Cli::RETURN_SUCCESS, $this->commandTester->getStatusCode(), $this->commandTester->getDisplay(true) @@ -137,7 +137,7 @@ public function testSwitchModeForSameMode() $this->assertContains($expectedOutput, $actualOutput); - static::assertEquals( + $this->assertEquals( Cli::RETURN_SUCCESS, $this->commandTester->getStatusCode(), $this->commandTester->getDisplay(true) diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Model/ShippingTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Model/ShippingTest.php index 760b24db5ef30..575220b7df9d7 100644 --- a/dev/tests/integration/testsuite/Magento/Shipping/Model/ShippingTest.php +++ b/dev/tests/integration/testsuite/Magento/Shipping/Model/ShippingTest.php @@ -58,7 +58,7 @@ public function testCollectRatesByAddress() ]); /** @var Shipping $result */ $result = $this->model->collectRatesByAddress($address, 'flatrate'); - static::assertInstanceOf(Shipping::class, $result); + $this->assertInstanceOf(Shipping::class, $result); return $result->getResult(); } @@ -74,13 +74,13 @@ public function testCollectRatesByAddress() public function testCollectRates(Result $result) { $rates = $result->getAllRates(); - static::assertNotEmpty($rates); + $this->assertNotEmpty($rates); /** @var Method $rate */ $rate = array_pop($rates); - static::assertInstanceOf(Method::class, $rate); - static::assertEquals('flatrate', $rate->getData('carrier')); - static::assertEquals(5, $rate->getData('price')); + $this->assertInstanceOf(Method::class, $rate); + $this->assertEquals('flatrate', $rate->getData('carrier')); + $this->assertEquals(5, $rate->getData('price')); } } diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Block/Adminhtml/CaseInfoTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Block/Adminhtml/CaseInfoTest.php index 7607526b1389e..f1d7e47379763 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Block/Adminhtml/CaseInfoTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Block/Adminhtml/CaseInfoTest.php @@ -50,7 +50,7 @@ public function testModuleIsInactive() { $this->order->loadByIncrementId('100000001'); - self::assertNotEmpty($this->getBlock()->toHtml()); + $this->assertNotEmpty($this->getBlock()->toHtml()); } /** @@ -66,7 +66,7 @@ public function testCaseEntityNotExists() { $this->order->loadByIncrementId('100000001'); - self::assertEmpty($this->getBlock()->toHtml()); + $this->assertEmpty($this->getBlock()->toHtml()); } /** @@ -84,8 +84,8 @@ public function testCaseEntityExists() $this->order->loadByIncrementId('100000001'); $block = $this->getBlock(); - self::assertNotEmpty($block->toHtml()); - self::assertContains((string) $block->getCaseGuaranteeDisposition(), $block->toHtml()); + $this->assertNotEmpty($block->toHtml()); + $this->assertContains((string) $block->getCaseGuaranteeDisposition(), $block->toHtml()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Block/FingerprintTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Block/FingerprintTest.php index 1efbb8b6d33e4..507a547d3fc7f 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Block/FingerprintTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Block/FingerprintTest.php @@ -35,7 +35,7 @@ protected function setUp() */ public function testSessionIdPresent() { - self::assertContains('data-order-session-id', $this->getBlockContents()); + $this->assertContains('data-order-session-id', $this->getBlockContents()); } /** @@ -45,7 +45,7 @@ public function testSessionIdPresent() */ public function testBlockEmpty() { - self::assertEmpty($this->getBlockContents()); + $this->assertEmpty($this->getBlockContents()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Controller/Webhooks/HandlerTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Controller/Webhooks/HandlerTest.php index 667cb079f9096..2175ea0ed4693 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Controller/Webhooks/HandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Controller/Webhooks/HandlerTest.php @@ -45,25 +45,25 @@ public function testExecuteSuccess() $caseEntity = $caseRepository->getByCaseId($caseId); $orderEntityId = $caseEntity->getOrderId(); - self::assertNotEmpty($caseEntity); - self::assertEquals('2017-01-06 12:47:03', $caseEntity->getCreatedAt()); - self::assertEquals('2017-01-06 12:47:03', $caseEntity->getUpdatedAt()); - self::assertEquals('Magento', $caseEntity->getAssociatedTeam()['teamName']); - self::assertEquals(true, $caseEntity->isGuaranteeEligible()); - self::assertEquals(CaseInterface::STATUS_OPEN, $caseEntity->getStatus()); - self::assertEquals($orderEntityId, $caseEntity->getOrderId()); + $this->assertNotEmpty($caseEntity); + $this->assertEquals('2017-01-06 12:47:03', $caseEntity->getCreatedAt()); + $this->assertEquals('2017-01-06 12:47:03', $caseEntity->getUpdatedAt()); + $this->assertEquals('Magento', $caseEntity->getAssociatedTeam()['teamName']); + $this->assertEquals(true, $caseEntity->isGuaranteeEligible()); + $this->assertEquals(CaseInterface::STATUS_OPEN, $caseEntity->getStatus()); + $this->assertEquals($orderEntityId, $caseEntity->getOrderId()); /** @var OrderRepositoryInterface $orderRepository */ $orderRepository = $this->_objectManager->get(OrderRepositoryInterface::class); $order = $orderRepository->get($caseEntity->getOrderId()); $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); + $this->assertNotEmpty($histories); /** @var OrderStatusHistoryInterface $caseCreationComment */ $caseComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseComment); + $this->assertInstanceOf(OrderStatusHistoryInterface::class, $caseComment); - self::assertEquals( + $this->assertEquals( "Case Update: New score for the order is 384. Previous score was 553.", $caseComment->getComment() ); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseManagementTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseManagementTest.php index 30603baf867ff..01fa3f7394f72 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseManagementTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseManagementTest.php @@ -42,9 +42,9 @@ public function testCreate() $order = $this->getOrder(); $case = $this->caseManagement->create($order->getEntityId()); - self::assertNotEmpty($case->getEntityId()); - self::assertEquals(CaseInterface::STATUS_PENDING, $case->getStatus()); - self::assertEquals(CaseInterface::GUARANTEE_PENDING, $case->getGuaranteeDisposition()); + $this->assertNotEmpty($case->getEntityId()); + $this->assertEquals(CaseInterface::STATUS_PENDING, $case->getStatus()); + $this->assertEquals(CaseInterface::GUARANTEE_PENDING, $case->getGuaranteeDisposition()); } /** @@ -56,10 +56,10 @@ public function testGetByOrderId() $order = $this->getOrder(); $case = $this->caseManagement->getByOrderId($order->getEntityId()); - self::assertEquals(CaseInterface::STATUS_PROCESSING, $case->getStatus()); - self::assertEquals(CaseInterface::DISPOSITION_GOOD, $case->getReviewDisposition()); - self::assertEquals('2016-12-12 15:17:17', $case->getCreatedAt()); - self::assertEquals('2016-12-12 19:23:16', $case->getUpdatedAt()); + $this->assertEquals(CaseInterface::STATUS_PROCESSING, $case->getStatus()); + $this->assertEquals(CaseInterface::DISPOSITION_GOOD, $case->getReviewDisposition()); + $this->assertEquals('2016-12-12 15:17:17', $case->getCreatedAt()); + $this->assertEquals('2016-12-12 19:23:16', $case->getUpdatedAt()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseRepositoryTest.php index ca98a20b15bec..5a30c64b48794 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseRepositoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseRepositoryTest.php @@ -65,7 +65,7 @@ public function testDelete() $case = array_pop($cases); $this->repository->delete($case); - self::assertEmpty($this->repository->getList($searchCriteria)->getItems()); + $this->assertEmpty($this->repository->getList($searchCriteria)->getItems()); } /** @@ -87,9 +87,9 @@ public function testGetById() $found = $this->repository->getById($case->getEntityId()); - self::assertNotEmpty($found->getEntityId()); - self::assertEquals($case->getEntityId(), $found->getEntityId()); - self::assertEquals($case->getOrderId(), $found->getOrderId()); + $this->assertNotEmpty($found->getEntityId()); + $this->assertEquals($case->getEntityId(), $found->getEntityId()); + $this->assertEquals($case->getOrderId(), $found->getOrderId()); } /** @@ -116,11 +116,11 @@ public function testGetListDateInterval() $items = $this->repository->getList($searchCriteria) ->getItems(); - self::assertCount(3, $items); + $this->assertCount(3, $items); for ($i = 1; $i < 4; $i ++) { $current = array_shift($items); - self::assertEquals($i, $current->getCaseId()); + $this->assertEquals($i, $current->getCaseId()); } } @@ -140,9 +140,9 @@ public function testGetListStatusProcessing() $items = $this->repository->getList($searchCriteria) ->getItems(); - self::assertCount(1, $items); + $this->assertCount(1, $items); $case = array_pop($items); - self::assertEquals(123, $case->getCaseId()); + $this->assertEquals(123, $case->getCaseId()); } } diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/CreationServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/CreationServiceTest.php index 6cf1e0bfddc9a..c9669a76410cd 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/CreationServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/CreationServiceTest.php @@ -98,16 +98,16 @@ public function testCreateForOrderWithEmptyResponse() $order = $this->getOrder(); $exceptionMessage = 'Response is not valid JSON: Decoding failed: Syntax error'; - $this->requestBuilder->expects(self::once()) + $this->requestBuilder->expects($this->once()) ->method('doRequest') ->willThrowException(new ApiCallException($exceptionMessage)); - $this->logger->expects(self::once()) + $this->logger->expects($this->once()) ->method('error') ->with($exceptionMessage); $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); + $this->assertTrue($result); } /** @@ -124,16 +124,16 @@ public function testCreateForOrderWithBadResponse() ]; $exceptionMessage = 'Bad Request - The request could not be parsed. Response: ' . json_encode($responseData); - $this->requestBuilder->expects(self::once()) + $this->requestBuilder->expects($this->once()) ->method('doRequest') ->willThrowException(new ApiCallException($exceptionMessage)); - $this->logger->expects(self::once()) + $this->logger->expects($this->once()) ->method('error') ->with($exceptionMessage); $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); + $this->assertTrue($result); } /** @@ -144,16 +144,16 @@ public function testCreateOrderWithEmptyInvestigationId() { $order = $this->getOrder(); - $this->requestBuilder->expects(self::once()) + $this->requestBuilder->expects($this->once()) ->method('doRequest') ->willReturn([]); - $this->logger->expects(self::once()) + $this->logger->expects($this->once()) ->method('error') ->with('Expected field "investigationId" missed.'); $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); + $this->assertTrue($result); } /** @@ -164,24 +164,24 @@ public function testCreateForOrder() { $order = $this->getOrder(); - $this->requestBuilder->expects(self::once()) + $this->requestBuilder->expects($this->once()) ->method('doRequest') ->willReturn(['investigationId' => 123123]); - $this->logger->expects(self::never()) + $this->logger->expects($this->never()) ->method('error'); $result = $this->service->createForOrder($order->getEntityId()); - self::assertTrue($result); + $this->assertTrue($result); /** @var CaseRepositoryInterface $caseRepository */ $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); $caseEntity = $caseRepository->getByCaseId(123123); $gridGuarantyStatus = $this->getOrderGridGuarantyStatus($caseEntity->getOrderId()); - self::assertNotEmpty($caseEntity); - self::assertEquals($order->getEntityId(), $caseEntity->getOrderId()); - self::assertEquals( + $this->assertNotEmpty($caseEntity); + $this->assertEquals($order->getEntityId(), $caseEntity->getOrderId()); + $this->assertEquals( $gridGuarantyStatus, $caseEntity->getGuaranteeDisposition(), 'Signifyd guaranty status in sales_order_grid table does not match case entity guaranty status' @@ -190,15 +190,15 @@ public function testCreateForOrder() /** @var OrderRepositoryInterface $orderRepository */ $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); $order = $orderRepository->get($caseEntity->getOrderId()); - self::assertEquals(Order::STATE_HOLDED, $order->getState()); + $this->assertEquals(Order::STATE_HOLDED, $order->getState()); $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); + $this->assertNotEmpty($histories); /** @var OrderStatusHistoryInterface $orderHoldComment */ $orderHoldComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $orderHoldComment); - self::assertEquals("Awaiting the Signifyd guarantee disposition.", $orderHoldComment->getComment()); + $this->assertInstanceOf(OrderStatusHistoryInterface::class, $orderHoldComment); + $this->assertEquals("Awaiting the Signifyd guarantee disposition.", $orderHoldComment->getComment()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/UpdatingServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/UpdatingServiceTest.php index 50e510ca072be..7f56470946f81 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/UpdatingServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Model/CaseServices/UpdatingServiceTest.php @@ -83,14 +83,14 @@ public function testUpdate() $orderEntityId = $caseEntity->getOrderId(); $gridGuarantyStatus = $this->getOrderGridGuarantyStatus($orderEntityId); - self::assertNotEmpty($caseEntity); - self::assertEquals('2017-01-05 22:23:26', $caseEntity->getCreatedAt()); - self::assertEquals(CaseInterface::GUARANTEE_APPROVED, $caseEntity->getGuaranteeDisposition()); - self::assertEquals('AnyTeam', $caseEntity->getAssociatedTeam()['teamName']); - self::assertEquals(true, $caseEntity->isGuaranteeEligible()); - self::assertEquals(CaseInterface::STATUS_PROCESSING, $caseEntity->getStatus()); - self::assertEquals($orderEntityId, $caseEntity->getOrderId()); - self::assertEquals( + $this->assertNotEmpty($caseEntity); + $this->assertEquals('2017-01-05 22:23:26', $caseEntity->getCreatedAt()); + $this->assertEquals(CaseInterface::GUARANTEE_APPROVED, $caseEntity->getGuaranteeDisposition()); + $this->assertEquals('AnyTeam', $caseEntity->getAssociatedTeam()['teamName']); + $this->assertEquals(true, $caseEntity->isGuaranteeEligible()); + $this->assertEquals(CaseInterface::STATUS_PROCESSING, $caseEntity->getStatus()); + $this->assertEquals($orderEntityId, $caseEntity->getOrderId()); + $this->assertEquals( $gridGuarantyStatus, $caseEntity->getGuaranteeDisposition(), 'Signifyd guaranty status in sales_order_grid table does not match case entity guaranty status' @@ -99,14 +99,14 @@ public function testUpdate() /** @var OrderRepositoryInterface $orderRepository */ $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); $order = $orderRepository->get($caseEntity->getOrderId()); - self::assertEquals(Order::STATE_PROCESSING, $order->getState()); + $this->assertEquals(Order::STATE_PROCESSING, $order->getState()); $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); + $this->assertNotEmpty($histories); /** @var OrderStatusHistoryInterface $caseCreationComment */ $caseCreationComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); - self::assertEquals("Signifyd Case $caseId has been created for order.", $caseCreationComment->getComment()); + $this->assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); + $this->assertEquals("Signifyd Case $caseId has been created for order.", $caseCreationComment->getComment()); } /** @@ -134,7 +134,7 @@ public function testOrderStateAfterDeclinedGuaranteeDisposition() $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); $order = $orderRepository->get($caseEntity->getOrderId()); - self::assertEquals(Order::STATE_HOLDED, $order->getState()); + $this->assertEquals(Order::STATE_HOLDED, $order->getState()); } /** @@ -163,7 +163,7 @@ public function testOrderStateAfterWebhookWithoutGuaranteeDisposition() $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); $order = $orderRepository->get($caseEntity->getOrderId()); - self::assertEquals(Order::STATE_PROCESSING, $order->getState()); + $this->assertEquals(Order::STATE_PROCESSING, $order->getState()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CancelingServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CancelingServiceTest.php index 2cc7a9a1f240a..ca42fbb4c1aa7 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CancelingServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CancelingServiceTest.php @@ -80,14 +80,14 @@ public function testCancelForOrderWithCanceledGuarantee() $caseEntity->setGuaranteeDisposition(CaseInterface::GUARANTEE_CANCELED); $caseRepository->save($caseEntity); - $this->gateway->expects(self::never()) + $this->gateway->expects($this->never()) ->method('cancelGuarantee'); - $this->logger->expects(self::never()) + $this->logger->expects($this->never()) ->method('error'); $result = $this->service->cancelForOrder($caseEntity->getOrderId()); - self::assertFalse($result); + $this->assertFalse($result); } /** @@ -104,17 +104,17 @@ public function testCancelForOrderWithFailedRequest() $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); $caseEntity = $caseRepository->getByCaseId(self::$caseId); - $this->gateway->expects(self::once()) + $this->gateway->expects($this->once()) ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) + ->with($this->equalTo(self::$caseId)) ->willThrowException(new GatewayException($exceptionMessage)); - $this->logger->expects(self::once()) + $this->logger->expects($this->once()) ->method('error') - ->with(self::equalTo($exceptionMessage)); + ->with($this->equalTo($exceptionMessage)); $result = $this->service->cancelForOrder($caseEntity->getOrderId()); - self::assertFalse($result); + $this->assertFalse($result); } /** @@ -130,29 +130,29 @@ public function testCancelForOrder() $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); $caseEntity = $caseRepository->getByCaseId(self::$caseId); - $this->gateway->expects(self::once()) + $this->gateway->expects($this->once()) ->method('cancelGuarantee') - ->with(self::equalTo(self::$caseId)) + ->with($this->equalTo(self::$caseId)) ->willReturn(CaseInterface::GUARANTEE_CANCELED); - $this->logger->expects(self::never()) + $this->logger->expects($this->never()) ->method('error'); $result = $this->service->cancelForOrder($caseEntity->getOrderId()); - self::assertTrue($result); + $this->assertTrue($result); $updatedCase = $caseRepository->getByCaseId(self::$caseId); - self::assertEquals(CaseInterface::GUARANTEE_CANCELED, $updatedCase->getGuaranteeDisposition()); + $this->assertEquals(CaseInterface::GUARANTEE_CANCELED, $updatedCase->getGuaranteeDisposition()); /** @var OrderRepositoryInterface $orderRepository */ $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); $order = $orderRepository->get($updatedCase->getOrderId()); $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); + $this->assertNotEmpty($histories); /** @var OrderStatusHistoryInterface $caseCreationComment */ $caseCreationComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); - self::assertEquals('Case Update: Case guarantee has been cancelled.', $caseCreationComment->getComment()); + $this->assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); + $this->assertEquals('Case Update: Case guarantee has been cancelled.', $caseCreationComment->getComment()); } } diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CreationServiceTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CreationServiceTest.php index 157e3270648b3..7e61604030a09 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CreationServiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Model/Guarantee/CreationServiceTest.php @@ -74,11 +74,11 @@ public function testCreateWithoutCaseEntity() { $orderId = 123; - $this->gateway->expects(self::never()) + $this->gateway->expects($this->never()) ->method('submitCaseForGuarantee'); $result = $this->service->createForOrder($orderId); - self::assertFalse($result); + $this->assertFalse($result); } /** @@ -91,16 +91,16 @@ public function testCreateWithFailedRequest() { $caseEntity = $this->getCaseEntity(); - $this->gateway->expects(self::once()) + $this->gateway->expects($this->once()) ->method('submitCaseForGuarantee') ->willThrowException(new GatewayException('Something wrong')); - $this->logger->expects(self::once()) + $this->logger->expects($this->once()) ->method('error') ->with('Something wrong'); $result = $this->service->createForOrder($caseEntity->getOrderId()); - self::assertFalse($result); + $this->assertFalse($result); } /** @@ -114,31 +114,31 @@ public function testCreate() { $caseEntity = $this->getCaseEntity(); - $this->gateway->expects(self::once()) + $this->gateway->expects($this->once()) ->method('submitCaseForGuarantee') ->with($caseEntity->getCaseId()) ->willReturn(CaseInterface::GUARANTEE_IN_REVIEW); - $this->logger->expects(self::never()) + $this->logger->expects($this->never()) ->method('error'); $result = $this->service->createForOrder($caseEntity->getOrderId()); - self::assertTrue($result); + $this->assertTrue($result); $updatedCase = $this->getCaseEntity(); - self::assertEquals(CaseInterface::GUARANTEE_IN_REVIEW, $updatedCase->getGuaranteeDisposition()); - self::assertEquals(CaseInterface::STATUS_PROCESSING, $updatedCase->getStatus()); + $this->assertEquals(CaseInterface::GUARANTEE_IN_REVIEW, $updatedCase->getGuaranteeDisposition()); + $this->assertEquals(CaseInterface::STATUS_PROCESSING, $updatedCase->getStatus()); /** @var OrderRepositoryInterface $orderRepository */ $orderRepository = $this->objectManager->get(OrderRepositoryInterface::class); $order = $orderRepository->get($updatedCase->getOrderId()); $histories = $order->getStatusHistories(); - self::assertNotEmpty($histories); + $this->assertNotEmpty($histories); /** @var OrderStatusHistoryInterface $caseCreationComment */ $caseCreationComment = array_pop($histories); - self::assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); - self::assertEquals('Case Update: Case is submitted for guarantee.', $caseCreationComment->getComment()); + $this->assertInstanceOf(OrderStatusHistoryInterface::class, $caseCreationComment); + $this->assertEquals('Case Update: Case is submitted for guarantee.', $caseCreationComment->getComment()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderTest.php index 594c065185ac7..88d53a1b17838 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Model/SignifydGateway/Request/CreateCaseBuilderTest.php @@ -163,7 +163,7 @@ public function testCreateCaseBuilderWithFullSetOfData() ] ]; - self::assertEquals( + $this->assertEquals( $expected, $this->caseBuilder->build($order->getEntityId()) ); @@ -238,7 +238,7 @@ public function testCreateCaseBuilderWithVirtualProductAndGuest() ] ]; - self::assertEquals( + $this->assertEquals( $expected, $this->caseBuilder->build($order->getEntityId()) ); diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Observer/PlaceOrderTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Observer/PlaceOrderTest.php index e547187be5ed7..6228086820c21 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Observer/PlaceOrderTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Observer/PlaceOrderTest.php @@ -77,7 +77,7 @@ protected function setUp() public function testExecuteWithOfflinePayment() { $order = $this->getOrder('100000005'); - $this->creationService->expects(self::never()) + $this->creationService->expects($this->never()) ->method('createForOrder'); $event = $this->objectManager->create( @@ -105,9 +105,9 @@ public function testExecute() { $order = $this->getOrder('100000001'); - $this->creationService->expects(self::once()) + $this->creationService->expects($this->once()) ->method('createForOrder') - ->with(self::equalTo($order->getEntityId())); + ->with($this->equalTo($order->getEntityId())); $event = $this->objectManager->create( Event::class, @@ -145,7 +145,7 @@ public function testExecuteWithWebsiteConfiguration(): void $order = $this->getOrder('100000001'); $order->setStoreId($store->getId()); - $this->creationService->expects(self::never()) + $this->creationService->expects($this->never()) ->method('createForOrder'); $event = $this->objectManager->create( @@ -176,9 +176,9 @@ public function testExecuteWithMultipleOrders() $orderWithOfflinePayment = $this->getOrder('100000005'); // this service mock should be called only once for the order with online payment method. - $this->creationService->expects(self::once()) + $this->creationService->expects($this->once()) ->method('createForOrder') - ->with(self::equalTo($orderWithOnlinePayment->getEntityId())); + ->with($this->equalTo($orderWithOnlinePayment->getEntityId())); $event = $this->objectManager->create( Event::class, diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/CancelOrderTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/CancelOrderTest.php index 7c1af95bdb89c..322f6550589bd 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/CancelOrderTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/CancelOrderTest.php @@ -68,10 +68,10 @@ public function testAfterCancel() { $order = $this->getOrder(); - $this->apiClient->expects(self::once()) + $this->apiClient->expects($this->once()) ->method('makeApiCall') ->with( - self::equalTo('/cases/' . self::$caseId . '/guarantee'), + $this->equalTo('/cases/' . self::$caseId . '/guarantee'), 'PUT', [ 'guaranteeDisposition' => CaseInterface::GUARANTEE_CANCELED @@ -89,7 +89,7 @@ public function testAfterCancel() $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); $case = $caseRepository->getByCaseId(self::$caseId); - self::assertEquals(CaseInterface::GUARANTEE_CANCELED, $case->getGuaranteeDisposition()); + $this->assertEquals(CaseInterface::GUARANTEE_CANCELED, $case->getGuaranteeDisposition()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/DenyPaymentTest.php b/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/DenyPaymentTest.php index 72da71a630dff..a9408c503b50a 100644 --- a/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/DenyPaymentTest.php +++ b/dev/tests/integration/testsuite/Magento/Signifyd/Plugin/DenyPaymentTest.php @@ -86,10 +86,10 @@ public function testAfterDenyPayment() $order = $this->getOrder(); $this->registry->register('current_order', $order); - $this->apiClient->expects(self::once()) + $this->apiClient->expects($this->once()) ->method('makeApiCall') ->with( - self::equalTo('/cases/' . self::$caseId . '/guarantee'), + $this->equalTo('/cases/' . self::$caseId . '/guarantee'), 'PUT', [ 'guaranteeDisposition' => CaseInterface::GUARANTEE_CANCELED @@ -108,7 +108,7 @@ public function testAfterDenyPayment() $caseRepository = $this->objectManager->get(CaseRepositoryInterface::class); $case = $caseRepository->getByCaseId(self::$caseId); - self::assertEquals(CaseInterface::GUARANTEE_CANCELED, $case->getGuaranteeDisposition()); + $this->assertEquals(CaseInterface::GUARANTEE_CANCELED, $case->getGuaranteeDisposition()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Swatches/Observer/AddSwatchAttributeTypeObserverTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Observer/AddSwatchAttributeTypeObserverTest.php index 15d10c2ddffd4..842e3e0ffc0ee 100644 --- a/dev/tests/integration/testsuite/Magento/Swatches/Observer/AddSwatchAttributeTypeObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/Observer/AddSwatchAttributeTypeObserverTest.php @@ -34,7 +34,7 @@ public function testAddSwatchAttributeTypes() $responseTypes = $response->getTypes(); - self::assertGreaterThan(0, count($responseTypes)); + $this->assertGreaterThan(0, count($responseTypes)); /* Iterate through values since other types (not swatches) might be added by observers */ $responseTypeValues = []; @@ -42,7 +42,7 @@ public function testAddSwatchAttributeTypes() $responseTypeValues[] = $responseType['value']; } - self::assertTrue(in_array(Swatch::SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT, $responseTypeValues)); - self::assertTrue(in_array(Swatch::SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT, $responseTypeValues)); + $this->assertTrue(in_array(Swatch::SWATCH_TYPE_VISUAL_ATTRIBUTE_FRONTEND_INPUT, $responseTypeValues)); + $this->assertTrue(in_array(Swatch::SWATCH_TYPE_TEXTUAL_ATTRIBUTE_FRONTEND_INPUT, $responseTypeValues)); } } diff --git a/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Config/SaveTest.php b/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Config/SaveTest.php index cb684c0216889..66a9d6267b8c7 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Config/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/Config/SaveTest.php @@ -59,7 +59,7 @@ public function testSave() $error = $e->getMessage(); } - self::assertEmpty($error, $error); + $this->assertEmpty($error, $error); } /** diff --git a/dev/tests/integration/testsuite/Magento/Ui/DataProvider/SearchResultFactoryTest.php b/dev/tests/integration/testsuite/Magento/Ui/DataProvider/SearchResultFactoryTest.php index f5726956bf4f7..609ff7e82b234 100644 --- a/dev/tests/integration/testsuite/Magento/Ui/DataProvider/SearchResultFactoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Ui/DataProvider/SearchResultFactoryTest.php @@ -43,33 +43,33 @@ public function testCreate() $searchResult = $this->searchResultFactory->create($entities, $totalCount, $searchCriteria, $idFieldName); $items = $searchResult->getItems(); - self::assertCount(1, $items); + $this->assertCount(1, $items); $document = $items[0]; - self::assertInstanceOf(DocumentInterface::class, $document); - self::assertEquals($idValue, $document->getId()); + $this->assertInstanceOf(DocumentInterface::class, $document); + $this->assertEquals($idValue, $document->getId()); $attributeId = $document->getCustomAttribute($idFieldName); - self::assertInstanceOf(AttributeInterface::class, $attributeId); - self::assertEquals($idFieldName, $attributeId->getAttributeCode()); - self::assertEquals($idValue, $attributeId->getValue()); + $this->assertInstanceOf(AttributeInterface::class, $attributeId); + $this->assertEquals($idFieldName, $attributeId->getAttributeCode()); + $this->assertEquals($idValue, $attributeId->getValue()); $attributeIdFieldName = $document->getCustomAttribute('id_field_name'); - self::assertInstanceOf(AttributeInterface::class, $attributeIdFieldName); - self::assertEquals('id_field_name', $attributeIdFieldName->getAttributeCode()); - self::assertEquals($idFieldName, $attributeIdFieldName->getValue()); + $this->assertInstanceOf(AttributeInterface::class, $attributeIdFieldName); + $this->assertEquals('id_field_name', $attributeIdFieldName->getAttributeCode()); + $this->assertEquals($idFieldName, $attributeIdFieldName->getValue()); $attributeFoo = $document->getCustomAttribute('attribute_foo'); - self::assertInstanceOf(AttributeInterface::class, $attributeFoo); - self::assertEquals('attribute_foo', $attributeFoo->getAttributeCode()); - self::assertEquals('attribute_foo_value', $attributeFoo->getValue()); + $this->assertInstanceOf(AttributeInterface::class, $attributeFoo); + $this->assertEquals('attribute_foo', $attributeFoo->getAttributeCode()); + $this->assertEquals('attribute_foo_value', $attributeFoo->getValue()); $attributeBar = $document->getCustomAttribute('attribute_bar'); - self::assertInstanceOf(AttributeInterface::class, $attributeBar); - self::assertEquals('attribute_bar', $attributeBar->getAttributeCode()); - self::assertEquals('attribute_bar_value', $attributeBar->getValue()); + $this->assertInstanceOf(AttributeInterface::class, $attributeBar); + $this->assertEquals('attribute_bar', $attributeBar->getAttributeCode()); + $this->assertEquals('attribute_bar_value', $attributeBar->getValue()); - self::assertEquals($totalCount, $searchResult->getTotalCount()); - self::assertEquals($searchCriteria, $searchResult->getSearchCriteria()); + $this->assertEquals($totalCount, $searchResult->getTotalCount()); + $this->assertEquals($searchCriteria, $searchResult->getSearchCriteria()); } } diff --git a/dev/tests/integration/testsuite/Magento/Usps/Api/GuestCouponManagementTest.php b/dev/tests/integration/testsuite/Magento/Usps/Api/GuestCouponManagementTest.php index c4656a4801eaa..6573611f7208f 100644 --- a/dev/tests/integration/testsuite/Magento/Usps/Api/GuestCouponManagementTest.php +++ b/dev/tests/integration/testsuite/Magento/Usps/Api/GuestCouponManagementTest.php @@ -91,11 +91,11 @@ public function testFreeShippingWithCoupon(): void $this->httpClient->method('request') ->willReturn($request); - self::assertTrue($this->management->set($cartId, $couponCode)); + $this->assertTrue($this->management->set($cartId, $couponCode)); $methods = $this->estimateShipping($cartId); $methods = $this->filterFreeShippingMethods($methods); - self::assertEquals(['Fixed', 'Priority Mail 1-Day'], $methods); + $this->assertEquals(['Fixed', 'Priority Mail 1-Day'], $methods); } /** diff --git a/dev/tests/integration/testsuite/Magento/Vault/Model/PaymentTokenRepositoryTest.php b/dev/tests/integration/testsuite/Magento/Vault/Model/PaymentTokenRepositoryTest.php index a29e396ea2221..b164340209612 100644 --- a/dev/tests/integration/testsuite/Magento/Vault/Model/PaymentTokenRepositoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Vault/Model/PaymentTokenRepositoryTest.php @@ -104,8 +104,8 @@ public function testDelete() $deletedToken = $tokenRepository->getById($token->getEntityId()); - static::assertEquals('public_hash', $deletedToken->getPublicHash()); - static::assertFalse($deletedToken->getIsActive()); - static::assertFalse($deletedToken->getIsVisible()); + $this->assertEquals('public_hash', $deletedToken->getPublicHash()); + $this->assertFalse($deletedToken->getIsActive()); + $this->assertFalse($deletedToken->getIsVisible()); } } diff --git a/dev/tests/integration/testsuite/Magento/Vault/Model/ResourceModel/PaymentTokenTest.php b/dev/tests/integration/testsuite/Magento/Vault/Model/ResourceModel/PaymentTokenTest.php index 08ca6ff956657..87b65588482c6 100644 --- a/dev/tests/integration/testsuite/Magento/Vault/Model/ResourceModel/PaymentTokenTest.php +++ b/dev/tests/integration/testsuite/Magento/Vault/Model/ResourceModel/PaymentTokenTest.php @@ -79,7 +79,7 @@ public function testAddLinkToOrderPaymentExists() ] ); - static::assertTrue( + $this->assertTrue( $this->paymentToken->addLinkToOrderPayment( $paymentToken->getEntityId(), $this->order->getPayment()->getEntityId() @@ -102,13 +102,13 @@ public function testAddLinkToOrderPaymentCreate() ->where('order_payment_id = ?', (int) $this->order->getPayment()->getEntityId()) ->where('payment_token_id =?', (int) $paymentToken->getEntityId()); - static::assertEmpty($this->connection->fetchRow($select)); - static::assertTrue( + $this->assertEmpty($this->connection->fetchRow($select)); + $this->assertTrue( $this->paymentToken->addLinkToOrderPayment( $paymentToken->getEntityId(), $this->order->getPayment()->getEntityId() ) ); - static::assertNotEmpty($this->connection->fetchRow($select)); + $this->assertNotEmpty($this->connection->fetchRow($select)); } } diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/BCMultiModuleTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/BCMultiModuleTest.php index f40339fd02439..e44c9a9d904c9 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/BCMultiModuleTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/BCMultiModuleTest.php @@ -74,12 +74,12 @@ public function testFirstCleanInstall() ]); //Check if declaration is applied $indexes = $this->dbSchemaReader->readIndexes('test_table', 'default'); - self::assertCount(1, $indexes); - self::assertArrayHasKey('TEST_TABLE_TINYINT_BIGINT', $indexes); + $this->assertCount(1, $indexes); + $this->assertArrayHasKey('TEST_TABLE_TINYINT_BIGINT', $indexes); //Check UpgradeSchema old format, that modify declaration $columns = $this->dbSchemaReader->readColumns('test_table', 'default'); $floatColumn = $columns['float']; - self::assertEquals(29, $floatColumn['default']); + $this->assertEquals(29, $floatColumn['default']); } private function doUsToUsRevision() @@ -132,10 +132,10 @@ private function doUsToDsRevision() private function assertUsToUsUpgrade() { $usToUsTables = $this->dbSchemaReader->readTables('default'); - self::assertContains('custom_table', $usToUsTables); - self::assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule7')); - self::assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule7')); - self::assertEquals( + $this->assertContains('custom_table', $usToUsTables); + $this->assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule7')); + $this->assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule7')); + $this->assertEquals( [6,12], $this->tableData->describeTableData('reference_table', 'bigint_without_padding') ); @@ -150,14 +150,14 @@ private function assertUsToDsUpgrade() $columns = $this->dbSchemaReader->readColumns('test_table', 'default'); $floatColumn = $columns['float']; //Check whether declaration will be applied - self::assertEquals(35, $floatColumn['default']); - self::assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule7')); - self::assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule7')); - self::assertEquals( + $this->assertEquals(35, $floatColumn['default']); + $this->assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule7')); + $this->assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule7')); + $this->assertEquals( [6,12], $this->tableData->describeTableData('reference_table', 'bigint_without_padding') ); - self::assertEquals( + $this->assertEquals( ['_ref'], $this->tableData->describeTableData('test_table', 'varchar') ); @@ -195,7 +195,7 @@ public function testDSFirstRelease() //Check removal case, when we need to remove table with declaration and table was created in old scripts $this->cliCommand->upgrade(); $tables = $this->dbSchemaReader->readTables('default'); - self::assertNotContains('custom_table', $tables); + $this->assertNotContains('custom_table', $tables); } /** @@ -226,18 +226,18 @@ public function testFirstCleanInstallOneModule( $indexes = $this->dbSchemaReader ->readIndexes($tableName, 'default'); - self::assertCount(1, $indexes); - self::assertArrayHasKey($indexName, $indexes); + $this->assertCount(1, $indexes); + $this->assertArrayHasKey($indexName, $indexes); $constraints = $this->dbSchemaReader ->readConstraints($tableName, 'default'); - self::assertCount(1, $constraints); - self::assertArrayHasKey($constraintName, $constraints); + $this->assertCount(1, $constraints); + $this->assertArrayHasKey($constraintName, $constraints); $foreignKeys = $this->dbSchemaReader ->readReferences($tableName, 'default'); - self::assertCount(1, $foreignKeys); - self::assertArrayHasKey($foreignKeyName, $foreignKeys); + $this->assertCount(1, $foreignKeys); + $this->assertArrayHasKey($foreignKeyName, $foreignKeys); } /** diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/BCPatchTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/BCPatchTest.php index c74f07cd80aea..bd55476a30f8a 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/BCPatchTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/BCPatchTest.php @@ -61,8 +61,8 @@ public function setUp() public function testSuccessfullInstall() { $this->cliCommand->install(['Magento_TestSetupDeclarationModule5']); - self::assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); - self::assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); } /** @@ -84,13 +84,13 @@ public function testDataMixedMode() ); $this->cliCommand->install(['Magento_TestSetupDeclarationModule5']); - self::assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); - self::assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); - self::assertEquals( + $this->assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertEquals( [6,12], $this->tableData->describeTableData('reference_table', 'some_integer') ); - self::assertEquals( + $this->assertEquals( ['_ref'], $this->tableData->describeTableData('test_table', 'varchar') ); @@ -114,9 +114,9 @@ public function testSkippedPatch() 'Setup/Patch/Data' ); $this->cliCommand->install(['Magento_TestSetupDeclarationModule5']); - self::assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); - self::assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); - self::assertEquals( + $this->assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertEquals( ['_ref'], $this->tableData->describeTableData('test_table', 'varchar') ); @@ -134,8 +134,8 @@ public function testDataInstallationWithoutVersion() 'etc' ); $this->cliCommand->install(['Magento_TestSetupDeclarationModule5']); - self::assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); - self::assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); $this->moduleResource->setDataVersion('Magento_TestSetupDeclarationModule5', '1.0.2'); $this->moduleResource->setDataVersion('Magento_TestSetupDeclarationModule5', '1.0.2'); $this->moduleManager->updateRevision( @@ -157,14 +157,14 @@ public function testDataInstallationWithoutVersion() 'Setup/Patch/Data' ); $this->cliCommand->upgrade(); - self::assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); - self::assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isDataUpToDate('Magento_TestSetupDeclarationModule5')); + $this->assertTrue($this->dbVersionInfo->isSchemaUpToDate('Magento_TestSetupDeclarationModule5')); //Old scripts should be skipped because we do not have version - self::assertEquals( + $this->assertEquals( [], $this->tableData->describeTableData('reference_table', 'some_integer') ); - self::assertEquals( + $this->assertEquals( ['_ref'], $this->tableData->describeTableData('test_table', 'varchar') ); diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/DataPatchInstallationTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/DataPatchInstallationTest.php index a781972b85887..96fefc2ca2d90 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/DataPatchInstallationTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/DataPatchInstallationTest.php @@ -66,7 +66,7 @@ public function testDataPatchesInstallation() ['Magento_TestSetupDeclarationModule3'] ); - self::assertEquals( + $this->assertEquals( '0.0.1', $this->moduleResource->getDataVersion('Magento_TestSetupDeclarationModule3') ); @@ -80,15 +80,15 @@ public function testDataPatchesInstallation() $this->movePatches(); ModuleResource::flush(); $this->cliCommad->upgrade(); - self::assertEquals( + $this->assertEquals( '0.0.3', $this->moduleResource->getDataVersion('Magento_TestSetupDeclarationModule3') ); - self::assertTrue($this->patchList->isApplied(IncrementalSomeIntegerPatch::class)); - self::assertTrue($this->patchList->isApplied(ReferenceIncrementalSomeIntegerPatch::class)); - self::assertTrue($this->patchList->isApplied(ZFirstPatch::class)); + $this->assertTrue($this->patchList->isApplied(IncrementalSomeIntegerPatch::class)); + $this->assertTrue($this->patchList->isApplied(ReferenceIncrementalSomeIntegerPatch::class)); + $this->assertTrue($this->patchList->isApplied(ZFirstPatch::class)); $tableData = $this->tableData->describeTableData('test_table'); - self::assertEquals($this->getTestTableData(), $tableData); + $this->assertEquals($this->getTestTableData(), $tableData); } /** @@ -112,7 +112,7 @@ public function testCyclomaticDependency() ['Magento_TestSetupDeclarationModule3'] ); $tableData = $this->tableData->describeTableData('test_table'); - self::assertEquals($this->getTestTableData(), $tableData); + $this->assertEquals($this->getTestTableData(), $tableData); $this->moduleManager->updateRevision( 'Magento_TestSetupDeclarationModule3', 'cyclomatic_and_bic_revision', @@ -167,10 +167,10 @@ public function testPatchesRevert() $this->cliCommad->uninstallModule('Magento_TestSetupDeclarationModule3'); $testTableData = $this->tableData->describeTableData('test_table'); $patchListTableData = $this->tableData->describeTableData('patch_list'); - self::assertEmpty($patchListTableData); - self::assertEmpty($testTableData); + $this->assertEmpty($patchListTableData); + $this->assertEmpty($testTableData); $refTableData = $this->tableData->describeTableData('reference_table'); - self::assertEquals($this->getRefTableData(), $refTableData); + $this->assertEquals($this->getRefTableData(), $refTableData); } /** diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php index f6497e8e4b162..1cafa6ad5b028 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php @@ -78,7 +78,7 @@ public function testInstallation() ); //Second time installation should not find anything as we do not change anything - self::assertNull($diff->getAll()); + $this->assertNull($diff->getAll()); $this->compareStructures(); } @@ -96,7 +96,7 @@ private function compareStructures() */ if (preg_match('#ON DELETE\s+NO ACTION#i', $shardData[$tableName] === 1)) { preg_replace('#ON DELETE\s+NO ACTION#i', '', $sql); - self::assertEquals($sql, $shardData[$tableName]); + $this->assertEquals($sql, $shardData[$tableName]); } } } @@ -127,7 +127,7 @@ public function testInstallationWithColumnsModification() $this->schemaConfig->getDeclarationConfig(), $this->schemaConfig->getDbConfig() ); - self::assertNull($diff->getAll()); + $this->assertNull($diff->getAll()); $this->compareStructures(); } @@ -172,7 +172,7 @@ public function testInstallationWithColumnsRemoval() $this->schemaConfig->getDeclarationConfig(), $this->schemaConfig->getDbConfig() ); - self::assertNull($diff->getAll()); + $this->assertNull($diff->getAll()); $this->compareStructures(); } @@ -208,9 +208,9 @@ public function testInstallationWithConstraintsModification() $this->schemaConfig->getDeclarationConfig(), $this->schemaConfig->getDbConfig() ); - self::assertNull($diff->getAll()); + $this->assertNull($diff->getAll()); $shardData = $this->describeTable->describeShard(Sharding::DEFAULT_CONNECTION); - self::assertEquals($this->getTrimmedData(), $shardData); + $this->assertEquals($this->getTrimmedData(), $shardData); } /** @@ -237,9 +237,9 @@ public function testInstallationWithDroppingTables() $this->schemaConfig->getDeclarationConfig(), $this->schemaConfig->getDbConfig() ); - self::assertNull($diff->getAll()); + $this->assertNull($diff->getAll()); $shardData = $this->describeTable->describeShard(Sharding::DEFAULT_CONNECTION); - self::assertEquals($this->getData(), $shardData); + $this->assertEquals($this->getData(), $shardData); } /** @@ -259,7 +259,7 @@ public function testInstallWithCodeBaseRollback() ['Magento_TestSetupDeclarationModule1'] ); $beforeRollback = $this->describeTable->describeShard('default'); - self::assertEquals($this->getTrimmedData()['before'], $beforeRollback); + $this->assertEquals($this->getTrimmedData()['before'], $beforeRollback); //Move db_schema.xml file and tried to install $this->moduleManager->updateRevision( 'Magento_TestSetupDeclarationModule1', @@ -270,7 +270,7 @@ public function testInstallWithCodeBaseRollback() $this->cliCommad->upgrade(); $afterRollback = $this->describeTable->describeShard('default'); - self::assertEquals($this->getData()['after'], $afterRollback); + $this->assertEquals($this->getData()['after'], $afterRollback); } /** @@ -296,7 +296,7 @@ public function testTableRename() $this->resourceConnection->getTableName('some_table'), $dataToMigrate ); - self::assertEquals($this->getData()['before'], $before['some_table']); + $this->assertEquals($this->getData()['before'], $before['some_table']); //Move db_schema.xml file and tried to install $this->moduleManager->updateRevision( 'Magento_TestSetupDeclarationModule1', @@ -307,10 +307,10 @@ public function testTableRename() $this->cliCommad->upgrade(); $after = $this->describeTable->describeShard('default'); - self::assertEquals($this->getData()['after'], $after['some_table_renamed']); + $this->assertEquals($this->getData()['after'], $after['some_table_renamed']); $select = $adapter->select() ->from($this->resourceConnection->getTableName('some_table_renamed')); - self::assertEquals([$dataToMigrate], $adapter->fetchAll($select)); + $this->assertEquals([$dataToMigrate], $adapter->fetchAll($select)); } /** diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeSchemaBuilderTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeSchemaBuilderTest.php index d4126d9d1e16c..ab101a030b6eb 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeSchemaBuilderTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeSchemaBuilderTest.php @@ -56,8 +56,8 @@ public function testSchemaBuilder() ); $dbSchema = $this->schemaConfig->getDeclarationConfig(); $schemaTables = $dbSchema->getTables(); - self::assertArrayHasKey('reference_table', $dbSchema->getTables()); - self::assertArrayHasKey('test_table', $dbSchema->getTables()); + $this->assertArrayHasKey('reference_table', $dbSchema->getTables()); + $this->assertArrayHasKey('test_table', $dbSchema->getTables()); //Test primary key and renaming $referenceTable = $schemaTables['reference_table']; /** @@ -65,22 +65,22 @@ public function testSchemaBuilder() */ $primaryKey = $referenceTable->getPrimaryConstraint(); $columns = $primaryKey->getColumns(); - self::assertEquals('tinyint_ref', reset($columns)->getName()); + $this->assertEquals('tinyint_ref', reset($columns)->getName()); //Test column $testTable = $schemaTables['test_table']; /** * @var Timestamp $timestampColumn */ $timestampColumn = $testTable->getColumnByName('timestamp'); - self::assertEquals('CURRENT_TIMESTAMP', $timestampColumn->getOnUpdate()); + $this->assertEquals('CURRENT_TIMESTAMP', $timestampColumn->getOnUpdate()); //Test disabled - self::assertArrayNotHasKey('varbinary_rename', $testTable->getColumns()); + $this->assertArrayNotHasKey('varbinary_rename', $testTable->getColumns()); //Test foreign key /** * @var Reference $foreignKey */ $foreignKey = $testTable->getConstraintByName('TEST_TABLE_TINYINT_REFERENCE_TABLE_TINYINT_REF'); - self::assertEquals('NO ACTION', $foreignKey->getOnDelete()); - self::assertEquals('tinyint_ref', $foreignKey->getReferenceColumn()->getName()); + $this->assertEquals('NO ACTION', $foreignKey->getOnDelete()); + $this->assertEquals('tinyint_ref', $foreignKey->getReferenceColumn()->getName()); } } diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/DiffOldSchemaTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/DiffOldSchemaTest.php index 0521a832ae392..d463cf4f53563 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/DiffOldSchemaTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/DiffOldSchemaTest.php @@ -85,12 +85,12 @@ public function testOldDiff() $generatedSchema = $this->schemaConfig->getDbConfig(); $diff = $this->schemaDiff->diff($declarativeSchema, $generatedSchema); $allChanges = $diff->getAll(); - self::assertCount(1, $allChanges); - self::assertEquals( + $this->assertCount(1, $allChanges); + $this->assertEquals( $this->getBigIntKeyXmlSensitiveData(), reset($allChanges)['modify_column'][0]->getNew()->getDiffSensitiveParams() ); - self::assertEquals( + $this->assertEquals( $this->getBigIntKeyDbSensitiveData(), reset($allChanges)['modify_column'][0]->getOld()->getDiffSensitiveParams() ); @@ -130,7 +130,7 @@ public function testOldSchemaUpgrade(string $dbPrefix) $declarativeSchema = $this->schemaConfig->getDeclarationConfig(); $generatedSchema = $this->schemaConfig->getDbConfig(); $diff = $this->schemaDiff->diff($declarativeSchema, $generatedSchema); - self::assertEmpty($diff->getAll()); + $this->assertEmpty($diff->getAll()); } /** diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/DryRunTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/DryRunTest.php index 562f88cea75e8..dd1ecf5a621c1 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/DryRunTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/DryRunTest.php @@ -45,9 +45,9 @@ public function testDryRunOnCleanDatabase() ['Magento_TestSetupDeclarationModule1'], ['dry-run' => true] ); - self::assertFileExists($logFileName); + $this->assertFileExists($logFileName); $data = file_get_contents($logFileName); - self::assertEquals($data, $this->getData()[0]); + $this->assertEquals($data, $this->getData()[0]); } /** @@ -65,8 +65,8 @@ public function testDryRunOnUpgrade() 'etc' ); $this->cliCommad->upgrade(['dry-run' => true]); - self::assertFileExists($logFileName); + $this->assertFileExists($logFileName); $data = file_get_contents($logFileName); - self::assertEquals($data, $this->getData()[0]); + $this->assertEquals($data, $this->getData()[0]); } } diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/SafeInstallerTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/SafeInstallerTest.php index 5b42e6cf43e13..6cf99d6820942 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/SafeInstallerTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/SafeInstallerTest.php @@ -85,6 +85,6 @@ public function testInstallation() ] ); $testTableSelect = $adapter->select()->from($testTableName); - self::assertEquals($testTableData, $adapter->fetchAll($testTableSelect)); + $this->assertEquals($testTableData, $adapter->fetchAll($testTableSelect)); } } diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/SchemaReaderTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/SchemaReaderTest.php index 72f910527741c..66c163a6b673c 100644 --- a/dev/tests/setup-integration/testsuite/Magento/Setup/SchemaReaderTest.php +++ b/dev/tests/setup-integration/testsuite/Magento/Setup/SchemaReaderTest.php @@ -41,7 +41,7 @@ public function testSuccessfullRead() { $schema = $this->reader->read('all'); unset($schema['table']['patch_list']); - self::assertEquals($this->getData(), $schema); + $this->assertEquals($this->getData(), $schema); } /** @@ -80,6 +80,6 @@ public function testForeignKeyInterpreter() $this->updateRevisionTo('foreign_key_interpreter'); $schema = $this->reader->read('all'); unset($schema['table']['patch_list']); - self::assertEquals($this->getData(), $schema); + $this->assertEquals($this->getData(), $schema); } } diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/DiRuleTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/DiRuleTest.php index 1f4c11f17e9e5..fe453a2ffa5c5 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/DiRuleTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/DiRuleTest.php @@ -24,7 +24,7 @@ public function testGetDependencyInfo($module, $contents, array $expected) ] ])); $file = '/some/path/scope/di.xml'; - static::assertEquals($expected, $diRule->getDependencyInfo($module, null, $file, $contents)); + $this->assertEquals($expected, $diRule->getDependencyInfo($module, null, $file, $contents)); } /** diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/VirtualType/VirtualTypeMapperTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/VirtualType/VirtualTypeMapperTest.php index 4fac6d178d515..0073331be188b 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/VirtualType/VirtualTypeMapperTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Dependency/VirtualType/VirtualTypeMapperTest.php @@ -35,7 +35,7 @@ protected function setUp() public function testGetScopeFromFile() { $file = '/path/to/file/scope/filename.ext'; - static::assertEquals('scope', $this->mapper->getScopeFromFile($file)); + $this->assertEquals('scope', $this->mapper->getScopeFromFile($file)); } /** @@ -46,7 +46,7 @@ public function testGetScopeFromFile() */ public function testGetType($scope, $type, $expected) { - static::assertEquals($expected, $this->mapper->getType($type, $scope)); + $this->assertEquals($expected, $this->mapper->getType($type, $scope)); } /** @@ -112,7 +112,7 @@ public function testGetTypeComplex(array $diFilesPath, array $expectedVirtualTyp foreach ($expectedVirtualTypesDependencies as $scope => $deps) { foreach ($deps as $virtualType => $baseType) { - self::assertEquals($baseType, $mapper->getType($virtualType, $scope)); + $this->assertEquals($baseType, $mapper->getType($virtualType, $scope)); } } } diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/XssOutputValidatorTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/XssOutputValidatorTest.php index ed9d8115cca4e..14300cffba043 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/XssOutputValidatorTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Utility/XssOutputValidatorTest.php @@ -16,7 +16,7 @@ public function testGetLinesWithXssSensitiveOutput($file, $expectedResults) { $xssOutputValidator = new XssOutputValidator(); $lines = $xssOutputValidator->getLinesWithXssSensitiveOutput($file); - static::assertEquals($expectedResults, $lines); + $this->assertEquals($expectedResults, $lines); } /** diff --git a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php index 3292fa61906eb..d8d7a6d4d76c1 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/PageCache/FormKeyTest.php @@ -84,7 +84,7 @@ public function testSet() ->disableOriginalConstructor() ->getMock(); - $this->cookieManagerMock->expects(static::once()) + $this->cookieManagerMock->expects($this->once()) ->method('setPublicCookie') ->with( FormKey::COOKIE_NAME, @@ -106,26 +106,26 @@ public function testDelete() ->disableOriginalConstructor() ->getMock(); - $this->cookieMetadataFactory->expects(static::once()) + $this->cookieMetadataFactory->expects($this->once()) ->method('createCookieMetadata') ->willReturn($metadata); - $this->sessionManager->expects(static::once()) + $this->sessionManager->expects($this->once()) ->method('getCookiePath') ->willReturn($cookiePath); - $metadata->expects(static::once()) + $metadata->expects($this->once()) ->method('setPath') ->with($cookiePath) ->willReturnSelf(); - $this->sessionManager->expects(static::once()) + $this->sessionManager->expects($this->once()) ->method('getCookieDomain') ->willReturn($cookieDomain); - $metadata->expects(static::once()) + $metadata->expects($this->once()) ->method('setDomain') ->with($cookieDomain) ->willReturnSelf(); - $this->cookieManagerMock->expects(static::once()) + $this->cookieManagerMock->expects($this->once()) ->method('deleteCookie') ->with( FormKey::COOKIE_NAME, diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php index e1588db4ba97c..2fe646ede5354 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php @@ -87,22 +87,22 @@ public function testProcessContentException() { $assetMock = $this->getAssetMock(); - $this->appStateMock->expects(self::once()) + $this->appStateMock->expects($this->once()) ->method('getMode') ->willReturn(State::MODE_DEVELOPER); - $this->assetSourceMock->expects(self::once()) + $this->assetSourceMock->expects($this->once()) ->method('getContent') ->with($assetMock) ->willThrowException(new \Exception(self::ERROR_MESSAGE)); - $this->loggerMock->expects(self::never()) + $this->loggerMock->expects($this->never()) ->method('critical'); - $this->temporaryFileMock->expects(self::never()) + $this->temporaryFileMock->expects($this->never()) ->method('createFile'); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getPath') ->willReturn(self::ASSET_PATH); @@ -116,23 +116,23 @@ public function testProcessContentEmpty() { $assetMock = $this->getAssetMock(); - $this->appStateMock->expects(self::once()) + $this->appStateMock->expects($this->once()) ->method('getMode') ->willReturn(State::MODE_DEVELOPER); - $this->assetSourceMock->expects(self::once()) + $this->assetSourceMock->expects($this->once()) ->method('getContent') ->with($assetMock) ->willReturn(''); - $this->temporaryFileMock->expects(self::never()) + $this->temporaryFileMock->expects($this->never()) ->method('createFile'); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getPath') ->willReturn(self::ASSET_PATH); - $this->loggerMock->expects(self::never()) + $this->loggerMock->expects($this->never()) ->method('critical'); $this->processor->processContent($assetMock); @@ -145,29 +145,29 @@ public function testProcessContentNotEmpty() { $assetMock = $this->getAssetMock(); - $this->appStateMock->expects(self::once()) + $this->appStateMock->expects($this->once()) ->method('getMode') ->willReturn(State::MODE_DEVELOPER); - $this->assetSourceMock->expects(self::once()) + $this->assetSourceMock->expects($this->once()) ->method('getContent') ->with($assetMock) ->willReturn(self::TEST_CONTENT); - $this->temporaryFileMock->expects(self::once()) + $this->temporaryFileMock->expects($this->once()) ->method('createFile') ->with(self::ASSET_PATH, self::TEST_CONTENT) ->willReturn(__DIR__ . '/' . self::TMP_PATH_LESS); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getPath') ->willReturn(self::ASSET_PATH); - $this->loggerMock->expects(self::never()) + $this->loggerMock->expects($this->never()) ->method('critical'); $clearSymbol = ["\n", "\r", "\t", ' ']; - self::assertEquals( + $this->assertEquals( trim(str_replace($clearSymbol, '', file_get_contents(__DIR__ . '/' . self::TMP_PATH_CSS))), trim(str_replace($clearSymbol, '', $this->processor->processContent($assetMock))) ); diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKeyTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKeyTest.php index 5d765955f3673..a27911376f753 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKeyTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/FormKeyTest.php @@ -81,19 +81,19 @@ public function testGetFormKeyExists() public function testIsPresent() { - $this->sessionMock->expects(static::once()) + $this->sessionMock->expects($this->once()) ->method('getData') ->with(FormKey::FORM_KEY) ->willReturn('Form key'); - static::assertTrue($this->formKey->isPresent()); + $this->assertTrue($this->formKey->isPresent()); } public function testSet() { $formKeyValue = 'Form key'; - $this->sessionMock->expects(static::once()) + $this->sessionMock->expects($this->once()) ->method('setData') ->with(FormKey::FORM_KEY, $formKeyValue); diff --git a/lib/internal/Magento/Framework/Math/Test/Unit/FloatComparatorTest.php b/lib/internal/Magento/Framework/Math/Test/Unit/FloatComparatorTest.php index c9e5143ee789e..8eabb9e125b68 100644 --- a/lib/internal/Magento/Framework/Math/Test/Unit/FloatComparatorTest.php +++ b/lib/internal/Magento/Framework/Math/Test/Unit/FloatComparatorTest.php @@ -35,7 +35,7 @@ protected function setUp() */ public function testEq(float $a, float $b, bool $expected) { - self::assertEquals($expected, $this->comparator->equal($a, $b)); + $this->assertEquals($expected, $this->comparator->equal($a, $b)); } /** @@ -64,7 +64,7 @@ public function eqDataProvider(): array */ public function testGt(float $a, float $b, bool $expected) { - self::assertEquals($expected, $this->comparator->greaterThan($a, $b)); + $this->assertEquals($expected, $this->comparator->greaterThan($a, $b)); } /** @@ -93,7 +93,7 @@ public function gtDataProvider(): array */ public function testGte(float $a, float $b, bool $expected) { - self::assertEquals($expected, $this->comparator->greaterThanOrEqual($a, $b)); + $this->assertEquals($expected, $this->comparator->greaterThanOrEqual($a, $b)); } /** diff --git a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Code/Generator/RemoteServiceGeneratorTest.php b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Code/Generator/RemoteServiceGeneratorTest.php index e81dc65c6869e..1bc84437196d2 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Code/Generator/RemoteServiceGeneratorTest.php +++ b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Code/Generator/RemoteServiceGeneratorTest.php @@ -119,7 +119,7 @@ private function validateGeneratedCode($expectedResult) $reflectionMethod = $reflectionObject->getMethod('_generateCode'); $reflectionMethod->setAccessible(true); $generatedCode = $reflectionMethod->invoke($this->generator); - self::assertEquals($expectedResult, $generatedCode); + $this->assertEquals($expectedResult, $generatedCode); } /** diff --git a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Consumer/ConfigReaderPluginTest.php b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Consumer/ConfigReaderPluginTest.php index 0eaddf35004e7..3cb06ccdc4a18 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Consumer/ConfigReaderPluginTest.php +++ b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Consumer/ConfigReaderPluginTest.php @@ -91,7 +91,7 @@ public function testAfterRead() 'consumer0' => [] ]; - $this->configMock->expects(static::atLeastOnce()) + $this->configMock->expects($this->atLeastOnce()) ->method('getConsumers') ->willReturn($consumers); diff --git a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Publisher/ConfigReaderPluginTest.php b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Publisher/ConfigReaderPluginTest.php index 52297da5422d9..b41208cab4352 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Publisher/ConfigReaderPluginTest.php +++ b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Publisher/ConfigReaderPluginTest.php @@ -82,10 +82,10 @@ public function testAfterRead() 'topic0' => [] ]; - $this->configMock->expects(static::atLeastOnce()) + $this->configMock->expects($this->atLeastOnce()) ->method('getBinds') ->willReturn($binds); - $this->configMock->expects(static::atLeastOnce()) + $this->configMock->expects($this->atLeastOnce()) ->method('getConnectionByTopic') ->willReturnMap( [ diff --git a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Topology/ConfigReaderPluginTest.php b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Topology/ConfigReaderPluginTest.php index c270a923a759d..06e68103bad31 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Topology/ConfigReaderPluginTest.php +++ b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Config/Topology/ConfigReaderPluginTest.php @@ -135,10 +135,10 @@ public function testAfterRead() ] ]; - $this->configMock->expects(static::atLeastOnce()) + $this->configMock->expects($this->atLeastOnce()) ->method('getBinds') ->willReturn($binding); - $this->configMock->expects(static::exactly(2)) + $this->configMock->expects($this->exactly(2)) ->method('getConnectionByTopic') ->willReturnMap([ ['catalog.product.removed', 'db'], diff --git a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/PublisherTest.php b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/PublisherTest.php index 576da8b9a006b..6c79bee14e5dd 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/PublisherTest.php +++ b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/PublisherTest.php @@ -123,43 +123,43 @@ public function testPublish() $exchange = $this->getMockBuilder(Exchange::class) ->disableOriginalConstructor() ->getMock(); - $exchange->expects(self::once()) + $exchange->expects($this->once()) ->method('enqueue') - ->with(self::identicalTo($topicName), self::identicalTo($envelope)) + ->with($this->identicalTo($topicName), $this->identicalTo($envelope)) ->willReturn(null); $connection = $this->getMockBuilder(PublisherConnection::class) ->disableOriginalConstructor() ->getMock(); - $connection->expects(self::once()) + $connection->expects($this->once()) ->method('getName') ->willReturn('amqp'); $publisher = $this->getMockBuilder(PublisherConfigItem::class) ->disableOriginalConstructor() ->getMock(); - $publisher->expects(self::once()) + $publisher->expects($this->once()) ->method('getConnection') ->willReturn($connection); - $this->messageValidator->expects(self::once()) + $this->messageValidator->expects($this->once()) ->method('validate'); - $this->messageEncoder->expects(self::once()) + $this->messageEncoder->expects($this->once()) ->method('encode') - ->with(self::identicalTo($topicName), self::identicalTo($data)) + ->with($this->identicalTo($topicName), $this->identicalTo($data)) ->willReturn($encodedData); - $this->envelopeFactory->expects(self::once()) + $this->envelopeFactory->expects($this->once()) ->method('create') ->willReturn($envelope); - $this->publisherConfig->expects(self::once()) + $this->publisherConfig->expects($this->once()) ->method('getPublisher') ->with($topicName) ->willReturn($publisher); - $this->amqpConfig->expects(self::once()) + $this->amqpConfig->expects($this->once()) ->method('getValue') ->with(AmqpConfig::HOST) ->willReturn(''); - $this->exchangeRepository->expects(self::once()) + $this->exchangeRepository->expects($this->once()) ->method('getByConnectionName') ->with('db') ->willReturn($exchange); - self::assertNull($this->publisher->publish($topicName, $data)); + $this->assertNull($this->publisher->publish($topicName, $data)); } } diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/DbVersionInfoTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/DbVersionInfoTest.php index c36d4bf7d5e93..5f5abdf7f84ce 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/DbVersionInfoTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/DbVersionInfoTest.php @@ -65,7 +65,7 @@ public function testIsDbSchemaUpToDate($moduleName, $dbVersion, $expectedResult) ->method('getDbVersion') ->with($moduleName) ->will($this->returnValue($dbVersion)); - $this->moduleList->expects(self::once()) + $this->moduleList->expects($this->once()) ->method('getOne') ->with($moduleName) ->willReturn( @@ -90,7 +90,7 @@ public function testIsDbDataUpToDate($moduleName, $dbVersion, $expectedResult) ->method('getDataVersion') ->with($moduleName) ->will($this->returnValue($dbVersion)); - $this->moduleList->expects(self::once()) + $this->moduleList->expects($this->once()) ->method('getOne') ->with($moduleName) ->willReturn( diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php index 5311df23ce274..6675ef6f8e858 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/TMapTest.php @@ -35,13 +35,13 @@ protected function setUp() public function testConstructor() { $tMap = $this->getSimpleInitialized(3); - static::assertEquals(3, $tMap->count()); + $this->assertEquals(3, $tMap->count()); } public function testRead() { $tMap = $this->getSimpleInitialized(3); - $this->om->expects(static::exactly(3)) + $this->om->expects($this->exactly(3)) ->method('create') ->willReturnMap( [ @@ -52,7 +52,7 @@ public function testRead() ); foreach ($tMap as $instance) { - static::assertInstanceOf('\TInterface', $instance); + $this->assertInstanceOf('\TInterface', $instance); } } @@ -63,11 +63,11 @@ public function testRemove() { $tMap = $this->getSimpleInitialized(3); - static::assertEquals(3, $tMap->count()); + $this->assertEquals(3, $tMap->count()); foreach ($tMap as $key => $instance) { unset($tMap[$key]); } - static::assertEquals(0, $tMap->count()); + $this->assertEquals(0, $tMap->count()); } /** @@ -89,7 +89,7 @@ public function testEdit() $tMap['item2'] = 'TClass'; $tMap[] = 'TInterface'; - $this->om->expects(static::exactly(4)) + $this->om->expects($this->exactly(4)) ->method('create') ->willReturnMap( [ @@ -101,11 +101,11 @@ public function testEdit() $i = 0; foreach ($tMap as $key => $item) { - static::assertEquals($expectedKeysOrder[$i], $key); + $this->assertEquals($expectedKeysOrder[$i], $key); $i++; } - static::assertEquals(4, $tMap->count()); + $this->assertEquals(4, $tMap->count()); } /** @@ -129,7 +129,7 @@ private function getSimpleInitialized($exactlyCalls = 3) 3 => 'TInterface' ]; - $this->omConfig->expects(static::exactly($exactlyCalls)) + $this->omConfig->expects($this->exactly($exactlyCalls)) ->method('getPreference') ->willReturnMap( [ @@ -138,7 +138,7 @@ private function getSimpleInitialized($exactlyCalls = 3) ['TInterface', 'TClassVirtual'] ] ); - $this->omConfig->expects(static::exactly($exactlyCalls)) + $this->omConfig->expects($this->exactly($exactlyCalls)) ->method('getInstanceType') ->willReturnMap( [ diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php index cf2d24cc69440..627f9286e72ca 100644 --- a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeCasterTest.php @@ -47,11 +47,11 @@ protected function setUp() */ public function testCastValues($origValue, $typeToCast, $expectedValue) { - $this->serializer->expects(self::never()) + $this->serializer->expects($this->never()) ->method('serialize'); $value = $this->model->castValueToType($origValue, $typeToCast); - self::assertEquals($expectedValue, $value); + $this->assertEquals($expectedValue, $value); } /** @@ -65,13 +65,13 @@ public function testCastValues($origValue, $typeToCast, $expectedValue) */ public function testCastValueToType(array $origValue, $typeToCast, $expected) { - $this->serializer->expects(self::once()) + $this->serializer->expects($this->once()) ->method('serialize') - ->with(self::equalTo($origValue)) + ->with($this->equalTo($origValue)) ->willReturn(json_encode($origValue)); $actual = $this->model->castValueToType($origValue, $typeToCast); - self::assertEquals($expected, $actual); + $this->assertEquals($expected, $actual); } /** diff --git a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php index 86a4693d9e5b6..6c51d795b3e99 100644 --- a/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php +++ b/lib/internal/Magento/Framework/Reflection/Test/Unit/TypeProcessorTest.php @@ -339,7 +339,7 @@ public function testGetReturnTypeWithInheritDocBlock() $classReflection = new ClassReflection(TSample::class); $methodReflection = $classReflection->getMethod('getPropertyName'); - self::assertEquals($expected, $this->typeProcessor->getGetterReturnType($methodReflection)); + $this->assertEquals($expected, $this->typeProcessor->getGetterReturnType($methodReflection)); } /** diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/SchemaBuilderTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/SchemaBuilderTest.php index 4e0c129204012..f49b19e1ff23c 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/SchemaBuilderTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/SchemaBuilderTest.php @@ -280,7 +280,7 @@ public function testBuild(array $columns, array $references, array $constraints, $resourceConnectionMock = $this->getMockBuilder(ResourceConnection::class) ->disableOriginalConstructor() ->getMock(); - $resourceConnectionMock->expects(self::any()) + $resourceConnectionMock->expects($this->any()) ->method('getTableName') ->willReturnArgument(0); /** @var Schema $schema */ @@ -331,10 +331,10 @@ public function testBuildUnknownIndexColumn(array $columns, array $references, a private function prepareSchemaMocks(array $columns, array $references, array $constraints, array $indexes) { $withContext = [['first_table', 'default'], ['second_table', 'default']]; - $this->shardingMock->expects(self::once()) + $this->shardingMock->expects($this->once()) ->method('getResources') ->willReturn(['default']); - $this->dbSchemaReaderMock->expects(self::once()) + $this->dbSchemaReaderMock->expects($this->once()) ->method('readTables') ->with('default') ->willReturn(['first_table', 'second_table']); diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/StatementAggregatorTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/StatementAggregatorTest.php index 904b1791bc088..24b6056a764f3 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/StatementAggregatorTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Db/StatementAggregatorTest.php @@ -44,17 +44,17 @@ public function testAddStatementsInOneBank() ->disableOriginalConstructor() ->getMock(); $statementsBank = [$statementOne, $statementTwo, $statementThree]; - $statementOne->expects(self::exactly(2)) + $statementOne->expects($this->exactly(2)) ->method('getTableName') ->willReturn('first_table'); - $statementTwo->expects(self::exactly(2)) + $statementTwo->expects($this->exactly(2)) ->method('getTableName') ->willReturn('first_table'); - $statementThree->expects(self::exactly(2)) + $statementThree->expects($this->exactly(2)) ->method('getTableName') ->willReturn('first_table'); $this->model->addStatements($statementsBank); - self::assertEquals( + $this->assertEquals( [$statementsBank], $this->model->getStatementsBank() ); @@ -71,17 +71,17 @@ public function testAddStatementsForDifferentTables() $statementThree = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() ->getMock(); - $statementOne->expects(self::exactly(2)) + $statementOne->expects($this->exactly(2)) ->method('getTableName') ->willReturn('first_table'); - $statementTwo->expects(self::exactly(1)) + $statementTwo->expects($this->exactly(1)) ->method('getTableName') ->willReturn('second_table'); - $statementThree->expects(self::exactly(1)) + $statementThree->expects($this->exactly(1)) ->method('getTableName') ->willReturn('first_table'); $this->model->addStatements([$statementOne, $statementTwo, $statementThree]); - self::assertEquals( + $this->assertEquals( [[$statementOne, $statementThree], [$statementTwo]], $this->model->getStatementsBank() ); @@ -98,11 +98,11 @@ public function testAddStatementsForDifferentResources() $statementThree = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() ->getMock(); - $statementOne->expects(self::exactly(2)) + $statementOne->expects($this->exactly(2)) ->method('getResource') ->willReturn('non_default'); $this->model->addStatements([$statementOne, $statementTwo, $statementThree]); - self::assertEquals( + $this->assertEquals( [[$statementOne], [$statementTwo, $statementThree]], $this->model->getStatementsBank() ); @@ -119,7 +119,7 @@ public function testAddStatementsWithTriggersInLastStatement() $statementThree = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() ->getMock(); - $statementThree->expects(self::exactly(0)) + $statementThree->expects($this->exactly(0)) ->method('getTriggers') ->willReturn( [ @@ -128,7 +128,7 @@ function () { ] ); $this->model->addStatements([$statementOne, $statementTwo, $statementThree]); - self::assertEquals( + $this->assertEquals( [[$statementOne, $statementTwo, $statementThree]], $this->model->getStatementsBank() ); @@ -145,7 +145,7 @@ public function testAddStatementsWithTriggers() $statementThree = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() ->getMock(); - $statementOne->expects(self::exactly(2)) + $statementOne->expects($this->exactly(2)) ->method('getTriggers') ->willReturn( [ @@ -154,7 +154,7 @@ function () { ] ); $this->model->addStatements([$statementOne, $statementTwo, $statementThree]); - self::assertEquals( + $this->assertEquals( [[$statementOne], [$statementTwo, $statementThree]], $this->model->getStatementsBank() ); @@ -171,14 +171,14 @@ public function testAddReferenceStatements() $statementThree = $this->getMockBuilder(ReferenceStatement::class) ->disableOriginalConstructor() ->getMock(); - $statementThree->expects(self::exactly(1)) + $statementThree->expects($this->exactly(1)) ->method('getName') ->willReturn('some_foreign_key'); - $statementOne->expects(self::exactly(1)) + $statementOne->expects($this->exactly(1)) ->method('getName') ->willReturn('some_foreign_key'); $this->model->addStatements([$statementOne, $statementTwo, $statementThree]); - self::assertEquals( + $this->assertEquals( [[$statementOne, $statementTwo], [$statementThree]], $this->model->getStatementsBank() ); diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Declaration/SchemaBuilderTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Declaration/SchemaBuilderTest.php index a590a50edb72f..07b3752e976e7 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Declaration/SchemaBuilderTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Declaration/SchemaBuilderTest.php @@ -327,7 +327,7 @@ public function testBuild(array $tablesData) $firstTableConstraints = [$foreignKey, $primaryKey]; $table->addColumns($firstTableColumns); $table->addConstraints($firstTableConstraints); - $this->elementFactoryMock->expects(self::exactly(9)) + $this->elementFactoryMock->expects($this->exactly(9)) ->method('create') ->willReturnOnConsecutiveCalls( $table, @@ -348,10 +348,10 @@ public function testBuild(array $tablesData) Schema::class, ['resourceConnection' => $resourceConnectionMock] ); - $this->resourceConnectionMock->expects(self::once()) + $this->resourceConnectionMock->expects($this->once()) ->method('getTableName') ->willReturn('second_table'); - $resourceConnectionMock->expects(self::exactly(6)) + $resourceConnectionMock->expects($this->exactly(6)) ->method('getTableName') ->withConsecutive( ['first_table'], diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Diff/DiffManagerTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Diff/DiffManagerTest.php index 22dc6c6d18a9e..b3c519d7eb1b8 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Diff/DiffManagerTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Diff/DiffManagerTest.php @@ -62,8 +62,8 @@ public function testShouldBeCreated() ); $element = new Column('third', 'int', $table); $existingElement = new Column('second', 'int', $table); - self::assertTrue($this->model->shouldBeCreated($elements, $element)); - self::assertFalse($this->model->shouldBeCreated($elements, $existingElement)); + $this->assertTrue($this->model->shouldBeCreated($elements, $element)); + $this->assertFalse($this->model->shouldBeCreated($elements, $existingElement)); } public function testRegisterModification() @@ -84,7 +84,7 @@ public function testRegisterModification() ); $element = new Column('third', 'int', $table); $generatedElement = new Column('third', 'int', $table, 'Previous column'); - $diff->expects(self::once()) + $diff->expects($this->once()) ->method('register') ->with($element, 'modify_column', $generatedElement); $this->model->registerModification($diff, $element, $generatedElement); @@ -109,7 +109,7 @@ public function testRegisterIndexModification() $column = new Column('third', 'int', $table, 'Previous column'); $index = new Index('index_type', 'index', $table, [$column], 'btree', 'index_type'); $generatedIndex = new Index('index_type', 'index', $table, [$column], 'hash', 'index_type'); - $diff->expects(self::exactly(2)) + $diff->expects($this->exactly(2)) ->method('register') ->withConsecutive([$generatedIndex, 'drop_element', $generatedIndex], [$index, 'add_complex_element']); $this->model->registerModification($diff, $index, $generatedIndex); @@ -143,7 +143,7 @@ public function testRegisterRemovalReference() ); $column = new Column('third', 'int', $table, 'Previous column'); $reference = new Reference('ref', 'foreign', $table, 'ref', $column, $refTable, $column, 'CASCADE'); - $diff->expects(self::exactly(2)) + $diff->expects($this->exactly(2)) ->method('register') ->withConsecutive( [$reference, 'drop_reference', $reference], @@ -170,7 +170,7 @@ public function testRegisterCreation() ); $column = new Column('third', 'int', $table, 'Previous column'); $reference = new Reference('ref', 'foreign', $table, 'ref', $column, $table, $column, 'CASCADE'); - $diff->expects(self::exactly(3)) + $diff->expects($this->exactly(3)) ->method('register') ->withConsecutive( [$table, 'create_table'], @@ -208,7 +208,7 @@ public function testRegisterTableModificationWhenChangeResource() 'utf_8_general_ci', '' ); - $diff->expects(self::once()) + $diff->expects($this->once()) ->method('register') ->with($table, 'recreate_table', $generateTable); $this->model->registerRecreation($table, $generateTable, $diff); @@ -240,7 +240,7 @@ public function testRegisterTableModificationWhenChangeEngine() 'utf_8_general_ci', '' ); - $diff->expects(self::once()) + $diff->expects($this->once()) ->method('register') ->with($table, 'modify_table', $generateTable); $this->model->registerTableModification($table, $generateTable, $diff); diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Dto/Factories/TableTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Dto/Factories/TableTest.php index fc7e097dc446d..4af90f4ddb9aa 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Dto/Factories/TableTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Dto/Factories/TableTest.php @@ -46,7 +46,7 @@ protected function setUp() public function testCreate() { - $this->resourceConnectionMock->expects(self::once()) + $this->resourceConnectionMock->expects($this->once()) ->method('getTablePrefix') ->willReturn('pf_'); $data = [ @@ -61,7 +61,7 @@ public function testCreate() 'collation' => 'utf8_general_ci', 'onCreate' => '' ]; - $this->objectManagerMock->expects(self::once()) + $this->objectManagerMock->expects($this->once()) ->method('create') ->with(Table::class, $expectedData); $this->model->create($data); @@ -69,7 +69,7 @@ public function testCreate() public function testCreateWithPrefix() { - $this->resourceConnectionMock->expects(self::once()) + $this->resourceConnectionMock->expects($this->once()) ->method('getTablePrefix') ->willReturn('pf_'); $data = [ @@ -85,7 +85,7 @@ public function testCreateWithPrefix() 'collation' => 'utf8_general_ci', 'onCreate' => '' ]; - $this->objectManagerMock->expects(self::once()) + $this->objectManagerMock->expects($this->once()) ->method('create') ->with(Table::class, $expectedData); $this->model->create($data); diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Operations/AddColumnTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Operations/AddColumnTest.php index a8a8fb5b0c40c..76a265c5591ef 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Operations/AddColumnTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/Operations/AddColumnTest.php @@ -157,54 +157,54 @@ public function testDoOperation() $column = $this->prepareColumn(); $elementHistory = new ElementHistory($column); $definition = '`int` INT(11) NOT NULL DEFAULT 0 Comment "Azaza"'; - $this->definitionAggregatorMock->expects(self::once()) + $this->definitionAggregatorMock->expects($this->once()) ->method('toDefinition') ->with($column) ->willReturn($definition); - $this->migrateDataTrigger->expects(self::once()) + $this->migrateDataTrigger->expects($this->once()) ->method('isApplicable') ->with('migrateDataFrom(v)') ->willReturn(true); - $this->migrateDataTrigger->expects(self::once()) + $this->migrateDataTrigger->expects($this->once()) ->method('getCallback') ->with($elementHistory) ->willReturn($callback); $statement = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() ->getMock(); - $statement->expects(self::once()) + $statement->expects($this->once()) ->method('addTrigger') ->with($callback); - $this->dbSchemaWriterMock->expects(self::once()) + $this->dbSchemaWriterMock->expects($this->once()) ->method('addElement') ->with('int', 'default', 'table', $definition, 'column') ->willReturn($statement); $index = new Index('index', 'index', $column->getTable(), [$column], 'btree', 'index'); - $this->elementFactoryMock->expects(self::once()) + $this->elementFactoryMock->expects($this->once()) ->method('create') ->willReturn($index); $indexHistory = new ElementHistory($index); - $statement->expects(self::once()) + $statement->expects($this->once()) ->method('getTriggers') ->willReturn([$callback]); - $this->elementHistoryFactoryMock->expects(self::once()) + $this->elementHistoryFactoryMock->expects($this->once()) ->method('create') ->willReturn($indexHistory); - $this->addComplexElementMock->expects(self::once()) + $this->addComplexElementMock->expects($this->once()) ->method('doOperation') ->with($indexHistory) ->willReturn([$addComplexStatement]); - $this->dropElementMock->expects(self::once()) + $this->dropElementMock->expects($this->once()) ->method('doOperation') ->with($indexHistory) ->willReturn([$dropComplexElement]); $resetAIStatement = $this->getMockBuilder(Statement::class) ->disableOriginalConstructor() ->getMock(); - $this->dbSchemaWriterMock->expects(self::once()) + $this->dbSchemaWriterMock->expects($this->once()) ->method('resetAutoIncrement') ->willReturn($resetAIStatement); - self::assertEquals( + $this->assertEquals( [$addComplexStatement, $statement, $dropComplexElement, $resetAIStatement], $this->model->doOperation($elementHistory) ); diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/OperationsExecutorTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/OperationsExecutorTest.php index 26cbc0afc5595..80ff5a7bae38f 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/OperationsExecutorTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/OperationsExecutorTest.php @@ -94,7 +94,7 @@ protected function setUp() $this->createTableOperation = $this->getMockBuilder(CreateTable::class) ->disableOriginalConstructor() ->getMock(); - $this->createTableOperation->expects(self::exactly(2)) + $this->createTableOperation->expects($this->exactly(2)) ->method('getOperationName') ->willReturn('create_table'); $this->dropElement = $this->getMockBuilder(DropElement::class) @@ -151,20 +151,20 @@ public function testExecute() /** @var DiffInterface|\PHPUnit_Framework_MockObject_MockObject $diff */ $diff = $this->getMockBuilder(DiffInterface::class) ->getMock(); - $this->shardingMock->expects(self::exactly(2)) + $this->shardingMock->expects($this->exactly(2)) ->method('getResources') ->willReturn(['default']); $connectionMock = $this->getMockBuilder(Mysql::class) ->disableOriginalConstructor() ->getMock(); - $this->resourceConnectionMock->expects(self::exactly(3)) + $this->resourceConnectionMock->expects($this->exactly(3)) ->method('getConnection') ->with('default') ->willReturn($connectionMock); $statementAggregator = $this->getMockBuilder(StatementAggregator::class) ->disableOriginalConstructor() ->getMock(); - $this->statementAggregatorFactoryMock->expects(self::once()) + $this->statementAggregatorFactoryMock->expects($this->once()) ->method('create') ->willReturn($statementAggregator); $elementHistory = new ElementHistory($this->prepareTable()); @@ -173,20 +173,20 @@ public function testExecute() 'create_table' => [$elementHistory] ] ]; - $this->createTableOperation->expects(self::once()) + $this->createTableOperation->expects($this->once()) ->method('doOperation') ->with($elementHistory) ->willReturn(['TABLE table (`int` INT(11))']); - $statementAggregator->expects(self::once()) + $statementAggregator->expects($this->once()) ->method('addStatements') ->with(['TABLE table (`int` INT(11))']); - $this->dbSchemaWriterMock->expects(self::once()) + $this->dbSchemaWriterMock->expects($this->once()) ->method('compile') ->with($statementAggregator); - $diff->expects(self::once()) + $diff->expects($this->once()) ->method('getAll') ->willReturn($tablesHistories); - $this->dropElement->expects(self::at(0)) + $this->dropElement->expects($this->at(0)) ->method('doOperation'); $this->model->execute($diff, []); } diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ShardingTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ShardingTest.php index 4a73816ba89ff..c664fb8e89335 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ShardingTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ShardingTest.php @@ -38,19 +38,19 @@ protected function setUp() public function testCanUseResource() { - $this->deploymentConfigMock->expects(self::once()) + $this->deploymentConfigMock->expects($this->once()) ->method('get') ->with('db/connection') ->willReturn(['default']); - self::assertFalse($this->model->canUseResource('checkout')); + $this->assertFalse($this->model->canUseResource('checkout')); } public function testGetResources() { - $this->deploymentConfigMock->expects(self::exactly(3)) + $this->deploymentConfigMock->expects($this->exactly(3)) ->method('get') ->with('db/connection') ->willReturn(['default' => 1, 'sales' => 2, 'index' => 3]); - self::assertEquals(['default', 'sales'], $this->model->getResources()); + $this->assertEquals(['default', 'sales'], $this->model->getResources()); } } diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/CheckReferenceColumnHasIndexTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/CheckReferenceColumnHasIndexTest.php index 396cc2b2e5b34..67872e4bf90d6 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/CheckReferenceColumnHasIndexTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/CheckReferenceColumnHasIndexTest.php @@ -74,10 +74,10 @@ public function testValidate() $schemaMock = $this->getMockBuilder(Schema::class) ->disableOriginalConstructor() ->getMock(); - $schemaMock->expects(self::once()) + $schemaMock->expects($this->once()) ->method('getTables') ->willReturn([$table]); - self::assertEquals( + $this->assertEquals( [ [ 'column' => 'ref_decimal', diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/RealTypesTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/RealTypesTest.php index 0c0d4ac2b4555..7c25bac05fecf 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/RealTypesTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/RealTypesTest.php @@ -49,11 +49,11 @@ public function testValidate() $schemaMock = $this->getMockBuilder(Schema::class) ->disableOriginalConstructor() ->getMock(); - $schemaMock->expects(self::once()) + $schemaMock->expects($this->once()) ->method('getTables') ->willReturn([$table]); - self::assertEquals( + $this->assertEquals( [ [ 'column' => 'name.float', diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/ValidationRulesTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/ValidationRulesTest.php index ad547053f7bf2..0bb14b85620ec 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/ValidationRulesTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Declaration/Schema/ValidationRules/ValidationRulesTest.php @@ -78,10 +78,10 @@ public function testValidate() $schemaMock = $this->getMockBuilder(Schema::class) ->disableOriginalConstructor() ->getMock(); - $schemaMock->expects(self::once()) + $schemaMock->expects($this->once()) ->method('getTables') ->willReturn([$table]); - self::assertEquals( + $this->assertEquals( [ [ 'column' => 'ref_decimal', diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php index f89bdc9e137dd..958e20712a23c 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php @@ -234,26 +234,26 @@ public function testApplyDataPatchForInstalledModule($moduleName, $dataPatches, $patches, ['registerPatch'] ); - $patchRegistryMock->expects(self::exactly(2)) + $patchRegistryMock->expects($this->exactly(2)) ->method('registerPatch'); - $this->patchRegistryFactoryMock->expects(self::any()) + $this->patchRegistryFactoryMock->expects($this->any()) ->method('create') ->willReturn($patchRegistryMock); $patch1 = $this->createMock(\SomeDataPatch::class); - $patch1->expects(self::never())->method('apply'); + $patch1->expects($this->never())->method('apply'); $patch2 = $this->createMock(\OtherDataPatch::class); - $patch2->expects(self::once())->method('apply'); - $this->objectManagerMock->expects(self::any())->method('create')->willReturnMap( + $patch2->expects($this->once())->method('apply'); + $this->objectManagerMock->expects($this->any())->method('create')->willReturnMap( [ ['\\' . \SomeDataPatch::class, ['moduleDataSetup' => $this->moduleDataSetupMock], $patch1], ['\\' . \OtherDataPatch::class, ['moduleDataSetup' => $this->moduleDataSetupMock], $patch2], ] ); - $this->connectionMock->expects(self::exactly(1))->method('beginTransaction'); - $this->connectionMock->expects(self::exactly(1))->method('commit'); - $this->patchHistoryMock->expects(self::exactly(2))->method('fixPatch'); + $this->connectionMock->expects($this->exactly(1))->method('beginTransaction'); + $this->connectionMock->expects($this->exactly(1))->method('commit'); + $this->patchHistoryMock->expects($this->exactly(2))->method('fixPatch'); $this->patchApllier->applyDataPatch($moduleName); } diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaListenerTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaListenerTest.php index 4e34b3aebbf3e..bc00e422ecf7e 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaListenerTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaListenerTest.php @@ -98,8 +98,8 @@ public function testRenameTable() : void $this->model->createTable($this->getCreateTableDDL('old_table')); $this->model->renameTable('old_table', 'new_table'); $tables = $this->model->getTables(); - self::assertArrayHasKey('new_table', $tables['First_Module']); - self::assertArrayNotHasKey('old_table', $tables['First_Module']); + $this->assertArrayHasKey('new_table', $tables['First_Module']); + $this->assertArrayNotHasKey('old_table', $tables['First_Module']); } public function testDropIndex() : void @@ -107,7 +107,7 @@ public function testDropIndex() : void $this->model->setModuleName('First_Module'); $this->model->createTable($this->getCreateTableDDL('index_table')); $this->model->dropIndex('index_table', 'INDEX_KEY', 'index'); - self::assertTrue($this->model->getTables()['First_Module']['index_table']['indexes']['INDEX_KEY']['disabled']); + $this->assertTrue($this->model->getTables()['First_Module']['index_table']['indexes']['INDEX_KEY']['disabled']); } public function testCreateTable() : void @@ -115,8 +115,8 @@ public function testCreateTable() : void $this->model->setModuleName('First_Module'); $this->model->createTable($this->getCreateTableDDL('new_table')); $tables = $this->model->getTables(); - self::assertArrayHasKey('new_table', $tables['First_Module']); - self::assertEquals( + $this->assertArrayHasKey('new_table', $tables['First_Module']); + $this->assertEquals( [ 'timestamp' => [ @@ -155,7 +155,7 @@ public function testCreateTable() : void ], $tables['First_Module']['new_table']['columns'] ); - self::assertEquals( + $this->assertEquals( [ 'primary' => [ @@ -186,7 +186,7 @@ public function testCreateTable() : void $tables['First_Module']['new_table']['constraints'] ); - self::assertEquals( + $this->assertEquals( [ 'INDEX_KEY' => [ @@ -208,7 +208,7 @@ public function testDropTable() : void $this->model->createTable($this->getCreateTableDDL('old_table')); $this->model->setModuleName('New_Module'); $this->model->dropTable('old_table'); - self::assertTrue($this->model->getTables()['New_Module']['old_table']['disabled']); + $this->assertTrue($this->model->getTables()['New_Module']['old_table']['disabled']); } public function testDropTableInSameModule() : void @@ -216,6 +216,6 @@ public function testDropTableInSameModule() : void $this->model->setModuleName('Old_Module'); $this->model->createTable($this->getCreateTableDDL('old_table')); $this->model->dropTable('old_table'); - self::assertArrayNotHasKey('old_table', $this->model->getTables()['Old_Module']); + $this->assertArrayNotHasKey('old_table', $this->model->getTables()['Old_Module']); } } diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaPersistorTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaPersistorTest.php index cc88af15a262b..1334b4790fa38 100644 --- a/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaPersistorTest.php +++ b/lib/internal/Magento/Framework/Setup/Test/Unit/SchemaPersistorTest.php @@ -68,16 +68,16 @@ public function testPersist(array $tables, $expectedXML) : void $schemaListenerMock = $this->getMockBuilder(SchemaListener::class) ->disableOriginalConstructor() ->getMock(); - $schemaListenerMock->expects(self::once()) + $schemaListenerMock->expects($this->once()) ->method('getTables') ->willReturn($tables); - $this->componentRegistrarMock->expects(self::once()) + $this->componentRegistrarMock->expects($this->once()) ->method('getPath') ->with('module', $moduleName) ->willReturn('some-non-existing-path'); $simpleXmlElement = new \SimpleXMLElement($expectedXML); $this->xmlPersistor - ->expects(self::once()) + ->expects($this->once()) ->method('persist') ->with($simpleXmlElement, 'some-non-existing-path/etc/db_schema.xml'); diff --git a/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php b/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php index 686c09e947509..a0b2167e39989 100644 --- a/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/App/ResourceConnectionTest.php @@ -74,28 +74,28 @@ public function testGetTablePrefixWithInjectedPrefix() ] ); - self::assertEquals($resourceConnection->getTablePrefix(), 'some_prefix'); + $this->assertEquals($resourceConnection->getTablePrefix(), 'some_prefix'); } public function testGetTablePrefix() { - $this->deploymentConfigMock->expects(self::once()) + $this->deploymentConfigMock->expects($this->once()) ->method('get') ->with(ConfigOptionsListConstants::CONFIG_PATH_DB_PREFIX) ->willReturn('pref_'); - self::assertEquals('pref_', $this->unit->getTablePrefix()); + $this->assertEquals('pref_', $this->unit->getTablePrefix()); } public function testGetConnectionByName() { - $this->deploymentConfigMock->expects(self::once())->method('get') + $this->deploymentConfigMock->expects($this->once())->method('get') ->with(ConfigOptionsListConstants::CONFIG_PATH_DB_CONNECTIONS . '/default') ->willReturn(['config']); - $this->connectionFactoryMock->expects(self::once())->method('create') + $this->connectionFactoryMock->expects($this->once())->method('create') ->with(['config']) ->willReturn('connection'); - self::assertEquals('connection', $this->unit->getConnectionByName('default')); + $this->assertEquals('connection', $this->unit->getConnectionByName('default')); } public function testGetExistingConnectionByName() @@ -107,14 +107,14 @@ public function testGetExistingConnectionByName() 'connections' => ['default_process_' . getmypid() => 'existing_connection'] ] ); - $this->deploymentConfigMock->expects(self::never())->method('get'); + $this->deploymentConfigMock->expects($this->never())->method('get'); - self::assertEquals('existing_connection', $unit->getConnectionByName('default')); + $this->assertEquals('existing_connection', $unit->getConnectionByName('default')); } public function testCloseConnection() { - $this->configMock->expects(self::once())->method('getConnectionName')->with('default'); + $this->configMock->expects($this->once())->method('getConnectionName')->with('default'); $this->unit->closeConnection('default'); } diff --git a/lib/internal/Magento/Framework/Test/Unit/Communication/Config/ValidatorTest.php b/lib/internal/Magento/Framework/Test/Unit/Communication/Config/ValidatorTest.php index 55410af176af0..15c6ee62503b0 100644 --- a/lib/internal/Magento/Framework/Test/Unit/Communication/Config/ValidatorTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/Communication/Config/ValidatorTest.php @@ -30,16 +30,16 @@ public function setUp() { $this->methodsMap = $this->createMock(MethodsMap::class); - $this->methodsMap->expects(static::any()) + $this->methodsMap->expects($this->any()) ->method('getMethodsMap') ->will($this->throwException(new \InvalidArgumentException('message', 333))); $this->typeProcessor = $this->createMock(TypeProcessor::class); - $this->typeProcessor->expects(static::any()) + $this->typeProcessor->expects($this->any()) ->method('isTypeSimple') ->willReturn(false); - $this->typeProcessor->expects(static::any()) + $this->typeProcessor->expects($this->any()) ->method('isTypeSimple') ->willReturn(false); } diff --git a/lib/internal/Magento/Framework/Test/Unit/Config/FileResolverByModuleTest.php b/lib/internal/Magento/Framework/Test/Unit/Config/FileResolverByModuleTest.php index 1a1f3391f0170..d8ba518a02ff1 100644 --- a/lib/internal/Magento/Framework/Test/Unit/Config/FileResolverByModuleTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/Config/FileResolverByModuleTest.php @@ -81,7 +81,7 @@ public function testGet() $iterator = $this->getMockBuilder(FileIterator::class) ->disableOriginalConstructor() ->getMock(); - $iterator->expects(self::once()) + $iterator->expects($this->once()) ->method('toArray') ->willReturn([ 'some_path' => 'Some Content' @@ -89,7 +89,7 @@ public function testGet() $primaryIterator = $this->getMockBuilder(FileIterator::class) ->disableOriginalConstructor() ->getMock(); - $primaryIterator->expects(self::once()) + $primaryIterator->expects($this->once()) ->method('toArray') ->willReturn([ '/www/app/etc/db_schema.xml' => 'Primary Content' @@ -97,28 +97,28 @@ public function testGet() $directoryMock = $this->getMockBuilder(\Magento\Framework\Filesystem\Directory\ReadInterface::class) ->disableOriginalConstructor() ->getMock(); - $directoryMock->expects(self::once()) + $directoryMock->expects($this->once()) ->method('search') ->with('{db_schema.xml,*/db_schema.xml}') ->willReturn(['app/etc/db_schema.xml']); - $directoryMock->expects(self::once()) + $directoryMock->expects($this->once()) ->method('getAbsolutePath') ->willReturn('/www/app/etc/db_schema.xml'); - $this->readerMock->expects(self::once()) + $this->readerMock->expects($this->once()) ->method('getConfigurationFiles') ->willReturn($iterator); - $this->fileIteratorFactoryMock->expects(self::once()) + $this->fileIteratorFactoryMock->expects($this->once()) ->method('create') ->with(['/www/app/etc/db_schema.xml']) ->willReturn($primaryIterator); - $this->fileDriver->expects(self::once()) + $this->fileDriver->expects($this->once()) ->method('isFile') ->with('/www/app/etc/db_schema.xml') ->willReturn(true); - $this->filesystemMock->expects(self::once()) + $this->filesystemMock->expects($this->once()) ->method('getDirectoryRead') ->willReturn($directoryMock); - self::assertEquals( + $this->assertEquals( $this->model->get('db_schema.xml', 'all'), [ 'some_path' => 'Some Content', @@ -135,7 +135,7 @@ public function testGetWithException() $iterator = $this->getMockBuilder(FileIterator::class) ->disableOriginalConstructor() ->getMock(); - $iterator->expects(self::once()) + $iterator->expects($this->once()) ->method('toArray') ->willReturn([ 'some_path' => 'Some Content' @@ -143,7 +143,7 @@ public function testGetWithException() $primaryIterator = $this->getMockBuilder(FileIterator::class) ->disableOriginalConstructor() ->getMock(); - $primaryIterator->expects(self::once()) + $primaryIterator->expects($this->once()) ->method('toArray') ->willReturn([ '/www/app/etc/db_schema.xml' => 'Primary Content' @@ -151,25 +151,25 @@ public function testGetWithException() $directoryMock = $this->getMockBuilder(\Magento\Framework\Filesystem\Directory\ReadInterface::class) ->disableOriginalConstructor() ->getMock(); - $directoryMock->expects(self::once()) + $directoryMock->expects($this->once()) ->method('search') ->with('{db_schema.xml,*/db_schema.xml}') ->willReturn(['app/etc/db_schema.xml']); - $directoryMock->expects(self::once()) + $directoryMock->expects($this->once()) ->method('getAbsolutePath') ->willReturn('/www/app/etc/db_schema.xml'); - $this->readerMock->expects(self::once()) + $this->readerMock->expects($this->once()) ->method('getConfigurationFiles') ->willReturn($iterator); - $this->fileIteratorFactoryMock->expects(self::once()) + $this->fileIteratorFactoryMock->expects($this->once()) ->method('create') ->with(['/www/app/etc/db_schema.xml']) ->willReturn($primaryIterator); - $this->fileDriver->expects(self::once()) + $this->fileDriver->expects($this->once()) ->method('isFile') ->with('/www/app/etc/db_schema.xml') ->willReturn(true); - $this->filesystemMock->expects(self::once()) + $this->filesystemMock->expects($this->once()) ->method('getDirectoryRead') ->willReturn($directoryMock); $this->model->get('db_schema.xml', 'all'); @@ -180,7 +180,7 @@ public function testGetOneModule() $iterator = $this->getMockBuilder(FileIterator::class) ->disableOriginalConstructor() ->getMock(); - $iterator->expects(self::once()) + $iterator->expects($this->once()) ->method('toArray') ->willReturn([ 'some_path/etc/db_schema.xml' => 'Some Content' @@ -188,7 +188,7 @@ public function testGetOneModule() $primaryIterator = $this->getMockBuilder(FileIterator::class) ->disableOriginalConstructor() ->getMock(); - $primaryIterator->expects(self::once()) + $primaryIterator->expects($this->once()) ->method('toArray') ->willReturn([ '/www/app/etc/db_schema.xml' => 'Primary Content' @@ -196,32 +196,32 @@ public function testGetOneModule() $directoryMock = $this->getMockBuilder(\Magento\Framework\Filesystem\Directory\ReadInterface::class) ->disableOriginalConstructor() ->getMock(); - $directoryMock->expects(self::once()) + $directoryMock->expects($this->once()) ->method('search') ->with('{db_schema.xml,*/db_schema.xml}') ->willReturn(['app/etc/db_schema.xml']); - $directoryMock->expects(self::once()) + $directoryMock->expects($this->once()) ->method('getAbsolutePath') ->willReturn('/www/app/etc/db_schema.xml'); - $this->readerMock->expects(self::once()) + $this->readerMock->expects($this->once()) ->method('getConfigurationFiles') ->willReturn($iterator); - $this->fileIteratorFactoryMock->expects(self::once()) + $this->fileIteratorFactoryMock->expects($this->once()) ->method('create') ->with(['/www/app/etc/db_schema.xml']) ->willReturn($primaryIterator); - $this->fileDriver->expects(self::once()) + $this->fileDriver->expects($this->once()) ->method('isFile') ->with('/www/app/etc/db_schema.xml') ->willReturn(true); - $this->filesystemMock->expects(self::once()) + $this->filesystemMock->expects($this->once()) ->method('getDirectoryRead') ->willReturn($directoryMock); - $this->componentRegistrarMock->expects(self::once()) + $this->componentRegistrarMock->expects($this->once()) ->method('getPath') ->with('module', 'Magento_Some') ->willReturn('some_path'); - self::assertEquals( + $this->assertEquals( [ 'some_path/etc/db_schema.xml' => 'Some Content', '/www/app/etc/db_schema.xml' => 'Primary Content' diff --git a/lib/internal/Magento/Framework/Test/Unit/Interception/InterceptorTest.php b/lib/internal/Magento/Framework/Test/Unit/Interception/InterceptorTest.php index a97c7955c17de..ac9392008ce23 100644 --- a/lib/internal/Magento/Framework/Test/Unit/Interception/InterceptorTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/Interception/InterceptorTest.php @@ -92,10 +92,10 @@ public function testCallPlugins() Sample\Plugin3::class . '::after' . $capMethod ]; - $this->pluginListMock->expects(static::any()) + $this->pluginListMock->expects($this->any()) ->method('getPlugin') ->willReturnMap($pluginMap); - $this->pluginListMock->expects(static::exactly(3)) + $this->pluginListMock->expects($this->exactly(3)) ->method('getNext') ->willReturnMap($pluginInfoMap); diff --git a/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php b/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php index 5027bfae606a6..1620697f09f18 100644 --- a/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/Module/Plugin/DbStatusValidatorTest.php @@ -70,13 +70,13 @@ protected function setUp() public function testBeforeDispatchUpToDate() { - $this->cacheMock->expects(static::any()) + $this->cacheMock->expects($this->any()) ->method('load') ->with('db_is_up_to_date') ->willReturn('cache_data'); - $this->dbVersionInfoMock->expects(static::never()) + $this->dbVersionInfoMock->expects($this->never()) ->method('getDbVersionErrors'); - $this->cacheMock->expects(static::never()) + $this->cacheMock->expects($this->never()) ->method('save'); $this->plugin->beforeDispatch($this->frontControllerMock, $this->requestMock); @@ -84,14 +84,14 @@ public function testBeforeDispatchUpToDate() public function testBeforeDispatchOutOfDateNoErrors() { - $this->cacheMock->expects(static::any()) + $this->cacheMock->expects($this->any()) ->method('load') ->with('db_is_up_to_date') ->willReturn(false); - $this->dbVersionInfoMock->expects(static::once()) + $this->dbVersionInfoMock->expects($this->once()) ->method('getDbVersionErrors') ->willReturn([]); - $this->cacheMock->expects(static::once()) + $this->cacheMock->expects($this->once()) ->method('save') ->with('true', 'db_is_up_to_date', [], null) ->willReturn(true); @@ -104,14 +104,14 @@ public function testBeforeDispatchOutOfDateNoErrors() */ public function testBeforeDispatchOutOfDateWithErrors(array $errors, string $expectedMessage) { - $this->cacheMock->expects(static::any()) + $this->cacheMock->expects($this->any()) ->method('load') ->with('db_is_up_to_date') ->willReturn(false); - $this->dbVersionInfoMock->expects(static::once()) + $this->dbVersionInfoMock->expects($this->once()) ->method('getDbVersionErrors') ->willReturn($errors); - $this->cacheMock->expects(static::never()) + $this->cacheMock->expects($this->never()) ->method('save'); $this->expectException(LocalizedException::class); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/LockerProcessTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/LockerProcessTest.php index aba3ff1099cc0..471123b7efbd2 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/LockerProcessTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/LockerProcessTest.php @@ -73,8 +73,8 @@ protected function setUp() */ public function testLockProcess($method) { - $this->stateMock->expects(self::once())->method('getMode')->willReturn(State::MODE_DEVELOPER); - $this->filesystemMock->expects(self::once()) + $this->stateMock->expects($this->once())->method('getMode')->willReturn(State::MODE_DEVELOPER); + $this->filesystemMock->expects($this->once()) ->method('getDirectoryWrite') ->with(DirectoryList::VAR_DIR) ->willReturn($this->$method()); @@ -84,7 +84,7 @@ public function testLockProcess($method) public function testNotLockProcessInProductionMode() { - $this->stateMock->expects(self::once())->method('getMode')->willReturn(State::MODE_PRODUCTION); + $this->stateMock->expects($this->once())->method('getMode')->willReturn(State::MODE_PRODUCTION); $this->filesystemMock->expects($this->never())->method('getDirectoryWrite'); $this->lockerProcess->lockProcess(self::LOCK_NAME); @@ -95,8 +95,8 @@ public function testNotLockProcessInProductionMode() */ public function testUnlockProcess() { - $this->stateMock->expects(self::exactly(2))->method('getMode')->willReturn(State::MODE_DEVELOPER); - $this->filesystemMock->expects(self::once()) + $this->stateMock->expects($this->exactly(2))->method('getMode')->willReturn(State::MODE_DEVELOPER); + $this->filesystemMock->expects($this->once()) ->method('getDirectoryWrite') ->with(DirectoryList::VAR_DIR) ->willReturn($this->getTmpDirectoryMockFalse(1)); @@ -107,8 +107,8 @@ public function testUnlockProcess() public function testNotUnlockProcessInProductionMode() { - $this->stateMock->expects(self::exactly(2))->method('getMode')->willReturn(State::MODE_PRODUCTION); - $this->filesystemMock->expects(self::never())->method('getDirectoryWrite'); + $this->stateMock->expects($this->exactly(2))->method('getMode')->willReturn(State::MODE_PRODUCTION); + $this->filesystemMock->expects($this->never())->method('getDirectoryWrite'); $this->lockerProcess->lockProcess(self::LOCK_NAME); $this->lockerProcess->unlockProcess(); @@ -132,19 +132,19 @@ protected function getTmpDirectoryMockTrue() { $tmpDirectoryMock = $this->getTmpDirectoryMock(); - $tmpDirectoryMock->expects(self::atLeastOnce()) + $tmpDirectoryMock->expects($this->atLeastOnce()) ->method('isExist') ->with($this->fileName) ->willReturn(true); - $tmpDirectoryMock->expects(self::atLeastOnce()) + $tmpDirectoryMock->expects($this->atLeastOnce()) ->method('readFile') ->with($this->fileName) ->willReturn(time() - 25); - $tmpDirectoryMock->expects(self::once()) + $tmpDirectoryMock->expects($this->once()) ->method('writeFile') - ->with($this->fileName, self::matchesRegularExpression('#\d+#')); + ->with($this->fileName, $this->matchesRegularExpression('#\d+#')); return $tmpDirectoryMock; } @@ -157,21 +157,21 @@ protected function getTmpDirectoryMockFalse($exactly = 0) { $tmpDirectoryMock = $this->getTmpDirectoryMock(); - $tmpDirectoryMock->expects(self::atLeastOnce()) + $tmpDirectoryMock->expects($this->atLeastOnce()) ->method('isExist') ->with($this->fileName) ->willReturn(false); - $tmpDirectoryMock->expects(self::never()) + $tmpDirectoryMock->expects($this->never()) ->method('readFile'); - $tmpDirectoryMock->expects(self::exactly($exactly)) + $tmpDirectoryMock->expects($this->exactly($exactly)) ->method('delete') ->with($this->fileName); - $tmpDirectoryMock->expects(self::once()) + $tmpDirectoryMock->expects($this->once()) ->method('writeFile') - ->with($this->fileName, self::matchesRegularExpression('#\d+#')); + ->with($this->fileName, $this->matchesRegularExpression('#\d+#')); return $tmpDirectoryMock; } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/AlternativeSourceTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/AlternativeSourceTest.php index 4f44e9b165c20..f7e7b94513d9b 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/AlternativeSourceTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/AlternativeSourceTest.php @@ -100,47 +100,47 @@ public function testProcessException() ] ]; - $this->lockerProcessMock->expects(self::once()) + $this->lockerProcessMock->expects($this->once()) ->method('lockProcess') - ->with(self::isType('string')); - $this->lockerProcessMock->expects(self::once()) + ->with($this->isType('string')); + $this->lockerProcessMock->expects($this->once()) ->method('unlockProcess'); - $this->sorterMock->expects(self::once()) + $this->sorterMock->expects($this->once()) ->method('sort') ->with($alternatives) ->willReturn($alternatives); - $this->filenameResolverMock->expects(self::once()) + $this->filenameResolverMock->expects($this->once()) ->method('resolve') ->with(self::FILE_PATH) ->willReturn(self::FILE_PATH); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setArea') ->with(self::AREA) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setTheme') ->with(self::THEME) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setLocale') ->with(self::LOCALE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setModule') ->with(self::MODULE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setPath') ->with(self::FILE_PATH) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('build') ->willReturn($this->getAssetNew()); - $this->objectManagerMock->expects(self::once()) + $this->objectManagerMock->expects($this->once()) ->method('get') ->with('stdClass') ->willReturn(new \stdClass()); @@ -157,7 +157,7 @@ public function testProcessException() try { $alternativeSource->process($this->getChainMockExpects('', 0)); } catch (\UnexpectedValueException $e) { - self::assertInstanceOf('\UnexpectedValueException', $e); + $this->assertInstanceOf('\UnexpectedValueException', $e); } } @@ -172,49 +172,49 @@ public function testProcess() ] ]; - $this->lockerProcessMock->expects(self::once()) + $this->lockerProcessMock->expects($this->once()) ->method('lockProcess') - ->with(self::isType('string')); - $this->lockerProcessMock->expects(self::once()) + ->with($this->isType('string')); + $this->lockerProcessMock->expects($this->once()) ->method('unlockProcess'); - $this->sorterMock->expects(self::once()) + $this->sorterMock->expects($this->once()) ->method('sort') ->with($alternatives) ->willReturn($alternatives); - $this->filenameResolverMock->expects(self::once()) + $this->filenameResolverMock->expects($this->once()) ->method('resolve') ->with(self::FILE_PATH) ->willReturn(self::FILE_PATH); $assetMock = $this->getAssetNew(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setArea') ->with(self::AREA) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setTheme') ->with(self::THEME) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setLocale') ->with(self::LOCALE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setModule') ->with(self::MODULE) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('setPath') ->with(self::FILE_PATH) ->willReturnSelf(); - $this->assetBuilderMock->expects(self::once()) + $this->assetBuilderMock->expects($this->once()) ->method('build') ->willReturn($assetMock); - $this->objectManagerMock->expects(self::once()) + $this->objectManagerMock->expects($this->once()) ->method('get') ->with(\Magento\Framework\View\Asset\ContentProcessorInterface::class) ->willReturn($this->getProcessorMock($assetMock)); @@ -240,20 +240,20 @@ public function testProcessContentNotEmpty() $chainMock = $this->getChainMock(); $assetMock = $this->getAssetMock(); - $chainMock->expects(self::once()) + $chainMock->expects($this->once()) ->method('getContent') ->willReturn('test-content'); - $chainMock->expects(self::once()) + $chainMock->expects($this->once()) ->method('getAsset') ->willReturn($assetMock); - $this->filenameResolverMock->expects(self::never()) + $this->filenameResolverMock->expects($this->never()) ->method('resolve'); - $this->lockerProcessMock->expects(self::never()) + $this->lockerProcessMock->expects($this->never()) ->method('lockProcess'); - $this->lockerProcessMock->expects(self::never()) + $this->lockerProcessMock->expects($this->never()) ->method('unlockProcess'); $alternativeSource = new AlternativeSource( @@ -278,7 +278,7 @@ private function getProcessorMock($asset) $processorMock = $this->getMockBuilder(ContentProcessorInterface::class) ->getMockForAbstractClass(); - $processorMock->expects(self::once()) + $processorMock->expects($this->once()) ->method('processContent') ->with($asset) ->willReturn(self::NEW_CONTENT); @@ -307,13 +307,13 @@ private function getChainMockExpects($content = '', $contentExactly = 1) { $chainMock = $this->getChainMock(); - $chainMock->expects(self::once()) + $chainMock->expects($this->once()) ->method('getContent') ->willReturn($content); - $chainMock->expects(self::exactly(3)) + $chainMock->expects($this->exactly(3)) ->method('getAsset') ->willReturn($this->getAssetMockExpects()); - $chainMock->expects(self::exactly($contentExactly)) + $chainMock->expects($this->exactly($contentExactly)) ->method('setContent') ->willReturn(self::NEW_CONTENT); @@ -351,13 +351,13 @@ private function getAssetMockExpects() { $assetMock = $this->getAssetMock(); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getContext') ->willReturn($this->getContextMock()); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getFilePath') ->willReturn(self::FILE_PATH); - $assetMock->expects(self::once()) + $assetMock->expects($this->once()) ->method('getModule') ->willReturn(self::MODULE); @@ -373,13 +373,13 @@ private function getContextMock() ->disableOriginalConstructor() ->getMock(); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getAreaCode') ->willReturn(self::AREA); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getThemePath') ->willReturn(self::THEME); - $contextMock->expects(self::once()) + $contextMock->expects($this->once()) ->method('getLocale') ->willReturn(self::LOCALE); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Helper/SortTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Helper/SortTest.php index 074355cc9e03b..1a728755b96cb 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Helper/SortTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/Helper/SortTest.php @@ -26,7 +26,7 @@ public function testSorting(array $arrayData, array $expected, $message) $result = $sorter->sort($arrayData); - static::assertEquals($expected, array_keys($result), $message); + $this->assertEquals($expected, array_keys($result), $message); } /** diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php index bcd1d03a629ce..05bbf5493aade 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php @@ -30,14 +30,14 @@ public function testResolve($isMin, $input, $expected) ->disableOriginalConstructor() ->getMock(); - $minificationMock->expects(self::once()) + $minificationMock->expects($this->once()) ->method('isEnabled') ->with('ext') ->willReturn($isMin); $resolver = new MinificationFilenameResolver($minificationMock); - self::assertEquals($expected, $resolver->resolve($input)); + $this->assertEquals($expected, $resolver->resolve($input)); } /** diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php index 5e035d4a62ab8..c8295a5ae6f18 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/PoolTest.php @@ -59,7 +59,7 @@ private function getChainMock($type) ->disableOriginalConstructor() ->getMock(); - $chainMock->expects(self::once()) + $chainMock->expects($this->once()) ->method('getTargetContentType') ->willReturn($type); @@ -76,7 +76,7 @@ private function getPreprocessorMock($chainMock) $preprocessorMock = $this->getMockBuilder(self::PREPROCESSOR_CLASS) ->getMockForAbstractClass(); - $preprocessorMock->expects(self::once()) + $preprocessorMock->expects($this->once()) ->method('process') ->with($chainMock); @@ -103,14 +103,14 @@ public function testProcess() $preprocessors ); - $this->sorterMock->expects(self::once()) + $this->sorterMock->expects($this->once()) ->method('sort') ->with($preprocessors[self::CONTENT_TYPE]) ->willReturn($preprocessors[self::CONTENT_TYPE]); $chainMock = $this->getChainMock(self::CONTENT_TYPE); - $this->objectManagerMock->expects(self::once()) + $this->objectManagerMock->expects($this->once()) ->method('get') ->with(self::PREPROCESSOR_CLASS) ->willReturn($this->getPreprocessorMock($chainMock)); @@ -134,12 +134,12 @@ public function testProcessDefault() $preprocessors ); - $this->sorterMock->expects(self::never()) + $this->sorterMock->expects($this->never()) ->method('sort'); $chainMock = $this->getChainMock(self::CONTENT_TYPE); - $this->objectManagerMock->expects(self::once()) + $this->objectManagerMock->expects($this->once()) ->method('get') ->with(self::DEFAULT_PREPROCESSOR) ->willReturn($this->getPreprocessorMock($chainMock)); @@ -170,14 +170,14 @@ public function testProcessBadInterface() $preprocessors ); - $this->sorterMock->expects(self::once()) + $this->sorterMock->expects($this->once()) ->method('sort') ->with($preprocessors[self::CONTENT_TYPE]) ->willReturn($preprocessors[self::CONTENT_TYPE]); $chainMock = $this->getChainMock(self::CONTENT_TYPE); - $this->objectManagerMock->expects(self::once()) + $this->objectManagerMock->expects($this->once()) ->method('get') ->with('stdClass') ->willReturn(new \stdClass()); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php index fefbdf0ed5111..421c567b98e2e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Js/CookieTest.php @@ -110,7 +110,7 @@ public function testGetPath() public function testGetLifetime() { $lifetime = 3600; - $this->sessionConfigMock->expects(static::once()) + $this->sessionConfigMock->expects($this->once()) ->method('getCookieLifetime') ->willReturn($lifetime); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php index 7561a447ad16b..31ea1179320b0 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationMediatorTest.php @@ -45,14 +45,14 @@ protected function setUp() public function testInterpretNotIdentifiedMessage() { $messageText = 'Very awful message. Shame.'; - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getIdentifier') ->willReturn(null); - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getText') ->willReturn($messageText); - static::assertSame( + $this->assertSame( $messageText, $this->interpretationMediator->interpret($this->messageMock) ); @@ -62,15 +62,15 @@ public function testInterpretIdentifiedMessage() { $messageInterpreted = 'Awesome message. An identified message is the one we appreciate.'; - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getIdentifier') ->willReturn('Great identifier'); - $this->interpretationStrategy->expects(static::once()) + $this->interpretationStrategy->expects($this->once()) ->method('interpret') ->with($this->messageMock) ->willReturn($messageInterpreted); - static::assertSame( + $this->assertSame( $messageInterpreted, $this->interpretationMediator->interpret($this->messageMock) ); @@ -80,18 +80,18 @@ public function testInterpretIdentifiedMessageNotConfigured() { $messageStillNotInterpreted = 'One step left to call it an awesome message.'; - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getIdentifier') ->willReturn('Great identifier'); - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getText') ->willReturn($messageStillNotInterpreted); - $this->interpretationStrategy->expects(static::once()) + $this->interpretationStrategy->expects($this->once()) ->method('interpret') ->with($this->messageMock) ->willThrowException(new \LogicException()); - static::assertSame( + $this->assertSame( $messageStillNotInterpreted, $this->interpretationMediator->interpret($this->messageMock) ); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php index cc91099b78b86..ae9ab9be9aa6a 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/InterpretationStrategyTest.php @@ -78,25 +78,25 @@ public function testInterpret() \Magento\Framework\View\Element\Message\Renderer\RendererInterface::class ); - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getIdentifier') ->willReturn($identifier); - $this->messageConfigurationsPool->expects(static::once()) + $this->messageConfigurationsPool->expects($this->once()) ->method('getMessageConfiguration') ->with($identifier) ->willReturn( $messageConfiguration ); - $this->renderersPool->expects(static::once()) + $this->renderersPool->expects($this->once()) ->method('get') ->with($messageConfiguration['renderer']) ->willReturn($renderer); - $renderer->expects(static::once()) + $renderer->expects($this->once()) ->method('render') ->with($this->messageMock, $messageConfiguration['data']) ->willReturn($renderedMessage); - static::assertSame( + $this->assertSame( $renderedMessage, $this->interpretationStrategy->interpret($this->messageMock) ); @@ -106,10 +106,10 @@ public function testInterpretNoConfigurationException() { $identifier = 'Prophesy'; - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getIdentifier') ->willReturn($identifier); - $this->messageConfigurationsPool->expects(static::once()) + $this->messageConfigurationsPool->expects($this->once()) ->method('getMessageConfiguration') ->with($identifier) ->willReturn( @@ -118,7 +118,7 @@ public function testInterpretNoConfigurationException() $this->expectException('LogicException'); - $this->renderersPool->expects(static::never()) + $this->renderersPool->expects($this->never()) ->method('get'); $this->interpretationStrategy->interpret($this->messageMock); @@ -134,16 +134,16 @@ public function testInterpretNoInterpreterException() ] ]; - $this->messageMock->expects(static::once()) + $this->messageMock->expects($this->once()) ->method('getIdentifier') ->willReturn($identifier); - $this->messageConfigurationsPool->expects(static::once()) + $this->messageConfigurationsPool->expects($this->once()) ->method('getMessageConfiguration') ->with($identifier) ->willReturn( $messageConfiguration ); - $this->renderersPool->expects(static::once()) + $this->renderersPool->expects($this->once()) ->method('get') ->with($messageConfiguration['renderer']) ->willReturn(null); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php index 1330f0563fc71..a535a2cfc608f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/MessageConfigurationsPoolTest.php @@ -25,7 +25,7 @@ public function testGetMessageConfiguration() $pool = new MessageConfigurationsPool($messageConfigurations); foreach ($expectedMessageConfigurations as $messageIdentifier => $expectedConfiguration) { - static::assertSame( + $this->assertSame( $expectedConfiguration, $pool->getMessageConfiguration($messageIdentifier) ); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRenderer/TemplateTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRenderer/TemplateTest.php index 17e5e1ce10d5d..68ed3d7bc9e1f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRenderer/TemplateTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRenderer/TemplateTest.php @@ -15,7 +15,7 @@ public function testGetCacheKeyInfo() $helper = new ObjectManager($this); $storeMock = $this->createMock(\Magento\Store\Api\Data\StoreInterface::class); $storeManager = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class); - $storeManager->expects(static::once()) + $storeManager->expects($this->once()) ->method('getStore') ->willReturn($storeMock); @@ -35,7 +35,7 @@ public function testGetCacheKeyInfo() 'GB' ]; - $storeMock->expects(static::once()) + $storeMock->expects($this->once()) ->method('getCode') ->willReturn('GB'); $template->setTemplate('MontyPythonAndTheHolyGrail.phtml'); @@ -46,6 +46,6 @@ public function testGetCacheKeyInfo() ] ); - static::assertSame($expectedData, $template->getCacheKeyInfo()); + $this->assertSame($expectedData, $template->getCacheKeyInfo()); } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php index 8d4e852cf658a..3163934e7c603 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/BlockRendererTest.php @@ -44,17 +44,17 @@ public function testRender() $initializationData = ['template' => 'canvas.phtml']; $messagePresentation = 'The Last Supper, Michelangelo.'; - $message->expects(static::once()) + $message->expects($this->once()) ->method('getData') ->willReturn($messageData); $this->blockTemplate->expects(new MethodInvokedAtIndex(0)) ->method('setTemplate') ->with($initializationData['template']); - $this->blockTemplate->expects(static::once()) + $this->blockTemplate->expects($this->once()) ->method('setData') ->with($messageData); - $this->blockTemplate->expects(static::once()) + $this->blockTemplate->expects($this->once()) ->method('toHtml') ->willReturn($messagePresentation); @@ -83,14 +83,14 @@ public function testRenderNoTemplate() 'is' => 'a Very Naughty Boy' ]; - $message->expects(static::once()) + $message->expects($this->once()) ->method('getData') ->willReturn($messageData); $this->expectException('InvalidArgumentException'); $this->expectExceptionMessage('Template should be provided for the renderer.'); - $this->blockTemplate->expects(static::never()) + $this->blockTemplate->expects($this->never()) ->method('toHtml'); $this->renderer->render($message, []); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/EscapeRendererTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/EscapeRendererTest.php index 5031801a543eb..a93a16c8739b9 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/EscapeRendererTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/EscapeRendererTest.php @@ -25,15 +25,15 @@ public function testInterpret() /** @var MessageInterface | \PHPUnit_Framework_MockObject_MockObject $message */ $message = $this->createMock(\Magento\Framework\Message\MessageInterface::class); - $message->expects(static::once()) + $message->expects($this->once()) ->method('getText') ->willReturn($messageText); - $escaper->expects(static::once()) + $escaper->expects($this->once()) ->method('escapeHtml') ->with($messageText) ->willReturn($escapedMessageText); $renderer = new EscapeRenderer($escaper); - static::assertSame($escapedMessageText, $renderer->render($message, [])); + $this->assertSame($escapedMessageText, $renderer->render($message, [])); } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/RenderersPoolTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/RenderersPoolTest.php index 7a3b69f510072..d806602a2ca8e 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/RenderersPoolTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Message/Renderer/RenderersPoolTest.php @@ -33,7 +33,7 @@ public function testGetRenderer() $pool = new RenderersPool($renderers); foreach ($expectationMap as $code => $renderer) { - static::assertSame($renderer, $pool->get($code)); + $this->assertSame($renderer, $pool->get($code)); } } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php index 57fefe4660cb2..ed8dfce29441a 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php @@ -294,7 +294,7 @@ public function testGetGroupedHtml() $successMock = $this->getMockBuilder(\Magento\Framework\Message\MessageInterface::class) ->getMockForAbstractClass(); - $this->messageInterpretationStrategy->expects(static::any()) + $this->messageInterpretationStrategy->expects($this->any()) ->method('interpret') ->willReturnMap( [ diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php index b769012ea81df..16ed1d717d5df 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/DbStatusCommandTest.php @@ -67,7 +67,7 @@ protected function setUp() $objectManagerProvider->expects($this->any()) ->method('get') ->will($this->returnValue($objectManager)); - $objectManager->expects(self::exactly(4)) + $objectManager->expects($this->exactly(4)) ->method('get') ->willReturnOnConsecutiveCalls( $this->validators['declarative_schema'], @@ -80,16 +80,16 @@ protected function setUp() public function testExecute() { - $this->validators['old_validator']->expects(self::once()) + $this->validators['old_validator']->expects($this->once()) ->method('isUpToDate') ->willReturn(true); - $this->validators['up_to_date_schema']->expects(self::once()) + $this->validators['up_to_date_schema']->expects($this->once()) ->method('isUpToDate') ->willReturn(true); - $this->validators['up_to_date_data']->expects(self::once()) + $this->validators['up_to_date_data']->expects($this->once()) ->method('isUpToDate') ->willReturn(true); - $this->validators['declarative_schema']->expects(self::once()) + $this->validators['declarative_schema']->expects($this->once()) ->method('isUpToDate') ->willReturn(true); $this->deploymentConfig->expects($this->once()) diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleUninstallCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleUninstallCommandTest.php index c00d66eaed134..9cd7e979e7d8e 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleUninstallCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/ModuleUninstallCommandTest.php @@ -449,14 +449,14 @@ public function testExecuteRemoveData() public function testExecuteNonComposerModules() { - $this->deploymentConfig->expects(self::once()) + $this->deploymentConfig->expects($this->once()) ->method('isAvailable') ->willReturn(true); $input = ['module' => ['Magento_A'], '-c' => true, '-r' => true, '--non-composer' => true]; - $this->patchApplierMock->expects(self::once()) + $this->patchApplierMock->expects($this->once()) ->method('revertDataPatches') ->with('Magento_A'); - self::assertEquals(0, $this->tester->execute($input)); + $this->assertEquals(0, $this->tester->execute($input)); } public function testExecuteAll() diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/InstallExtensionGridTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/InstallExtensionGridTest.php index 9eba4413d0cda..8f30310fbc53f 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/InstallExtensionGridTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/InstallExtensionGridTest.php @@ -41,7 +41,7 @@ public function setUp() public function testIndexAction() { $viewModel = $this->controller->indexAction(); - static::assertInstanceOf(\Zend\View\Model\ViewModel::class, $viewModel); + $this->assertInstanceOf(\Zend\View\Model\ViewModel::class, $viewModel); } /** @@ -51,17 +51,17 @@ public function testIndexAction() */ public function testExtensionsAction($extensions) { - $this->packagesData->expects(static::once()) + $this->packagesData->expects($this->once()) ->method('getPackagesForInstall') ->willReturn($extensions); $jsonModel = $this->controller->extensionsAction(); - static::assertInstanceOf(\Zend\View\Model\JsonModel::class, $jsonModel); + $this->assertInstanceOf(\Zend\View\Model\JsonModel::class, $jsonModel); $variables = $jsonModel->getVariables(); - static::assertArrayHasKey('success', $variables); - static::assertArrayHasKey('extensions', $variables); - static::assertArrayHasKey('total', $variables); - static::assertTrue($variables['success']); + $this->assertArrayHasKey('success', $variables); + $this->assertArrayHasKey('extensions', $variables); + $this->assertArrayHasKey('total', $variables); + $this->assertTrue($variables['success']); } /** diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/ModuleGridTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/ModuleGridTest.php index 2c25aac37d578..4b4b137387972 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/ModuleGridTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/ModuleGridTest.php @@ -67,7 +67,7 @@ public function testModulesAction() ] ]; - $this->gridModuleMock->expects(static::once()) + $this->gridModuleMock->expects($this->once()) ->method('getList') ->willReturn($moduleList); diff --git a/setup/src/Magento/Setup/Test/Unit/Model/AdminAccountTest.php b/setup/src/Magento/Setup/Test/Unit/Model/AdminAccountTest.php index cf8a578fdb579..759a4be007442 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/AdminAccountTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/AdminAccountTest.php @@ -182,22 +182,22 @@ public function testSaveUserExistsNewAdminRole() ]; $this->dbAdapter - ->expects(self::exactly(4)) + ->expects($this->exactly(4)) ->method('fetchRow') ->willReturnMap($returnValueMap); $this->dbAdapter->method('quoteInto') ->willReturn(''); $this->dbAdapter->method('update') - ->with(self::equalTo('pre_admin_user'), self::anything()) + ->with($this->equalTo('pre_admin_user'), $this->anything()) ->willReturn(1); - $this->dbAdapter->expects(self::at(8)) + $this->dbAdapter->expects($this->at(8)) ->method('insert') - ->with(self::equalTo('pre_admin_passwords'), self::anything()); + ->with($this->equalTo('pre_admin_passwords'), $this->anything()); // should only insert once (admin role) - $this->dbAdapter->expects(self::at(14)) + $this->dbAdapter->expects($this->at(14)) ->method('insert') - ->with(self::equalTo('pre_authorization_role'), self::anything()); + ->with($this->equalTo('pre_authorization_role'), $this->anything()); $this->adminAccount->save(); } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Grid/ModuleTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Grid/ModuleTest.php index 2fdab1d74325c..a170cfb40128a 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/Grid/ModuleTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/Grid/ModuleTest.php @@ -98,14 +98,14 @@ public function setUp() $this->moduleListMock = $this->getMockBuilder(ModuleList::class) ->disableOriginalConstructor() ->getMock(); - $this->moduleListMock->expects(static::any()) + $this->moduleListMock->expects($this->any()) ->method('has') ->willReturn(true); $this->fullModuleListMock = $this->getMockBuilder(FullModuleList::class) ->disableOriginalConstructor() ->getMock(); - $this->fullModuleListMock->expects(static::any()) + $this->fullModuleListMock->expects($this->any()) ->method('getNames') ->willReturn($fullModuleList); @@ -132,35 +132,35 @@ public function testGetList() $this->objectManagerProvider->expects($this->once()) ->method('get') ->willReturn($objectManager); - $objectManager->expects(static::once()) + $objectManager->expects($this->once()) ->method('get') ->willReturnMap([ [PackageInfoFactory::class, $this->packageInfoFactoryMock], ]); - $this->packageInfoFactoryMock->expects(static::once()) + $this->packageInfoFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->packageInfoMock); - $this->packageInfoMock->expects(static::never()) + $this->packageInfoMock->expects($this->never()) ->method('getModuleName'); - $this->packageInfoMock->expects(static::once()) + $this->packageInfoMock->expects($this->once()) ->method('getRequiredBy') ->willReturn([]); - $this->packageInfoMock->expects(static::exactly(2)) + $this->packageInfoMock->expects($this->exactly(2)) ->method('getPackageName') ->willReturnMap([ ['Sample_ModuleOne', 'magento/sample-module-one'], ['Sample_ModuleTwo', ''], ]); - $this->packageInfoMock->expects(static::exactly(2)) + $this->packageInfoMock->expects($this->exactly(2)) ->method('getVersion') ->willReturnMap([ ['Sample_ModuleOne', '1.0.0'], ['Sample_ModuleTwo', ''], ]); - $this->packagesDataMock->expects(static::exactly(2)) + $this->packagesDataMock->expects($this->exactly(2)) ->method('addPackageExtraInfo') ->will( $this->returnCallback(function ($package) { @@ -170,10 +170,10 @@ public function testGetList() }) ); - $this->moduleListMock->expects(static::exactly(2)) + $this->moduleListMock->expects($this->exactly(2)) ->method('has') ->willReturn(true); - $this->composerInformationMock->expects(static::once()) + $this->composerInformationMock->expects($this->once()) ->method('getInstalledMagentoPackages') ->willReturn($this->moduleData); @@ -202,6 +202,6 @@ public function testGetList() ], ]; - static::assertEquals($expected, $this->model->getList()); + $this->assertEquals($expected, $this->model->getList()); } } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php b/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php index 11dca34763a05..e0ba9575739fb 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/Grid/TypeMapperTest.php @@ -33,7 +33,7 @@ public function setUp() */ public function testMap($packageType, $expected) { - static::assertEquals( + $this->assertEquals( $expected, $this->model->map($packageType) ); diff --git a/setup/src/Magento/Setup/Test/Unit/Model/PackagesDataTest.php b/setup/src/Magento/Setup/Test/Unit/Model/PackagesDataTest.php index 5757287e886e0..9da6a7ea096e7 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/PackagesDataTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/PackagesDataTest.php @@ -142,7 +142,7 @@ public function setUp() $this->typeMapper = $this->getMockBuilder(\Magento\Setup\Model\Grid\TypeMapper::class) ->disableOriginalConstructor() ->getMock(); - $this->typeMapper->expects(static::any()) + $this->typeMapper->expects($this->any()) ->method('map') ->willReturnMap([ [ComposerInformation::MODULE_PACKAGE_TYPE, \Magento\Setup\Model\Grid\TypeMapper::MODULE_PACKAGE_TYPE], @@ -291,7 +291,7 @@ public function testGetInstalledPackages() public function testGetMetaPackagesMap() { - static::assertEquals( + $this->assertEquals( ['magento/package-3' => 'magento/package-1'], $this->packagesData->getMetaPackagesMap() ); @@ -299,7 +299,7 @@ public function testGetMetaPackagesMap() public function testAddPackageExtraInfo() { - static::assertEquals( + $this->assertEquals( [ 'package_title' => 'Package 3 title', 'package_type' => 'Extension', diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php index 5bc7fd82b3251..a0a6dbd9812d6 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php @@ -22,7 +22,7 @@ public function testEmptyArrayForFileWithoutNamespaceOrClass() $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn( + $scanner->expects($this->once())->method('getFileContents')->willReturn( <<getClassNames(); - self::assertCount(0, $result); + $this->assertCount(0, $result); } public function testGetClassName() @@ -44,7 +44,7 @@ public function testGetClassName() $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn( + $scanner->expects($this->once())->method('getFileContents')->willReturn( <<getClassNames(); - self::assertCount(1, $result); - self::assertContains('ThisIsATest', $result); + $this->assertCount(1, $result); + $this->assertContains('ThisIsATest', $result); } public function testGetClassNameAndSingleNamespace() @@ -66,7 +66,7 @@ public function testGetClassNameAndSingleNamespace() $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn( + $scanner->expects($this->once())->method('getFileContents')->willReturn( <<getClassNames(); - self::assertCount(1, $result); - self::assertContains('NS\ThisIsMyTest', $result); + $this->assertCount(1, $result); + $this->assertContains('NS\ThisIsMyTest', $result); } public function testGetClassNameAndMultiNamespace() @@ -90,7 +90,7 @@ public function testGetClassNameAndMultiNamespace() $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn( + $scanner->expects($this->once())->method('getFileContents')->willReturn( <<getClassNames(); - self::assertCount(1, $result); - self::assertContains('This\Is\My\Ns\ThisIsMyTest', $result); + $this->assertCount(1, $result); + $this->assertContains('This\Is\My\Ns\ThisIsMyTest', $result); } public function testGetMultiClassNameAndMultiNamespace() @@ -123,7 +123,7 @@ public function testGetMultiClassNameAndMultiNamespace() $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn( + $scanner->expects($this->once())->method('getFileContents')->willReturn( <<getClassNames(); - self::assertCount(2, $result); - self::assertContains('This\Is\My\Ns\ThisIsMyTest', $result); - self::assertContains('This\Is\My\Ns\ThisIsForBreaking', $result); + $this->assertCount(2, $result); + $this->assertContains('This\Is\My\Ns\ThisIsMyTest', $result); + $this->assertContains('This\Is\My\Ns\ThisIsForBreaking', $result); } public function testBracketedNamespacesAndClasses() @@ -163,7 +163,7 @@ public function testBracketedNamespacesAndClasses() $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn( + $scanner->expects($this->once())->method('getFileContents')->willReturn( <<getClassNames(); - self::assertCount(3, $result); - self::assertContains('This\Is\My\Ns\ThisIsMyTest', $result); - self::assertContains('This\Is\My\Ns\ThisIsForBreaking', $result); - self::assertContains('This\Is\Not\My\Ns\ThisIsNotMyTest', $result); + $this->assertCount(3, $result); + $this->assertContains('This\Is\My\Ns\ThisIsMyTest', $result); + $this->assertContains('This\Is\My\Ns\ThisIsForBreaking', $result); + $this->assertContains('This\Is\Not\My\Ns\ThisIsNotMyTest', $result); } public function testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing() @@ -209,7 +209,7 @@ public function testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn(<<<'PHP' + $scanner->expects($this->once())->method('getFileContents')->willReturn(<<<'PHP' getClassNames(); - self::assertCount(1, $result); + $this->assertCount(1, $result); } public function testInvalidPHPCodeThrowsExceptionWhenCannotDetermineBraceOrSemiColon() @@ -247,7 +247,7 @@ public function testInvalidPHPCodeThrowsExceptionWhenCannotDetermineBraceOrSemiC $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ 'getFileContents' ])->getMock(); - $scanner->expects(self::once())->method('getFileContents')->willReturn( + $scanner->expects($this->once())->method('getFileContents')->willReturn( <<