public function HttpCacheTestCase::request

49 calls to HttpCacheTestCase::request()
HttpCacheTest::testAssignsDefaultTtlWhenResponseHasNoFreshnessInformation in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
HttpCacheTest::testCachesResponsesWithALastModifiedValidatorButNoFreshnessInformation in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
HttpCacheTest::testCachesResponsesWithAMaxAgeDirective in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
HttpCacheTest::testCachesResponsesWithAnETagValidatorButNoFreshnessInformation in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php
HttpCacheTest::testCachesResponsesWithAnExpirationHeader in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php

... See full list

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php, line 110

Class

HttpCacheTestCase

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

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;
}