aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ConfigTest.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-02-15 20:36:42 +0100
committerArthur <arthur@hoa.ro>2016-02-15 20:36:42 +0100
commit854ea372553d6ef8174cae320801e5ff3a101a87 (patch)
treeda9185d7c5d733219ca4638b512b18f2d9a55174 /tests/ConfigTest.php
parent2865118ca44661c7535aaf7b83e3b9222bc1f9a6 (diff)
parent510377d2cb4b12d1a421e8a88bd7edb86f223451 (diff)
downloadShaarli-854ea372553d6ef8174cae320801e5ff3a101a87.tar.gz
Shaarli-854ea372553d6ef8174cae320801e5ff3a101a87.tar.zst
Shaarli-854ea372553d6ef8174cae320801e5ff3a101a87.zip
Merge pull request #442 from ArthurHoaro/updater
Introduce the Updater class which
Diffstat (limited to 'tests/ConfigTest.php')
-rw-r--r--tests/ConfigTest.php42
1 files changed, 0 insertions, 42 deletions
diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php
index 492ddd3b..7200aae6 100644
--- a/tests/ConfigTest.php
+++ b/tests/ConfigTest.php
@@ -134,48 +134,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase
134 } 134 }
135 135
136 /** 136 /**
137 * Test mergeDeprecatedConfig while being logged in:
138 * 1. init a config file.
139 * 2. init a options.php file with update value.
140 * 3. merge.
141 * 4. check updated value in config file.
142 */
143 public function testMergeDeprecatedConfig()
144 {
145 // init
146 writeConfig(self::$configFields, true);
147 $configCopy = self::$configFields;
148 $invert = !$configCopy['privateLinkByDefault'];
149 $configCopy['privateLinkByDefault'] = $invert;
150
151 // Use writeConfig to create a options.php
152 $configCopy['config']['CONFIG_FILE'] = 'tests/options.php';
153 writeConfig($configCopy, true);
154
155 $this->assertTrue(is_file($configCopy['config']['CONFIG_FILE']));
156
157 // merge configs
158 mergeDeprecatedConfig(self::$configFields, true);
159
160 // make sure updated field is changed
161 include self::$configFields['config']['CONFIG_FILE'];
162 $this->assertEquals($invert, $GLOBALS['privateLinkByDefault']);
163 $this->assertFalse(is_file($configCopy['config']['CONFIG_FILE']));
164 }
165
166 /**
167 * Test mergeDeprecatedConfig while being logged in without options file.
168 */
169 public function testMergeDeprecatedConfigNoFile()
170 {
171 writeConfig(self::$configFields, true);
172 mergeDeprecatedConfig(self::$configFields, true);
173
174 include self::$configFields['config']['CONFIG_FILE'];
175 $this->assertEquals(self::$configFields['login'], $GLOBALS['login']);
176 }
177
178 /**
179 * Test save_plugin_config with valid data. 137 * Test save_plugin_config with valid data.
180 * 138 *
181 * @throws PluginConfigOrderException 139 * @throws PluginConfigOrderException