File tree 2 files changed +20
-9
lines changed
2 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,26 @@ public function testCurlKAErr()
98
98
is_object ($ ro ) && $ this ->assertEquals ('hello ' , $ ro ->scalarVal ());
99
99
}
100
100
101
+ public function testCustomHeaders ()
102
+ {
103
+ $ opts = array (\PhpXmlRpc \Client::USE_CURL_NEVER );
104
+ if (function_exists ('curl_init ' ))
105
+ {
106
+ $ opts [] = \PhpXmlRpc \Client::USE_CURL_ALWAYS ;
107
+ }
108
+
109
+ $ this ->client ->setOption (\PhpXmlRpc \Client::OPT_EXTRA_HEADERS , array ('X-PXR-Test: yes ' ));
110
+ $ r = new \PhpXmlRpc \Request ('tests.getallheaders ' );
111
+
112
+ foreach ($ opts as $ opt ) {
113
+ $ this ->client ->setOption (\PhpXmlRpc \Client::OPT_USE_CURL , $ opt );
114
+ $ r = $ this ->client ->send ($ r );
115
+ $ this ->assertEquals (0 , $ r ->faultCode ());
116
+ $ ro = $ r ->value ();
117
+ $ this ->assertArrayHasKey ('X-Pxr-Test ' , $ ro ->scalarVal (), "Testing with curl mode: $ opt " );
118
+ }
119
+ }
120
+
101
121
public function testgetUrl ()
102
122
{
103
123
$ m = $ this ->client ->getUrl (PHP_URL_SCHEME );
Original file line number Diff line number Diff line change @@ -530,15 +530,6 @@ public function testDigestAuth($method)
530
530
$ this ->$ method ();
531
531
}
532
532
533
- public function testCustomHeaders ()
534
- {
535
- $ this ->client ->setOption (\PhpXmlRpc \Client::OPT_EXTRA_HEADERS , array ('X-PXR-Test: yes ' ));
536
-
537
- $ r = new \PhpXmlRpc \Request ('tests.getallheaders ' );
538
- $ v = $ this ->send ($ r );
539
- $ this ->assertArrayHasKey ('X-Pxr-Test ' , $ v );
540
- }
541
-
542
533
/**
543
534
* @param \PhpXmlRpc\Response $r
544
535
* @return void
You can’t perform that action at this time.
0 commit comments