Ejemplo n.º 1
0
 public function testGetEnv()
 {
     if (isset($_ENV['PATH'])) {
         $this->assertEquals($_ENV['PATH'], $this->_request->getEnv('PATH'));
     }
     $this->assertEquals('foo', $this->_request->getEnv('BAR', 'foo'));
     $this->assertEquals($_ENV, $this->_request->getEnv());
 }
Ejemplo n.º 2
0
 /**
  * @access public
  * @param  string  $key     Key to search for in $_ENV
  * @param  mixed   $default Default value if $key is not found in $_ENV
  * @param  integer $filter  Filter definition
  * @param  array   $options Filter configuration
  * @return mixed
  */
 public function getEnv($key = null, $default = null, $filter = null, array $options = null)
 {
     $value = parent::getEnv($key, $default);
     if ($filter !== null || $options !== null) {
         $value = $this->_filter($value, $default, $filter, $options);
     }
     return $value;
 }