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

__construct() public method

Constructor.
public __construct ( array $server = [], Symfony\Component\BrowserKit\History $history = null, Symfony\Component\BrowserKit\CookieJar $cookieJar = null )
$server array The server parameters (equivalent of $_SERVER)
$history Symfony\Component\BrowserKit\History A History instance to store the browser history
$cookieJar Symfony\Component\BrowserKit\CookieJar A CookieJar instance to store the cookies
    public function __construct(array $server = array(), History $history = null, CookieJar $cookieJar = null)
    {
        $this->setServerParameters($server);
        $this->history = null === $history ? new History() : $history;
        $this->cookieJar = null === $cookieJar ? new CookieJar() : $cookieJar;
        $this->insulated = false;
        $this->followRedirects = true;
    }

Usage Example

 /**
  * Constructor.
  *
  * @param HttpKernelInterface $kernel    An HttpKernel instance
  * @param array               $server    The server parameters (equivalent of $_SERVER)
  * @param History             $history   A History instance to store the browser history
  * @param CookieJar           $cookieJar A CookieJar instance to store the cookies
  */
 public function __construct(HttpKernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)
 {
     // These class properties must be set before calling the parent constructor, as it may depend on it.
     $this->kernel = $kernel;
     $this->followRedirects = false;
     parent::__construct($server, $history, $cookieJar);
 }
All Usage Examples Of Symfony\Component\BrowserKit\Client::__construct