public function request($method, $uri = '/', $server = array(), $cookies = array(), $esi = false) {
if (null === $this->kernel) {
throw new \LogicException('You must call setNextResponse() before calling request().');
}
$this->kernel
->reset();
$this->store = new Store(sys_get_temp_dir() . '/http_cache');
$this->cacheConfig['debug'] = true;
$this->esi = $esi ? new Esi() : null;
$this->cache = new HttpCache($this->kernel, $this->store, $this->esi, $this->cacheConfig);
$this->request = Request::create($uri, $method, array(), $cookies, array(), $server);
$this->response = $this->cache
->handle($this->request, HttpKernelInterface::MASTER_REQUEST, $this->catch);
$this->responses[] = $this->response;
}