From: Philipp Date: Mon, 27 Mar 2023 17:35:02 +0000 (+0200) Subject: adapt minor changers / fix tests X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c2d11328ccd81a36dd81ef1158903be9d55ecdd5;p=friendica.git adapt minor changers / fix tests --- diff --git a/src/Core/Config/Capability/IManageConfigValues.php b/src/Core/Config/Capability/IManageConfigValues.php index 964087ca95..18abdb6577 100644 --- a/src/Core/Config/Capability/IManageConfigValues.php +++ b/src/Core/Config/Capability/IManageConfigValues.php @@ -59,12 +59,12 @@ interface IManageConfigValues public function get(string $cat, string $key = null, $default_value = null); /** - * Returns true, if the current config cannot be changed + * Returns true, if the current config can be changed * * @param string $cat The category of the configuration value * @param string $key The configuration key to query * - * @return bool true, if set is disabled + * @return bool true, if writing is possible */ public function isWritable(string $cat, string $key): bool; diff --git a/src/Module/Admin/Storage.php b/src/Module/Admin/Storage.php index 0df11aae81..434b43b32e 100644 --- a/src/Module/Admin/Storage.php +++ b/src/Module/Admin/Storage.php @@ -146,7 +146,7 @@ class Storage extends BaseAdmin '$noconfig' => DI::l10n()->t('This backend doesn\'t have custom settings'), '$form_security_token' => self::getFormSecurityToken("admin_storage"), '$storagebackend_ro_txt' => !DI::config()->isWritable('storage', 'name') ? DI::l10n()->t('Changing the current backend is prohibited because it is set by an environment variable') : '', - '$is_writable' => DI::config()->isWritable('storage', 'name'), + '$is_writable' => DI::config()->isWritable('storage', 'name'), '$storagebackend' => $current_storage_backend instanceof ICanWriteToStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'), '$availablestorageforms' => $available_storage_forms, ]); diff --git a/tests/src/Core/Config/ConfigTest.php b/tests/src/Core/Config/ConfigTest.php index 800f41a7e9..99c2141b8a 100644 --- a/tests/src/Core/Config/ConfigTest.php +++ b/tests/src/Core/Config/ConfigTest.php @@ -613,11 +613,11 @@ class ConfigTest extends DatabaseTest } /** - * Tests if environment variables leads to a disabled set + * Tests if environment variables can change the permission to write a config key * * @dataProvider dataEnv */ - public function testIsSetDisabled(array $data, array $server, array $assertDisabled) + public function testIsWritable(array $data, array $server, array $assertDisabled) { $this->setConfigFile('static' . DIRECTORY_SEPARATOR . 'env.config.php', true); $this->loadDirectFixture($this->configToDbArray($data), $this->getDbInstance()); @@ -628,7 +628,7 @@ class ConfigTest extends DatabaseTest foreach ($data as $category => $keyvalues) { foreach ($keyvalues as $key => $value) { - if (!empty($assertDisabled[$category][$key])) { + if (empty($assertDisabled[$category][$key])) { static::assertTrue($config->isWritable($category, $key), sprintf('%s.%s is not true', $category, $key)); } else { static::assertFalse($config->isWritable($category, $key), sprintf('%s.%s is not false', $category, $key));