浏览代码

[HttpKernel] fixed invalid test

According to ResponseHeaderBag::computeCacheControlValue(), a response with an ETag but no explicit Cache-Control header should have a sensible Cache-Control of "private, must-revalidate" set. According to Response::isCacheable(), a response that includes a private Cache-Controls is not considered cacheable. Therefore, in order for this test response to be cacheable and stored, it requires an explicit Cache-Control of public.
Kris Wallsmith 14 年之前
父节点
当前提交
3e131f5b70
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php

+ 1 - 0
tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php

@@ -168,6 +168,7 @@ class HttpCacheTest extends HttpCacheTestCase
                     $response->setContent('private data');
                 }
             } else {
+                $response->headers->set('Cache-Control', 'public');
                 $response->setETag('"public tag"');
                 if (in_array('"public tag"', $etags)) {
                     $response->setStatusCode(304);