mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
parent
072aee0a0f
commit
f990ecfff3
2 changed files with 20 additions and 0 deletions
|
@ -326,6 +326,15 @@ class Configure {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear all values stored in Configure.
|
||||||
|
*
|
||||||
|
* @return boolean success.
|
||||||
|
*/
|
||||||
|
public static function clear() {
|
||||||
|
self::$_values = array();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Set the error and exception handlers.
|
* Set the error and exception handlers.
|
||||||
*
|
*
|
||||||
|
|
|
@ -354,4 +354,15 @@ class ConfigureTest extends CakeTestCase {
|
||||||
Configure::config('test', $reader);
|
Configure::config('test', $reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that clear wipes all values.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testClear() {
|
||||||
|
Configure::write('test', 'value');
|
||||||
|
$this->assertTrue(Configure::clear());
|
||||||
|
$this->assertNull(Configure::read('debug'));
|
||||||
|
$this->assertNull(Configure::read('test'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue