lithium\tests\cases\core\EnvironmentTest::testSetAndGetCurrentEnvironment PHP Method

testSetAndGetCurrentEnvironment() public method

Tests setting and getting current environment, and that invalid environments cannot be selected.
    public function testSetAndGetCurrentEnvironment()
    {
        Environment::set('production', array('foo' => 'bar'));
        Environment::set('staging', array('foo' => 'baz'));
        Environment::set('development', array('foo' => 'dib'));
        Environment::set('development');
        $this->assertEqual('development', Environment::get());
        $this->assertTrue(Environment::is('development'));
        $this->assertNull(Environment::get('doesNotExist'));
        $expected = array('foo' => 'dib');
        $config = Environment::get('development');
        $this->assertEqual($expected, $config);
        $foo = Environment::get('foo');
        // returns 'dib', since the current env. is 'development'
        $expected = 'dib';
        $this->assertEqual($expected, $foo);
    }