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