[BrowserKit] added getServerParameter method which makes setServerParameters/setServerParameter methods testable

This commit is contained in:
hidenorigoto 2011-04-17 11:22:59 +09:00
parent 54c3d236c2
commit 1d85a3dcb1

View File

@ -119,6 +119,18 @@ abstract class Client
$this->server[$key] = $value;
}
/**
* Gets single server parameter for specified key.
*
* @param string $key A key of the parameter to get
* @param string $default A default value when key is undefined
* @return string A value of the parameter
*/
public function getServerParameter($key, $default = '')
{
return (isset($this->server[$key])) ? $this->server[$key] : $default;
}
/**
* Returns the History instance.
*