예제 #1
0
 /**
  * Creates a Client.
  *
  * @param array $options An array of options to pass to the createKernel class
  * @param array $server  An array of server parameters
  * @param array $cookies An array of Symfony\Component\BrowserKit\Cookie
  *
  * @return Client A Client instance
  */
 public function createClient(array $options = array(), array $server = array(), array $cookies = array())
 {
     if (null !== $this->kernel && $this->kernelReset) {
         $this->kernel->shutdown();
         $this->kernel->boot();
     }
     if (null === $this->kernel) {
         $this->kernel = $this->createKernel($options);
         $this->kernel->boot();
     }
     $client = $this->kernel->getContainer()->get('test.client');
     $client->setServerParameters($server);
     foreach ($cookies as $cookie) {
         $client->getCookieJar()->set($cookie);
     }
     return $client;
 }