]> git.mxchange.org Git - friendica.git/commitdiff
adapt minor changers / fix tests
authorPhilipp <admin@philipp.info>
Mon, 27 Mar 2023 17:35:02 +0000 (19:35 +0200)
committerPhilipp <admin@philipp.info>
Mon, 27 Mar 2023 17:36:14 +0000 (19:36 +0200)
src/Core/Config/Capability/IManageConfigValues.php
src/Module/Admin/Storage.php
tests/src/Core/Config/ConfigTest.php

index 964087ca9565763b52a5f5355e88c7443b4c950a..18abdb65770edd51d7a6c4084f99fbe3afba01ef 100644 (file)
@@ -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;
 
index 0df11aae81cb06b8bbea2452411c0dbc4d4f87d6..434b43b32ed6e7095ed75b5b1f2fdfbc3e65fedd 100644 (file)
@@ -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,
                ]);
index 800f41a7e9a97af3f3666d6cd44452879eac73e4..99c2141b8a5c2fac9e7c58d0068026ea1320e3de 100644 (file)
@@ -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));