]> source.dussan.org Git - nextcloud-server.git/commitdiff
drop unused isDebugMode and setDebugMode of OC_Config
authorMorris Jobke <hey@morrisjobke.de>
Fri, 28 Nov 2014 17:38:49 +0000 (18:38 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 8 Dec 2014 21:42:44 +0000 (22:42 +0100)
lib/private/config.php
tests/lib/config.php

index cc07d6a1ed124baa4fafad20391bd285aafd0ee9..8544de34b720b904cd0ad1b165361ad1cd41ff62 100644 (file)
@@ -39,24 +39,6 @@ class Config {
                $this->debugMode = (defined('DEBUG') && DEBUG);
        }
 
-       /**
-        * Enables or disables the debug mode
-        * @param bool $state True to enable, false to disable
-        */
-       public function setDebugMode($state) {
-               $this->debugMode = $state;
-               $this->writeData();
-               $this->cache;
-       }
-
-       /**
-        * Returns whether the debug mode is enabled or disabled
-        * @return bool True when enabled, false otherwise
-        */
-       public function isDebugMode() {
-               return $this->debugMode;
-       }
-
        /**
         * Lists all available config keys
         * @return array an array of key names
index 9dff3aab84f9bfc335deb2a2d3443532509d9003..6adba356a1c7cf12864f9061e6ded0fb5dfd1577 100644 (file)
@@ -47,7 +47,6 @@ class Test_Config extends \Test\TestCase {
        }
 
        public function testSetValue() {
-               $this->config->setDebugMode(false);
                $this->config->setValue('foo', 'moo');
                $expectedConfig = $this->initialConfig;
                $expectedConfig['foo'] = 'moo';
@@ -73,7 +72,6 @@ class Test_Config extends \Test\TestCase {
        }
 
        public function testDeleteKey() {
-               $this->config->setDebugMode(false);
                $this->config->deleteKey('foo');
                $expectedConfig = $this->initialConfig;
                unset($expectedConfig['foo']);
@@ -85,37 +83,6 @@ class Test_Config extends \Test\TestCase {
                $this->assertEquals($expected, $content);
        }
 
-       public function testSetDebugMode() {
-               $this->config->setDebugMode(true);
-               $this->assertAttributeEquals($this->initialConfig, 'cache', $this->config);
-               $this->assertAttributeEquals(true, 'debugMode', $this->config);
-               $content = file_get_contents($this->configFile);
-               $expected = "<?php\ndefine('DEBUG',true);\n\$CONFIG = array (\n  'foo' => 'bar',\n  'beers' => \n  array (\n    0 => 'Appenzeller',\n  " .
-                       "  1 => 'Guinness',\n    2 => 'Kölsch',\n  ),\n  'alcohol_free' => false,\n);\n";
-               $this->assertEquals($expected, $content);
-
-               $this->config->setDebugMode(false);
-               $this->assertAttributeEquals($this->initialConfig, 'cache', $this->config);
-               $this->assertAttributeEquals(false, 'debugMode', $this->config);
-               $content = file_get_contents($this->configFile);
-               $expected = "<?php\n\$CONFIG = array (\n  'foo' => 'bar',\n  'beers' => \n  array (\n    0 => 'Appenzeller',\n  " .
-                       "  1 => 'Guinness',\n    2 => 'Kölsch',\n  ),\n  'alcohol_free' => false,\n);\n";
-               $this->assertEquals($expected, $content);
-       }
-
-       public function testIsDebugMode() {
-               // Default
-               $this->assertFalse($this->config->isDebugMode());
-
-               // Manually set to false
-               $this->config->setDebugMode(false);
-               $this->assertFalse($this->config->isDebugMode());
-
-               // Manually set to true
-               $this->config->setDebugMode(true);
-               $this->assertTrue($this->config->isDebugMode());
-       }
-
        public function testConfigMerge() {
                // Create additional config
                $additionalConfig = '<?php $CONFIG=array("php53"=>"totallyOutdated");';