/** * 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; }
/** * {@inheritdoc} */ public function doRun(InputInterface $input, OutputInterface $output) { $this->kernel->boot(); $this->kernel->flush(); return parent::doRun($input, $output); }
public function __construct(HttpKernelInterface $kernel, $cacheDir = null) { $kernel->boot(); parent::__construct($kernel, $cacheDir); }