From 014c0223ba92327dbd19bf721dd16f2aa8b921cc Mon Sep 17 00:00:00 2001 From: Sullivan Date: Thu, 24 Oct 2024 17:01:26 +0200 Subject: [PATCH] fix: clean unused import & add version on test install endpoint --- src/ApiPlatform/Resources/Module/InstallModule.php | 4 ---- tests/Integration/ApiPlatform/ModuleEndpointTest.php | 9 +++++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/ApiPlatform/Resources/Module/InstallModule.php b/src/ApiPlatform/Resources/Module/InstallModule.php index 1d7b67a..f0f0470 100644 --- a/src/ApiPlatform/Resources/Module/InstallModule.php +++ b/src/ApiPlatform/Resources/Module/InstallModule.php @@ -23,13 +23,9 @@ namespace PrestaShop\Module\APIResources\ApiPlatform\Resources\Module; use ApiPlatform\Metadata\ApiResource; -use PrestaShop\PrestaShop\Core\Domain\Module\Command\UpdateModuleStatusCommand; use PrestaShop\PrestaShop\Core\Domain\Module\Command\InstallModuleCommand; use PrestaShop\PrestaShop\Core\Domain\Module\Query\GetModuleInfos; -use PrestaShopBundle\ApiPlatform\Metadata\CQRSGet; -use PrestaShopBundle\ApiPlatform\Metadata\CQRSUpdate; use PrestaShopBundle\ApiPlatform\Metadata\CQRSCreate; -use PrestaShopBundle\ApiPlatform\Metadata\PaginatedList; #[ApiResource( operations: [ diff --git a/tests/Integration/ApiPlatform/ModuleEndpointTest.php b/tests/Integration/ApiPlatform/ModuleEndpointTest.php index 91ad3c4..b0e5417 100644 --- a/tests/Integration/ApiPlatform/ModuleEndpointTest.php +++ b/tests/Integration/ApiPlatform/ModuleEndpointTest.php @@ -278,7 +278,10 @@ public function testBulkUninstallModule() */ public function testInstallModuleExistInFolder(): void { - $module = array('technicalName' => 'bankwire'); + $module = array( + 'technicalName' => 'bankwire', + 'version' => '2.0.0' + ); $bearerToken = $this->getBearerToken(['module_write']); $response = static::createClient()->request('POST', sprintf('/module/%s/install', $module['technicalName']), [ @@ -307,7 +310,8 @@ public function testInstallModuleFromZip(): void { $module = array( 'technicalName' => 'test_install_cqrs_command', - 'source' => _PS_MODULE_DIR_ . 'test_install_cqrs_command.zip' + 'source' => _PS_MODULE_DIR_ . 'test_install_cqrs_command.zip', + 'version' => '1.0.0' ); $bearerToken = $this->getBearerToken(['module_write']); $response = static::createClient()->request('POST', sprintf('/module/%s/install', $module['technicalName']), [ @@ -341,6 +345,7 @@ public function testInstallModuleFromUrl(): void $module = array( 'technicalName' => 'ps_featuredproducts', 'source' => 'https://github.com/PrestaShop/ps_featuredproducts/releases/download/v2.1.5/ps_featuredproducts.zip', + 'version' => '2.1.5' ); $bearerToken = $this->getBearerToken(['module_write']);