Resets the Environment class to its default state, including unsetting the current
environment, removing any environment-specific configurations, and removing the custom
environment detector, if any has been specified.
public static reset ( $env = null ) | ||
$env | If set, delete the defined environment only. |
/** * 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')); }
public function testResetASpecificEnv() { Environment::set('test', array('foo' => 'bar')); Environment::set('development', array('hello' => 'world')); Environment::set('test'); $this->assertEqual('test', Environment::get()); $this->assertEqual('bar', Environment::get('foo')); Environment::reset('test'); $this->assertEqual('test', Environment::get()); $this->assertNull(Environment::get('foo')); Environment::set('development'); $this->assertEqual('world', Environment::get('hello')); }