@@ -34,39 +34,39 @@ public function provideAllPreserveCase()
34
34
return array (
35
35
array (
36
36
array ('fOo ' => 'BAR ' ),
37
- array ('fOo ' => array ('BAR ' ), 'Cache-Control ' => array ('no-cache ' )),
37
+ array ('fOo ' => array ('BAR ' ), 'Cache-Control ' => array ('no-cache, private ' )),
38
38
),
39
39
array (
40
40
array ('ETag ' => 'xyzzy ' ),
41
41
array ('ETag ' => array ('xyzzy ' ), 'Cache-Control ' => array ('private, must-revalidate ' )),
42
42
),
43
43
array (
44
44
array ('Content-MD5 ' => 'Q2hlY2sgSW50ZWdyaXR5IQ== ' ),
45
- array ('Content-MD5 ' => array ('Q2hlY2sgSW50ZWdyaXR5IQ== ' ), 'Cache-Control ' => array ('no-cache ' )),
45
+ array ('Content-MD5 ' => array ('Q2hlY2sgSW50ZWdyaXR5IQ== ' ), 'Cache-Control ' => array ('no-cache, private ' )),
46
46
),
47
47
array (
48
48
array ('P3P ' => 'CP="CAO PSA OUR" ' ),
49
- array ('P3P ' => array ('CP="CAO PSA OUR" ' ), 'Cache-Control ' => array ('no-cache ' )),
49
+ array ('P3P ' => array ('CP="CAO PSA OUR" ' ), 'Cache-Control ' => array ('no-cache, private ' )),
50
50
),
51
51
array (
52
52
array ('WWW-Authenticate ' => 'Basic realm="WallyWorld" ' ),
53
- array ('WWW-Authenticate ' => array ('Basic realm="WallyWorld" ' ), 'Cache-Control ' => array ('no-cache ' )),
53
+ array ('WWW-Authenticate ' => array ('Basic realm="WallyWorld" ' ), 'Cache-Control ' => array ('no-cache, private ' )),
54
54
),
55
55
array (
56
56
array ('X-UA-Compatible ' => 'IE=edge,chrome=1 ' ),
57
- array ('X-UA-Compatible ' => array ('IE=edge,chrome=1 ' ), 'Cache-Control ' => array ('no-cache ' )),
57
+ array ('X-UA-Compatible ' => array ('IE=edge,chrome=1 ' ), 'Cache-Control ' => array ('no-cache, private ' )),
58
58
),
59
59
array (
60
60
array ('X-XSS-Protection ' => '1; mode=block ' ),
61
- array ('X-XSS-Protection ' => array ('1; mode=block ' ), 'Cache-Control ' => array ('no-cache ' )),
61
+ array ('X-XSS-Protection ' => array ('1; mode=block ' ), 'Cache-Control ' => array ('no-cache, private ' )),
62
62
),
63
63
);
64
64
}
65
65
66
66
public function testCacheControlHeader ()
67
67
{
68
68
$ bag = new ResponseHeaderBag (array ());
69
- $ this ->assertEquals ('no-cache ' , $ bag ->get ('Cache-Control ' ));
69
+ $ this ->assertEquals ('no-cache, private ' , $ bag ->get ('Cache-Control ' ));
70
70
$ this ->assertTrue ($ bag ->hasCacheControlDirective ('no-cache ' ));
71
71
72
72
$ bag = new ResponseHeaderBag (array ('Cache-Control ' => 'public ' ));
@@ -111,6 +111,14 @@ public function testCacheControlHeader()
111
111
$ this ->assertEquals ('private, must-revalidate ' , $ bag ->get ('Cache-Control ' ));
112
112
}
113
113
114
+ public function testCacheControlClone ()
115
+ {
116
+ $ headers = array ('foo ' => 'bar ' );
117
+ $ bag1 = new ResponseHeaderBag ($ headers );
118
+ $ bag2 = new ResponseHeaderBag ($ bag1 ->allPreserveCase ());
119
+ $ this ->assertEquals ($ bag1 ->allPreserveCase (), $ bag2 ->allPreserveCase ());
120
+ }
121
+
114
122
public function testToStringIncludesCookieHeaders ()
115
123
{
116
124
$ bag = new ResponseHeaderBag (array ());
@@ -135,7 +143,7 @@ public function testClearCookieSecureNotHttpOnly()
135
143
public function testReplace ()
136
144
{
137
145
$ bag = new ResponseHeaderBag (array ());
138
- $ this ->assertEquals ('no-cache ' , $ bag ->get ('Cache-Control ' ));
146
+ $ this ->assertEquals ('no-cache, private ' , $ bag ->get ('Cache-Control ' ));
139
147
$ this ->assertTrue ($ bag ->hasCacheControlDirective ('no-cache ' ));
140
148
141
149
$ bag ->replace (array ('Cache-Control ' => 'public ' ));
@@ -146,12 +154,12 @@ public function testReplace()
146
154
public function testReplaceWithRemove ()
147
155
{
148
156
$ bag = new ResponseHeaderBag (array ());
149
- $ this ->assertEquals ('no-cache ' , $ bag ->get ('Cache-Control ' ));
157
+ $ this ->assertEquals ('no-cache, private ' , $ bag ->get ('Cache-Control ' ));
150
158
$ this ->assertTrue ($ bag ->hasCacheControlDirective ('no-cache ' ));
151
159
152
160
$ bag ->remove ('Cache-Control ' );
153
161
$ bag ->replace (array ());
154
- $ this ->assertEquals ('no-cache ' , $ bag ->get ('Cache-Control ' ));
162
+ $ this ->assertEquals ('no-cache, private ' , $ bag ->get ('Cache-Control ' ));
155
163
$ this ->assertTrue ($ bag ->hasCacheControlDirective ('no-cache ' ));
156
164
}
157
165
0 commit comments