From 0966305c45ce0fb72a5efdb68597364469c70463 Mon Sep 17 00:00:00 2001 From: DylanDenizon Date: Tue, 19 Nov 2024 11:02:39 +0100 Subject: [PATCH] change update to upgrade --- src/ApiPlatform/Resources/Module/UpgradeModule.php | 4 ++-- tests/Integration/ApiPlatform/ModuleEndpointTest.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ApiPlatform/Resources/Module/UpgradeModule.php b/src/ApiPlatform/Resources/Module/UpgradeModule.php index c71fdec..6077b39 100644 --- a/src/ApiPlatform/Resources/Module/UpgradeModule.php +++ b/src/ApiPlatform/Resources/Module/UpgradeModule.php @@ -23,7 +23,7 @@ namespace PrestaShop\Module\APIResources\ApiPlatform\Resources\Module; use ApiPlatform\Metadata\ApiResource; -use PrestaShop\PrestaShop\Core\Domain\Module\Command\UpdateModuleCommand; +use PrestaShop\PrestaShop\Core\Domain\Module\Command\UpgradeModuleCommand; use PrestaShop\PrestaShop\Core\Domain\Module\Query\GetModuleInfos; use PrestaShopBundle\ApiPlatform\Metadata\CQRSUpdate; @@ -31,7 +31,7 @@ operations: [ new CQRSUpdate( uriTemplate: '/module/{technicalName}/upgrade', - CQRSCommand: UpdateModuleCommand::class, + CQRSCommand: UpgradeModuleCommand::class, CQRSQuery: GetModuleInfos::class, scopes: [ 'module_write', diff --git a/tests/Integration/ApiPlatform/ModuleEndpointTest.php b/tests/Integration/ApiPlatform/ModuleEndpointTest.php index 4fd3509..5ff89c2 100644 --- a/tests/Integration/ApiPlatform/ModuleEndpointTest.php +++ b/tests/Integration/ApiPlatform/ModuleEndpointTest.php @@ -654,7 +654,7 @@ public function testBulkUninstallModule() /** * @depends testInstallModule */ - public function testUpdateModule(): void + public function testUpgradeModule(): void { $module212 = array( @@ -704,14 +704,14 @@ public function testUpdateModule(): void ], ]); - $response = static::createClient()->request('POST', sprintf('/module/%s/update', $module212['technicalName']), [ + $response = static::createClient()->request('POST', sprintf('/module/%s/upgrade', $module212['technicalName']), [ 'auth_bearer' => $bearerToken, // We must define a JSON body even if it is empty, we need to search how to make this optional 'json' => [ ], ]); - // Check response from status update request + // Check response from status upgrade request $expectedModule = [ 'technicalName' => $module213['technicalName'], 'version' => $module213['version'],