File tree Expand file tree Collapse file tree 6 files changed +9
-89
lines changed Expand file tree Collapse file tree 6 files changed +9
-89
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public function getAll()
79
79
{
80
80
$ out = [];
81
81
foreach ($ this ->cookies as $ cookie ) {
82
- $ out [] = $ this ->convertCookie ($ cookie );
82
+ $ out [] = $ this ->convertCookieToArray ($ cookie );
83
83
}
84
84
85
85
return $ out ;
@@ -93,7 +93,7 @@ public function getAll()
93
93
* @param \Cake\Http\Cookie\CookieInterface $cookie Cookie object.
94
94
* @return array
95
95
*/
96
- public function convertCookie (CookieInterface $ cookie )
96
+ protected function convertCookieToArray (CookieInterface $ cookie )
97
97
{
98
98
return [
99
99
'name ' => $ cookie ->getName (),
Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ public function getCookieData($name)
446
446
447
447
$ cookie = $ this ->cookies ->get ($ name );
448
448
449
- return $ this ->convertCookie ($ cookie );
449
+ return $ this ->convertCookieToArray ($ cookie );
450
450
}
451
451
452
452
/**
@@ -458,7 +458,7 @@ public function getCookieData($name)
458
458
* @param \Cake\Http\Cookie\CookieInterface $cookie Cookie object.
459
459
* @return array
460
460
*/
461
- public function convertCookie (CookieInterface $ cookie )
461
+ protected function convertCookieToArray (CookieInterface $ cookie )
462
462
{
463
463
return [
464
464
'name ' => $ cookie ->getName (),
@@ -495,7 +495,7 @@ protected function _getCookies()
495
495
496
496
$ cookies = [];
497
497
foreach ($ this ->cookies as $ cookie ) {
498
- $ cookies [$ cookie ->getName ()] = $ this ->convertCookie ($ cookie );
498
+ $ cookies [$ cookie ->getName ()] = $ this ->convertCookieToArray ($ cookie );
499
499
}
500
500
501
501
return $ cookies ;
Original file line number Diff line number Diff line change @@ -1941,7 +1941,7 @@ public function cookie($options = null)
1941
1941
1942
1942
$ cookie = $ this ->_cookies ->get ($ options );
1943
1943
1944
- return $ this ->convertCookie ($ cookie );
1944
+ return $ this ->convertCookieToArray ($ cookie );
1945
1945
}
1946
1946
1947
1947
$ options += [
@@ -2047,7 +2047,7 @@ public function getCookie($name)
2047
2047
2048
2048
$ cookie = $ this ->_cookies ->get ($ name );
2049
2049
2050
- return $ this ->convertCookie ($ cookie );
2050
+ return $ this ->convertCookieToArray ($ cookie );
2051
2051
}
2052
2052
2053
2053
/**
@@ -2061,7 +2061,7 @@ public function getCookies()
2061
2061
{
2062
2062
$ out = [];
2063
2063
foreach ($ this ->_cookies as $ cookie ) {
2064
- $ out [$ cookie ->getName ()] = $ this ->convertCookie ($ cookie );
2064
+ $ out [$ cookie ->getName ()] = $ this ->convertCookieToArray ($ cookie );
2065
2065
}
2066
2066
2067
2067
return $ out ;
@@ -2076,7 +2076,7 @@ public function getCookies()
2076
2076
* @param \Cake\Http\Cookie\CookieInterface $cookie Cookie object.
2077
2077
* @return array
2078
2078
*/
2079
- public function convertCookie (CookieInterface $ cookie )
2079
+ protected function convertCookieToArray (CookieInterface $ cookie )
2080
2080
{
2081
2081
return [
2082
2082
'name ' => $ cookie ->getName (),
Original file line number Diff line number Diff line change @@ -303,30 +303,4 @@ public function testGetMatchingDomainWithDot()
303
303
$ expected = [];
304
304
$ this ->assertEquals ($ expected , $ result );
305
305
}
306
-
307
- /**
308
- * Test convertCookie
309
- *
310
- * @return void
311
- */
312
- public function testConvertCookie ()
313
- {
314
- $ date = Chronos::parse ('2017-03-31 12:34:56 ' );
315
- $ cookie = new Cookie ('cakephp ' , 'cakephp-rocks ' );
316
- $ cookie = $ cookie ->withDomain ('cakephp.org ' )
317
- ->withPath ('/api ' )
318
- ->withExpiry ($ date )
319
- ->withHttpOnly (true )
320
- ->withSecure (true );
321
- $ expected = [
322
- 'name ' => 'cakephp ' ,
323
- 'value ' => 'cakephp-rocks ' ,
324
- 'path ' => '/api ' ,
325
- 'domain ' => 'cakephp.org ' ,
326
- 'expires ' => $ date ->format ('U ' ),
327
- 'secure ' => true ,
328
- 'httponly ' => true
329
- ];
330
- $ this ->assertEquals ($ expected , $ this ->cookies ->convertCookie ($ cookie ));
331
- }
332
306
}
Original file line number Diff line number Diff line change @@ -430,31 +430,4 @@ public function testAutoDecodeGzipBody()
430
430
$ response = new Response ($ headers , $ body );
431
431
$ this ->assertEquals ('Hello world! ' , $ response ->body );
432
432
}
433
-
434
- /**
435
- * Test convertCookie
436
- *
437
- * @return void
438
- */
439
- public function testConvertCookie ()
440
- {
441
- $ date = Chronos::parse ('2017-03-31 12:34:56 ' );
442
- $ cookie = new Cookie ('cakephp ' , 'cakephp-rocks ' );
443
- $ cookie = $ cookie ->withDomain ('cakephp.org ' )
444
- ->withPath ('/api ' )
445
- ->withExpiry ($ date )
446
- ->withHttpOnly (true )
447
- ->withSecure (true );
448
- $ expected = [
449
- 'name ' => 'cakephp ' ,
450
- 'value ' => 'cakephp-rocks ' ,
451
- 'path ' => '/api ' ,
452
- 'domain ' => 'cakephp.org ' ,
453
- 'expires ' => 'Fri, 31-Mar-2017 12:34:56 GMT ' ,
454
- 'secure ' => true ,
455
- 'httponly ' => true
456
- ];
457
- $ response = new Response ([], '' );
458
- $ this ->assertEquals ($ expected , $ response ->convertCookie ($ cookie ));
459
- }
460
433
}
Original file line number Diff line number Diff line change @@ -3051,31 +3051,4 @@ public function testDebugInfo()
3051
3051
];
3052
3052
$ this ->assertEquals ($ expected , $ result );
3053
3053
}
3054
-
3055
- /**
3056
- * Test convertCookie
3057
- *
3058
- * @return void
3059
- */
3060
- public function testConvertCookie ()
3061
- {
3062
- $ date = Chronos::parse ('2017-03-31 12:34:56 ' );
3063
- $ cookie = new Cookie ('cakephp ' , 'cakephp-rocks ' );
3064
- $ cookie = $ cookie ->withDomain ('cakephp.org ' )
3065
- ->withPath ('/api ' )
3066
- ->withExpiry ($ date )
3067
- ->withHttpOnly (true )
3068
- ->withSecure (true );
3069
- $ expected = [
3070
- 'name ' => 'cakephp ' ,
3071
- 'value ' => 'cakephp-rocks ' ,
3072
- 'path ' => '/api ' ,
3073
- 'domain ' => 'cakephp.org ' ,
3074
- 'expire ' => $ date ->format ('U ' ),
3075
- 'secure ' => true ,
3076
- 'httpOnly ' => true
3077
- ];
3078
- $ response = new Response ();
3079
- $ this ->assertEquals ($ expected , $ response ->convertCookie ($ cookie ));
3080
- }
3081
3054
}
You can’t perform that action at this time.
0 commit comments