Skip to content

Commit

Permalink
change update to upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanDenizonPresta committed Nov 19, 2024
1 parent 37771d1 commit 0966305
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ApiPlatform/Resources/Module/UpgradeModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
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;

#[ApiResource(
operations: [
new CQRSUpdate(
uriTemplate: '/module/{technicalName}/upgrade',
CQRSCommand: UpdateModuleCommand::class,
CQRSCommand: UpgradeModuleCommand::class,
CQRSQuery: GetModuleInfos::class,
scopes: [
'module_write',
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/ApiPlatform/ModuleEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public function testBulkUninstallModule()
/**
* @depends testInstallModule
*/
public function testUpdateModule(): void
public function testUpgradeModule(): void
{

$module212 = array(
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit 0966305

Please sign in to comment.