Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / http-foundation / Tests / RedirectResponseTest.php
index 9e3e90c53e4fe1844c1d5149e8fe7e061927aae8..d389e83dbe14a76a1c4c9955a20c11796f26c6da 100644 (file)
@@ -81,4 +81,17 @@ class RedirectResponseTest extends TestCase
         $this->assertInstanceOf('Symfony\Component\HttpFoundation\RedirectResponse', $response);
         $this->assertEquals(301, $response->getStatusCode());
     }
+
+    public function testCacheHeaders()
+    {
+        $response = new RedirectResponse('foo.bar', 301);
+        $this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
+
+        $response = new RedirectResponse('foo.bar', 301, array('cache-control' => 'max-age=86400'));
+        $this->assertFalse($response->headers->hasCacheControlDirective('no-cache'));
+        $this->assertTrue($response->headers->hasCacheControlDirective('max-age'));
+
+        $response = new RedirectResponse('foo.bar', 302);
+        $this->assertTrue($response->headers->hasCacheControlDirective('no-cache'));
+    }
 }