protected function EsiTest::getCache

4 calls to EsiTest::getCache()
EsiTest::testHandle in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php
EsiTest::testHandleWhenResponseIsNot200 in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php
@expectedException RuntimeException
EsiTest::testHandleWhenResponseIsNot200AndAltIsPresent in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php
EsiTest::testHandleWhenResponseIsNot200AndErrorsAreIgnored in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/HttpCache/EsiTest.php

File

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

Class

EsiTest

Namespace

Symfony\Component\HttpKernel\Tests\HttpCache

Code

protected function getCache($request, $response) {
  $cache = $this
    ->getMock('Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache', array(
    'getRequest',
    'handle',
  ), array(), '', false);
  $cache
    ->expects($this
    ->any())
    ->method('getRequest')
    ->will($this
    ->returnValue($request));
  if (is_array($response)) {
    $cache
      ->expects($this
      ->any())
      ->method('handle')
      ->will(call_user_func_array(array(
      $this,
      'onConsecutiveCalls',
    ), $response));
  }
  else {
    $cache
      ->expects($this
      ->any())
      ->method('handle')
      ->will($this
      ->returnValue($response));
  }
  return $cache;
}