@@ -101,6 +101,38 @@ public function testWssCall() {
101
101
$ this ->assertEquals (22222 , $ result ['uid ' ]);
102
102
}
103
103
104
+ public function testHttpCallWithHeaders () {
105
+ $ path = 'http://shop.textalk.se/backend/jsonrpc/v1 ' ;
106
+ $ options = array ('headers ' => array ('foo ' => 'bar ' , 'boo ' => 'far ' ));
107
+ $ connection = new Connection (array (), $ path , $ options );
108
+ $ result = $ connection ->call ('Webshop.get ' , array (22222 , 'uid ' ));
109
+ $ this ->assertEquals (22222 , $ result ['uid ' ]);
110
+ }
111
+
112
+ public function testHttpsCallWithHeaders () {
113
+ $ path = 'https://shop.textalk.se/backend/jsonrpc/v1 ' ;
114
+ $ options = array ('headers ' => array ('foo ' => 'bar ' , 'boo ' => 'far ' ));
115
+ $ connection = new Connection (array (), $ path , $ options );
116
+ $ result = $ connection ->call ('Webshop.get ' , array (22222 , 'uid ' ));
117
+ $ this ->assertEquals (22222 , $ result ['uid ' ]);
118
+ }
119
+
120
+ public function testWsCallWithHeaders () {
121
+ $ path = 'ws://shop.textalk.se/backend/jsonrpc/v1 ' ;
122
+ $ options = array ('headers ' => array ('foo ' => 'bar ' , 'boo ' => 'far ' ));
123
+ $ connection = new Connection (array (), $ path , $ options );
124
+ $ result = $ connection ->call ('Webshop.get ' , array (22222 , 'uid ' ));
125
+ $ this ->assertEquals (22222 , $ result ['uid ' ]);
126
+ }
127
+
128
+ public function testWssCallWithHeaders () {
129
+ $ path = 'wss://shop.textalk.se/backend/jsonrpc/v1 ' ;
130
+ $ options = array ('headers ' => array ('foo ' => 'bar ' , 'boo ' => 'far ' ));
131
+ $ connection = new Connection (array (), $ path , $ options );
132
+ $ result = $ connection ->call ('Webshop.get ' , array (22222 , 'uid ' ));
133
+ $ this ->assertEquals (22222 , $ result ['uid ' ]);
134
+ }
135
+
104
136
/**
105
137
* @expectedException RuntimeException
106
138
*/
0 commit comments