File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
lib/Cake/Test/Case/Network/Http Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 19
19
App::uses ('HttpSocket ' , 'Network/Http ' );
20
20
App::uses ('BasicAuthentication ' , 'Network/Http ' );
21
21
22
+ /**
23
+ * class TestHttpSocket
24
+ *
25
+ * @package Cake.Test.Case.Network.Http
26
+ */
27
+ class TestHttpSocket extends HttpSocket {
28
+
29
+ /**
30
+ * testSetProxy method
31
+ *
32
+ * @return void
33
+ */
34
+ public function testSetProxy ($ proxy = null ) {
35
+ $ this ->_proxy =$ proxy ;
36
+ $ this ->_setProxy ();
37
+ }
38
+ }
39
+
22
40
/**
23
41
* BasicMethodTest class
24
42
*
@@ -60,4 +78,26 @@ public function testProxyAuthentication() {
60
78
$ this ->assertEquals ('Basic bWFyazpzZWNyZXQ= ' , $ http ->request ['header ' ]['Proxy-Authorization ' ]);
61
79
}
62
80
81
+ /**
82
+ * testProxyAuthenticationSsl method
83
+ *
84
+ * @return void
85
+ */
86
+ public function testProxyAuthenticationSsl () {
87
+ $ http = new TestHttpSocket ();
88
+ $ http ->request ['uri ' ]['scheme ' ] = 'https ' ;
89
+ $ proxy = array (
90
+ 'host ' => 'localhost ' ,
91
+ 'port ' => 3128 ,
92
+ 'method ' => 'Basic ' ,
93
+ 'user ' => 'mark ' ,
94
+ 'pass ' => 'secret '
95
+ );
96
+
97
+ $ http ->testSetProxy ($ proxy );
98
+
99
+ $ this ->assertEquals ('Basic bWFyazpzZWNyZXQ= ' , $ http ->config ['proxyauth ' ]);
100
+ $ this ->assertFalse (isset ($ http ->request ['header ' ]['Proxy-Authorization ' ]));
101
+ }
102
+
63
103
}
You can’t perform that action at this time.
0 commit comments