From ce18bf1c5dd1cc4a4002d13a9a14c2eed7d06c23 Mon Sep 17 00:00:00 2001 From: Sergio Vera Date: Mon, 8 Feb 2021 12:52:06 +0100 Subject: [PATCH 1/2] MC-40555: Add PHP 7.4 declaration - Updated composer.json in modules --- AdobeIms/composer.json | 2 +- AdobeImsApi/composer.json | 2 +- AdobeStockAdminUi/composer.json | 2 +- AdobeStockAsset/composer.json | 2 +- AdobeStockAssetApi/composer.json | 2 +- AdobeStockClient/composer.json | 2 +- AdobeStockClientApi/composer.json | 2 +- AdobeStockImage/composer.json | 2 +- AdobeStockImageAdminUi/composer.json | 2 +- AdobeStockImageApi/composer.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/AdobeIms/composer.json b/AdobeIms/composer.json index bb1e1760e5da..7e2500489a92 100644 --- a/AdobeIms/composer.json +++ b/AdobeIms/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-ims", "description": "Magento module responsible for authentication to Adobe services", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-adobe-ims-api": "*", "magento/module-authorization": "*", diff --git a/AdobeImsApi/composer.json b/AdobeImsApi/composer.json index aa7f2d1f84fc..e1ada30a3d53 100644 --- a/AdobeImsApi/composer.json +++ b/AdobeImsApi/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-ims-api", "description": "Implementation of Magento module responsible for authentication to Adobe services", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*" }, "type": "magento2-module", diff --git a/AdobeStockAdminUi/composer.json b/AdobeStockAdminUi/composer.json index a28aea1f3f64..79327c139171 100644 --- a/AdobeStockAdminUi/composer.json +++ b/AdobeStockAdminUi/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-admin-ui", "description": "Magento module responsible for the admin panel UI implementation", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-adobe-ims-api": "*", "magento/module-adobe-stock-client-api": "*", diff --git a/AdobeStockAsset/composer.json b/AdobeStockAsset/composer.json index 6160bf884431..d01bb5322cdd 100644 --- a/AdobeStockAsset/composer.json +++ b/AdobeStockAsset/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-asset", "description": "Magento module responsible for the Adobe Stock assets handling implementation on Magento side", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-adobe-stock-asset-api": "*", "magento/module-adobe-stock-client-api": "*", diff --git a/AdobeStockAssetApi/composer.json b/AdobeStockAssetApi/composer.json index b9f3f9c1b78c..e91d67d29924 100644 --- a/AdobeStockAssetApi/composer.json +++ b/AdobeStockAssetApi/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-asset-api", "description": "Magento module responsible for Adobe Stock assets handling on Magento side", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*" }, "type": "magento2-module", diff --git a/AdobeStockClient/composer.json b/AdobeStockClient/composer.json index e5dc3700d279..9bfdeadef408 100644 --- a/AdobeStockClient/composer.json +++ b/AdobeStockClient/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-client", "description": "Magento module responsible for interaction with Adobe Stock API implementation", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-adobe-ims-api": "*", "magento/module-adobe-stock-client-api": "*", diff --git a/AdobeStockClientApi/composer.json b/AdobeStockClientApi/composer.json index 7fe690f999ee..53ec569cdf7a 100644 --- a/AdobeStockClientApi/composer.json +++ b/AdobeStockClientApi/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-client-api", "description": "Magento module responsible for interaction with Adobe Stock API", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*" }, "type": "magento2-module", diff --git a/AdobeStockImage/composer.json b/AdobeStockImage/composer.json index 91b2e41d81e6..29a1b1ce39ff 100644 --- a/AdobeStockImage/composer.json +++ b/AdobeStockImage/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-image", "description": "Magento module responsible for the images handling implementation", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-adobe-stock-client-api": "*", "magento/module-adobe-stock-asset-api": "*", diff --git a/AdobeStockImageAdminUi/composer.json b/AdobeStockImageAdminUi/composer.json index d5cc72a076d9..6876bf6006c5 100644 --- a/AdobeStockImageAdminUi/composer.json +++ b/AdobeStockImageAdminUi/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-image-admin-ui", "description": "Magento module responsible for the admin panel images UI implementation", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-adobe-ims": "*", "magento/module-adobe-ims-api": "*", diff --git a/AdobeStockImageApi/composer.json b/AdobeStockImageApi/composer.json index faf0f8d15bc1..e9c7f294a371 100644 --- a/AdobeStockImageApi/composer.json +++ b/AdobeStockImageApi/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-adobe-stock-image-api", "description": "Magento module responsible for the images handling", "require": { - "php": "~7.1.3||~7.2.0||~7.3.0", + "php": "~7.3.0||~7.4.0", "magento/framework": "*" }, "type": "magento2-module", From 7a32b0e5f9abba8bbebd66da6b58814eb0d50a99 Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Tue, 23 Feb 2021 17:54:05 +0100 Subject: [PATCH 2/2] MC-40572: Stabilize Unit tests (ASI) - Add PHP7.4 compatibility https://github.com/magento/adobe-stock-integration/issues/1182 --- .../System/Config/TestConnectionTest.php | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/AdobeStockAdminUi/Test/Unit/Controller/Adminhtml/System/Config/TestConnectionTest.php b/AdobeStockAdminUi/Test/Unit/Controller/Adminhtml/System/Config/TestConnectionTest.php index 0dee17ee53b2..dfc20b7813f6 100644 --- a/AdobeStockAdminUi/Test/Unit/Controller/Adminhtml/System/Config/TestConnectionTest.php +++ b/AdobeStockAdminUi/Test/Unit/Controller/Adminhtml/System/Config/TestConnectionTest.php @@ -9,6 +9,8 @@ use Magento\AdobeStockAdminUi\Controller\Adminhtml\System\Config\TestConnection; use Magento\AdobeStockClientApi\Api\ClientInterface; +use Magento\Backend\App\Action\Context; +use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\Result\Json; use Magento\Framework\Controller\Result\JsonFactory; use Magento\Framework\Filter\StripTags; @@ -42,6 +44,11 @@ class TestConnectionTest extends TestCase */ private $stripTagsMock; + /** + * @var RequestInterface|MockObject + */ + private $request; + /** * @var TestConnection */ @@ -53,7 +60,12 @@ class TestConnectionTest extends TestCase protected function setUp(): void { $this->objectManager = new ObjectManager($this); - $this->clientMock = $this->getMockForAbstractClass(ClientInterface::class); + $context = $this->createMock(Context::class); + $this->request = $this->createMock(RequestInterface::class); + $context->expects($this->once()) + ->method('getRequest') + ->willReturn($this->request); + $this->clientMock = $this->createMock(ClientInterface::class); $this->resultJsonFactoryMock = $this->createMock(JsonFactory::class); $this->stripTagsMock = $this->createMock(StripTags::class); $this->testConnection = $this->objectManager->getObject( @@ -61,7 +73,8 @@ protected function setUp(): void [ 'client' => $this->clientMock, 'resultJsonFactory' => $this->resultJsonFactoryMock, - 'tagFilter' => $this->stripTagsMock + 'tagFilter' => $this->stripTagsMock, + 'context' => $context ] ); } @@ -71,6 +84,9 @@ protected function setUp(): void */ public function testExecute(): void { + $this->request->expects($this->once()) + ->method('getParams') + ->willReturn(['api_key' => 'the_api_key']); $this->clientMock->expects($this->once()) ->method('testConnection') ->willReturn(true); @@ -95,6 +111,9 @@ public function testExecute(): void */ public function testExecuteWithError(): void { + $this->request->expects($this->once()) + ->method('getParams') + ->willReturn(['api_key' => 'the_api_key']); $this->clientMock->expects($this->once()) ->method('testConnection') ->willReturn(false);