Perforce Chronicle 2012.2/486814
API Documentation
|
More testable version of http requests. More...
Public Member Functions | |
getServer ($key=null, $default=null) | |
Get one or all server variables. | |
setServer ($key, $value) | |
Override a server variable for testing purposes. | |
Protected Attributes | |
$_server = array() |
More testable version of http requests.
Allows server variables to be mocked.
P4Cms_Controller_Request_HttpTestCase::getServer | ( | $ | key = null , |
$ | default = null |
||
) |
Get one or all server variables.
Extended to read from test values first.
string | $key | optional - a specific server variable to get if no $key is passed, returns the entire $_SERVER array |
mixed | $default | default value to use if key not found |
{ if ($key && isset($this->_server[$key])) { return $this->_server[$key]; } return parent::getServer($key, $default); }
P4Cms_Controller_Request_HttpTestCase::setServer | ( | $ | key, |
$ | value | ||
) |
Override a server variable for testing purposes.
string | $key | the name of the variable |
mixed | $value | the value of the variable |
{
$this->_server[$key] = $value;
return $this;
}
P4Cms_Controller_Request_HttpTestCase::$_server = array() [protected] |