File tree Expand file tree Collapse file tree 2 files changed +6
-35
lines changed Expand file tree Collapse file tree 2 files changed +6
-35
lines changed Original file line number Diff line number Diff line change 16
16
use Cake \Core \App ;
17
17
use Cake \Core \Exception \Exception ;
18
18
use Cake \Core \InstanceConfigTrait ;
19
- use Cake \Http \Client \CookieCollection as ClientCookieCollection ;
19
+ use Cake \Http \Client \CookieCollection ;
20
20
use Cake \Http \Client \Request ;
21
- use Cake \Http \Cookie \CookieCollection ;
22
21
use Cake \Utility \Hash ;
23
22
24
23
/**
@@ -169,44 +168,20 @@ public function __construct($config = [])
169
168
$ this ->_cookies = $ this ->_config ['cookieJar ' ];
170
169
$ this ->setConfig ('cookieJar ' , null );
171
170
} else {
172
- $ this ->_cookies = new ClientCookieCollection ();
171
+ $ this ->_cookies = new CookieCollection ();
173
172
}
174
173
}
175
174
176
175
/**
177
176
* Get the cookies stored in the Client.
178
177
*
179
- * @return \Cake\Http\Cookie\CookieCollection
180
- * @deprecated 3.5.0 Use getCookies() instead.
178
+ * @return \Cake\Http\Client\CookieCollection
181
179
*/
182
180
public function cookies ()
183
181
{
184
182
return $ this ->_cookies ;
185
183
}
186
184
187
- /**
188
- * Get the cookies stored in the Client.
189
- *
190
- * @return \Cake\Http\Cookie\CookieCollection
191
- */
192
- public function getCookies ()
193
- {
194
- return $ this ->_cookies ;
195
- }
196
-
197
- /**
198
- * Sets the cookie collection.
199
- *
200
- * @param \Cake\Http\Cookie\CookieCollection $cookies Cookie collection to be set.
201
- * @return $this
202
- */
203
- public function setCookies (CookieCollection $ cookies )
204
- {
205
- $ this ->_cookies = $ cookies ;
206
-
207
- return $ this ;
208
- }
209
-
210
185
/**
211
186
* Do a GET request.
212
187
*
Original file line number Diff line number Diff line change @@ -622,22 +622,18 @@ public function testCookieStorage()
622
622
}
623
623
624
624
/**
625
- * Test cookie collection getter and setter,
625
+ * Test cookieJar config option.
626
626
*
627
627
* @return void
628
628
*/
629
- public function testCookies ()
629
+ public function testCookieJar ()
630
630
{
631
631
$ jar = new CookieCollection ();
632
632
$ http = new Client ([
633
633
'cookieJar ' => $ jar
634
634
]);
635
635
636
- $ this ->assertSame ($ jar , $ http ->getCookies ());
637
-
638
- $ cookies = new CookieCollection ();
639
- $ http ->setCookies ($ cookies );
640
- $ this ->assertSame ($ cookies , $ http ->getCookies ());
636
+ $ this ->assertSame ($ jar , $ http ->cookies ());
641
637
}
642
638
643
639
/**
You can’t perform that action at this time.
0 commit comments