public function env($key = null)
{
if (!empty($this->_env[$key])) {
return $this->_env[$key];
}
if ($key === null) {
return $this->_env;
}
return null;
}
public function testConstructWithEnv() { $base = Libraries::get(true, 'resources') . '/tmp/tests'; $this->skipIf(!is_readable($base), "Path `{$base}` is not readable."); chdir(Libraries::get(true, 'resources') . '/tmp'); $request = new Request(array('env' => array('working' => '/some/other/path'))); $expected = '/some/other/path'; $result = $request->env('working'); $this->assertEqual($expected, $result); }