From 510377d2cb4b12d1a421e8a88bd7edb86f223451 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 12 Jan 2016 19:50:48 +0100 Subject: Introduce the Updater class which * contains methods designed to be run once. * is able to upgrade the datastore or the configuration. * is based on methods names, stored in a text file with ';' separator (updates.txt). * begins with existing function 'mergeDeprecatedConfigFile()' (options.php). --- tests/ConfigTest.php | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'tests/ConfigTest.php') diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 492ddd3b..7200aae6 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -133,48 +133,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase writeConfig(self::$configFields, false); } - /** - * Test mergeDeprecatedConfig while being logged in: - * 1. init a config file. - * 2. init a options.php file with update value. - * 3. merge. - * 4. check updated value in config file. - */ - public function testMergeDeprecatedConfig() - { - // init - writeConfig(self::$configFields, true); - $configCopy = self::$configFields; - $invert = !$configCopy['privateLinkByDefault']; - $configCopy['privateLinkByDefault'] = $invert; - - // Use writeConfig to create a options.php - $configCopy['config']['CONFIG_FILE'] = 'tests/options.php'; - writeConfig($configCopy, true); - - $this->assertTrue(is_file($configCopy['config']['CONFIG_FILE'])); - - // merge configs - mergeDeprecatedConfig(self::$configFields, true); - - // make sure updated field is changed - include self::$configFields['config']['CONFIG_FILE']; - $this->assertEquals($invert, $GLOBALS['privateLinkByDefault']); - $this->assertFalse(is_file($configCopy['config']['CONFIG_FILE'])); - } - - /** - * Test mergeDeprecatedConfig while being logged in without options file. - */ - public function testMergeDeprecatedConfigNoFile() - { - writeConfig(self::$configFields, true); - mergeDeprecatedConfig(self::$configFields, true); - - include self::$configFields['config']['CONFIG_FILE']; - $this->assertEquals(self::$configFields['login'], $GLOBALS['login']); - } - /** * Test save_plugin_config with valid data. * -- cgit v1.2.3