File tree Expand file tree Collapse file tree 4 files changed +42
-35
lines changed
lib/internal/Magento/Framework/HTTP Expand file tree Collapse file tree 4 files changed +42
-35
lines changed Original file line number Diff line number Diff line change @@ -454,9 +454,6 @@ protected function parseHeaders($ch, $data)
454454
455455 if (strlen ($ name )) {
456456 if ('set-cookie ' === strtolower ($ name )) {
457- if (!isset ($ this ->_responseHeaders ['Set-Cookie ' ])) {
458- $ this ->_responseHeaders ['Set-Cookie ' ] = [];
459- }
460457 $ this ->_responseHeaders ['Set-Cookie ' ][] = $ value ;
461458 } else {
462459 $ this ->_responseHeaders [$ name ] = $ value ;
Original file line number Diff line number Diff line change 88
99namespace Magento \Framework \HTTP \Test \Unit \Client ;
1010
11- use Magento \Framework \HTTP \Client \CurlMock ;
11+ use Magento \Framework \HTTP \Test \ Unit \ Client \ Mock \CurlMock ;
1212use PHPUnit \Framework \TestCase ;
1313
1414/**
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magento, Inc. All rights reserved.
4+ * See COPYING.txt for license details.
5+ */
6+ declare (strict_types=1 );
7+
8+ namespace Magento \Framework \HTTP \Test \Unit \Client \Mock ;
9+
10+ use Magento \Framework \HTTP \Client \Curl ;
11+
12+ /**
13+ * Extended Curl class with modifications for testing
14+ */
15+ class CurlMock extends Curl
16+ {
17+ // @codingStandardsIgnoreStart
18+ /**
19+ * Unfortunately, it is necessary for the tests to set this function public.
20+ *
21+ * @param resource $ch curl handle, not needed
22+ * @param string $data
23+ * @return int
24+ * @throws \Exception
25+ */
26+ public function parseHeaders ($ ch , $ data )
27+ {
28+ return parent ::parseHeaders ($ ch , $ data );
29+ }
30+ // @codingStandardsIgnoreEnd
31+
32+ /**
33+ * Return Curl resource, only used for testing.
34+ *
35+ * @return resource
36+ */
37+ public function getResource ()
38+ {
39+ return $ this ->_ch ;
40+ }
41+ }
Original file line number Diff line number Diff line change @@ -20,34 +20,3 @@ function curl_exec($resource)
2020{
2121 return call_user_func (CurlMockTest::$ curlExectClosure );
2222}
23-
24- /**
25- * Extended Curl class with modifications for testing
26- */
27- class CurlMock extends Curl
28- {
29- // @codingStandardsIgnoreStart
30- /**
31- * Unfortunately, it is necessary for the tests to set this function public.
32- *
33- * @param resource $ch curl handle, not needed
34- * @param string $data
35- * @return int
36- * @throws \Exception
37- */
38- public function parseHeaders ($ ch , $ data )
39- {
40- return parent ::parseHeaders ($ ch , $ data );
41- }
42- // @codingStandardsIgnoreEnd
43-
44- /**
45- * Return Curl resource, only used for testing.
46- *
47- * @return resource
48- */
49- public function getResource ()
50- {
51- return $ this ->_ch ;
52- }
53- }
You can’t perform that action at this time.
0 commit comments