diff --git a/phpstan.neon b/phpstan.neon index 87e159f..fc819e8 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -9,5 +9,13 @@ parameters: reportUnmatchedIgnoredErrors: false ignoreErrors: - '#Method PrestaShop\\PrestaShop\\Core\\Addon\\Module\\ModuleManager::install\(\) invoked with 2 parameters, 1 required.#' + - '#Call to function is_null\(\) with PrestaShop\\PrestaShop\\Core\\Addon\\Module\\ModuleManager will always evaluate to false.#' + - '#Call to function is_null\(\) with PrestaShop\\PrestaShop\\Core\\Module\\ModuleManager will always evaluate to false.#' + - '#Property Prestashop\\ModuleLibMboInstaller\\Installer::\$moduleManager has unknown class PrestaShop\\PrestaShop\\Core\\Addon\\Module\\ModuleManager as its type.#' + - '#Property Prestashop\\ModuleLibMboInstaller\\Installer::\$moduleManager has unknown class PrestaShop\\PrestaShop\\Core\\Module\\ModuleManager as its type.#' + - '#Call to method install\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Addon\\Module\\ModuleManager.#' + - '#Call to method install\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Module\\ModuleManager.#' + - '#Call to method enable\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Addon\\Module\\ModuleManager.#' + - '#Call to method enable\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Module\\ModuleManager.#' level: max diff --git a/phpunit.xml b/phpunit.xml index f6c3b38..ded6967 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -9,6 +9,9 @@ convertWarningsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" > + + + tests/Integration diff --git a/src/DependencyBuilder.php b/src/DependencyBuilder.php index 85483fc..1b4318a 100644 --- a/src/DependencyBuilder.php +++ b/src/DependencyBuilder.php @@ -6,7 +6,7 @@ class DependencyBuilder { - const DEPENDENCY_FILENAME = 'ps_dependencies.json'; + const DEPENDENCY_FILENAME = 'module_dependencies.json'; const GET_PARAMETER = 'mbo_action_needed'; /** @@ -155,7 +155,6 @@ protected function buildDependenciesContext() if ($this->isMboNeeded() && !isset($dependenciesContent['dependencies'][Installer::MODULE_NAME])) { $dependenciesContent['dependencies'][] = [ 'name' => Installer::MODULE_NAME, - 'id' => Installer::MODULE_ID, ]; } @@ -240,7 +239,6 @@ protected function addMboInDependencies() 'current_version' => (string) $mboStatus['version'], 'installed' => (bool) $mboStatus['isInstalled'], 'enabled' => false, - 'id' => Installer::MODULE_ID, 'name' => Installer::MODULE_NAME, ], $mboRoutes); } diff --git a/src/Installer.php b/src/Installer.php index a9ce3a6..dbca656 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -6,7 +6,6 @@ use Prestashop\ModuleLibGuzzleAdapter\ClientFactory; use Prestashop\ModuleLibGuzzleAdapter\Interfaces\ClientExceptionInterface; use Prestashop\ModuleLibGuzzleAdapter\Interfaces\HttpClientInterface; -use PrestaShop\PrestaShop\Core\Addon\AddonManagerInterface; use PrestaShop\PrestaShop\Core\Addon\Module\ModuleManagerBuilder; class Installer @@ -21,7 +20,7 @@ class Installer protected $marketplaceClient; /** - * @var AddonManagerInterface + * @var \PrestaShop\PrestaShop\Core\Module\ModuleManager|\PrestaShop\PrestaShop\Core\Addon\Module\ModuleManager */ protected $moduleManager;