Add tests for HookFileManager

This commit is contained in:
Philipp 2023-07-16 22:41:56 +02:00
parent a9178e6982
commit 527622df4a
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
2 changed files with 245 additions and 2 deletions

View file

@ -104,13 +104,13 @@ class HookFileManager
$configFile = $this->basePath . '/' . static::STATIC_DIR . '/' . static::CONFIG_NAME . '.config.php';
if (!file_exists($configFile)) {
throw new HookConfigException(sprintf('config file %s does not exit.', $configFile));
throw new HookConfigException(sprintf('config file %s does not exist.', $configFile));
}
$config = include $configFile;
if (!is_array($config)) {
throw new HookConfigException('Error loading config file ' . $configFile);
throw new HookConfigException(sprintf('Error loading config file %s.', $configFile));
}
$this->hookConfig = array_merge_recursive($config, $this->addonLoader->getActiveAddonConfig(static::CONFIG_NAME));