Symfony\Component\BrowserKit\Client::setServerParameters PHP Method

setServerParameters() public method

Sets server parameters.
public setServerParameters ( array $server )
$server array An array of server parameters
    public function setServerParameters(array $server)
    {
        $this->server = array_merge(array(
            'HTTP_HOST'       => 'localhost',
            'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
        ), $server);
    }

Usage Example

Exemplo n.º 1
0
 public function _before(\Codeception\TestCase $test)
 {
     if (!$this->client) {
         if (!strpos($this->config['url'], '://')) {
             // not valid url
             foreach ($this->getModules() as $module) {
                 if ($module instanceof \Codeception\Util\Framework) {
                     $this->client = $module->client;
                     $this->is_functional = true;
                     break;
                 }
             }
         } else {
             if (!$this->hasModule('PhpBrowser')) {
                 throw new ModuleConfigException(__CLASS__, "For XMLRPC testing via HTTP please enable PhpBrowser module");
             }
             $this->client = $this->getModule('PhpBrowser')->session->getDriver()->getClient();
         }
         if (!$this->client) {
             throw new ModuleConfigException(__CLASS__, "Client for XMLRPC requests not initialized.\nProvide either PhpBrowser module, or a framework module which shares FrameworkInterface");
         }
     }
     $this->headers = array();
     $this->params = array();
     $this->response = '';
     $this->client->setServerParameters(array());
 }
All Usage Examples Of Symfony\Component\BrowserKit\Client::setServerParameters