Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2021-09-18 18:36:21 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2021-09-18 18:44:48 +0300
commit73034e43e132430876a23161c7d919b719e94a20 (patch)
tree6629b54f57642e3d663aa6388c28b0470c8cf4db /test
parenta985e340ee8b70fb9a4b2a73c8d8be5c5bec9d9b (diff)
Extract setter methods from Config\Settings classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'test')
-rw-r--r--test/classes/Config/SettingsTest.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/classes/Config/SettingsTest.php b/test/classes/Config/SettingsTest.php
index bbeebcd03b..d188c9f8db 100644
--- a/test/classes/Config/SettingsTest.php
+++ b/test/classes/Config/SettingsTest.php
@@ -565,7 +565,7 @@ class SettingsTest extends TestCase
['TranslationWarningThreshold', 100, 100],
['AllowThirdPartyFraming', 'sameorigin', 'sameorigin'],
['blowfish_secret', 'blowfish_secret', 'blowfish_secret'],
- ['Servers', [2 => []], [2 => null]],
+ ['Servers', [1 => [], 2 => []], [1 => null, 2 => null]],
['Server', [], null],
['ServerDefault', 0, 0],
['VersionCheck', false, false],
@@ -727,7 +727,7 @@ class SettingsTest extends TestCase
['SaveDir', 'test', 'test'],
['TempDir', 'test', 'test'],
['GD2Available', 'yes', 'yes'],
- ['TrustedProxies', ['1.2.3.4' => 'HTTP_X_FORWARDED_FOR'], ['1.2.3.4' => 'HTTP_X_FORWARDED_FOR']],
+ ['TrustedProxies', ['1.2.3.4' => 'HTTP_X_FORWARDED_FOR', 'key' => 'value'], ['1.2.3.4' => 'HTTP_X_FORWARDED_FOR', 'key' => 'value']],
['CheckConfigurationPermissions', false, false],
['LinkLengthLimit', 1, 1],
['CSPAllow', 'phpmyadmin.net', 'phpmyadmin.net'],
@@ -737,7 +737,7 @@ class SettingsTest extends TestCase
['ZeroConf', false, false],
['DBG', ['sql' => true, 'sqllog' => true, 'demo' => true, 'simple2fa' => true], ['sql' => true, 'sqllog' => true, 'demo' => true, 'simple2fa' => true]],
['environment', 'development', 'development'],
- ['DefaultFunctions', ['key' => 'value'], ['key' => 'value']],
+ ['DefaultFunctions', ['key' => 'value', 'key2' => 'value2'], ['key' => 'value', 'key2' => 'value2']],
['maxRowPlotLimit', 1, 1],
['ShowGitRevision', false, false],
['MysqlMinVersion', ['internal' => 80026, 'human' => '8.0.26'], ['internal' => 80026, 'human' => '8.0.26']],
@@ -1035,7 +1035,7 @@ class SettingsTest extends TestCase
['UploadDir', 1234, '1234'],
['SaveDir', 1234, '1234'],
['TempDir', 1234, '1234'],
- ['TrustedProxies', [1234 => 1234, 'test1' => 'test2'], ['1234' => '1234', 'test1' => 'test2']],
+ ['TrustedProxies', ['test' => 1234], ['test' => '1234']],
['CheckConfigurationPermissions', 0, false],
['LinkLengthLimit', '1', 1],
['CSPAllow', 1234, '1234'],
@@ -1043,7 +1043,7 @@ class SettingsTest extends TestCase
['ConsoleEnterExecutes', 1, true],
['ZeroConf', 0, false],
['DBG', ['sql' => 1, 'sqllog' => 1, 'demo' => 1, 'simple2fa' => 1], ['sql' => true, 'sqllog' => true, 'demo' => true, 'simple2fa' => true]],
- ['DefaultFunctions', [1234 => 1234, 'test1' => 'test2'], ['1234' => '1234', 'test1' => 'test2']],
+ ['DefaultFunctions', ['test' => 1234], ['test' => '1234']],
['maxRowPlotLimit', '1', 1],
['ShowGitRevision', 0, false],
['MysqlMinVersion', ['internal' => '50500', 'human' => 550], ['internal' => 50500, 'human' => '550']],
@@ -1141,13 +1141,21 @@ class SettingsTest extends TestCase
],
'invalid values 2' => [
[
+ ['Servers', [0 => [], 2 => 'invalid', 'invalid' => [], 4 => []], [4 => null]],
['TranslationWarningThreshold', 101, 100],
['ForeignKeyDropdownOrder', ['id-content', 'invalid'], ['id-content']],
+ ['TrustedProxies', [1234 => 'invalid', 'valid' => 'valid'], ['valid' => 'valid']],
+ ['DefaultFunctions', [1234 => 'invalid', 'valid' => 'valid'], ['valid' => 'valid']],
['Console', ['Mode' => 'invalid', 'Height' => 0, 'OrderBy' => 'invalid', 'Order' => 'invalid'], ['StartHistory' => false, 'AlwaysExpand' => false, 'CurrentQuery' => true, 'EnterExecutes' => false, 'DarkTheme' => false, 'Mode' => 'info', 'Height' => 92, 'GroupQueries' => false, 'OrderBy' => 'exec', 'Order' => 'asc']],
['FirstDayOfCalendar', -1, 0],
],
],
- 'invalid values 3' => [[['ForeignKeyDropdownOrder', 'invalid', ['content-id', 'id-content']]]],
+ 'invalid values 3' => [
+ [
+ ['Servers', [0 => []], [1 => null]],
+ ['ForeignKeyDropdownOrder', 'invalid', ['content-id', 'id-content']],
+ ],
+ ],
'invalid values 4' => [[['ForeignKeyDropdownOrder', [1 => 'content-id'], ['content-id', 'id-content']]]],
];
}