public static reset ( $env = null ) | ||
$env | If set, delete the defined environment only. |
public static function reset($env = null)
{
if ($env) {
unset(static::$_configurations[$env]);
return;
}
static::$_current = '';
static::$_detector = null;
static::$_configurations = array('production' => array(), 'development' => array(), 'test' => array());
}
/** * Tests resetting the `Environment` class to its default state. * * @return void */ public function testReset() { Environment::set('test', array('foo' => 'bar')); Environment::set('test'); $this->assertEqual('test', Environment::get()); $this->assertEqual('bar', Environment::get('foo')); Environment::reset(); $this->assertEqual('', Environment::get()); $this->assertNull(Environment::get('foo')); }