Example #1
0
 public function testDeleteKey()
 {
     $this->config->deleteKey('foo');
     $expectedConfig = $this->initialConfig;
     unset($expectedConfig['foo']);
     $this->assertAttributeEquals($expectedConfig, 'cache', $this->config);
     $content = file_get_contents($this->configFile);
     $expected = "<?php\n\$CONFIG = array (\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);
 }
Example #2
0
 public function testSavingDebugMode()
 {
     $this->config->setDebugMode(true);
     $this->config->deleteKey('foo');
     // change something so we save to the config file
     $this->assertAttributeEquals(array(), 'cache', $this->config);
     $this->assertAttributeEquals(true, 'debugMode', $this->config);
     $content = file_get_contents(self::CONFIG_FILE);
     $expected = "<?php\ndefine('DEBUG',true);\n\$CONFIG = array (\n);\n";
     $this->assertEquals($expected, $content);
 }
Example #3
0
 /**
  * @brief Removes a key from the config
  * @param string $key key
  *
  * This function removes a key from the config.php.
  *
  */
 public static function deleteKey($key)
 {
     self::$object->deleteKey($key);
 }
Example #4
0
 /**
  * Delete a system wide defined value
  *
  * @param string $key the key of the value, under which it was saved
  */
 public function deleteValue($key)
 {
     $this->config->deleteKey($key);
 }