server.accept-destruct.json 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. [
  2. {
  3. "function": "stream_socket_accept",
  4. "params": [
  5. "@mock-socket"
  6. ],
  7. "return": "@mock-stream"
  8. },
  9. {
  10. "function": "stream_get_line",
  11. "params": [
  12. "@mock-stream",
  13. 1024,
  14. "\r\n"
  15. ],
  16. "return": "GET \/my\/mock\/path HTTP\/1.1"
  17. },
  18. {
  19. "function": "stream_get_meta_data",
  20. "params": [
  21. "@mock-stream"
  22. ],
  23. "return": {
  24. "timed_out": false,
  25. "blocked": true,
  26. "eof": false,
  27. "stream_type": "tcp_socket\/ssl",
  28. "mode": "r+",
  29. "unread_bytes": 171,
  30. "seekable": false
  31. }
  32. },
  33. {
  34. "function": "feof",
  35. "params": [
  36. "@mock-stream"
  37. ],
  38. "return": false
  39. },
  40. {
  41. "function": "stream_get_line",
  42. "params": [
  43. "@mock-stream",
  44. 1024,
  45. "\r\n"
  46. ],
  47. "return": "host: localhost:8000"
  48. },
  49. {
  50. "function": "stream_get_meta_data",
  51. "params": [
  52. "@mock-stream"
  53. ],
  54. "return": {
  55. "timed_out": false,
  56. "blocked": true,
  57. "eof": false,
  58. "stream_type": "tcp_socket\/ssl",
  59. "mode": "r+",
  60. "unread_bytes": 149,
  61. "seekable": false
  62. }
  63. },
  64. {
  65. "function": "feof",
  66. "params": [
  67. "@mock-stream"
  68. ],
  69. "return": false
  70. },
  71. {
  72. "function": "stream_get_line",
  73. "params": [
  74. "@mock-stream",
  75. 1024,
  76. "\r\n"
  77. ],
  78. "return": "user-agent: websocket-client-php"
  79. },
  80. {
  81. "function": "stream_get_meta_data",
  82. "params": [
  83. "@mock-stream"
  84. ],
  85. "return": {
  86. "timed_out": false,
  87. "blocked": true,
  88. "eof": false,
  89. "stream_type": "tcp_socket\/ssl",
  90. "mode": "r+",
  91. "unread_bytes": 115,
  92. "seekable": false
  93. }
  94. },
  95. {
  96. "function": "feof",
  97. "params": [
  98. "@mock-stream"
  99. ],
  100. "return": false
  101. },
  102. {
  103. "function": "stream_get_line",
  104. "params": [
  105. "@mock-stream",
  106. 1024,
  107. "\r\n"
  108. ],
  109. "return": "connection: Upgrade"
  110. },
  111. {
  112. "function": "stream_get_meta_data",
  113. "params": [
  114. "@mock-stream"
  115. ],
  116. "return": {
  117. "timed_out": false,
  118. "blocked": true,
  119. "eof": false,
  120. "stream_type": "tcp_socket\/ssl",
  121. "mode": "r+",
  122. "unread_bytes": 94,
  123. "seekable": false
  124. }
  125. },
  126. {
  127. "function": "feof",
  128. "params": [
  129. "@mock-stream"
  130. ],
  131. "return": false
  132. },
  133. {
  134. "function": "stream_get_line",
  135. "params": [
  136. "@mock-stream",
  137. 1024,
  138. "\r\n"
  139. ],
  140. "return": "upgrade: websocket"
  141. },
  142. {
  143. "function": "stream_get_meta_data",
  144. "params": [
  145. "@mock-stream"
  146. ],
  147. "return": {
  148. "timed_out": false,
  149. "blocked": true,
  150. "eof": false,
  151. "stream_type": "tcp_socket\/ssl",
  152. "mode": "r+",
  153. "unread_bytes": 74,
  154. "seekable": false
  155. }
  156. },
  157. {
  158. "function": "feof",
  159. "params": [
  160. "@mock-stream"
  161. ],
  162. "return": false
  163. },
  164. {
  165. "function": "stream_get_line",
  166. "params": [
  167. "@mock-stream",
  168. 1024,
  169. "\r\n"
  170. ],
  171. "return": "sec-websocket-key: cktLWXhUdDQ2OXF0ZCFqOQ=="
  172. },
  173. {
  174. "function": "stream_get_meta_data",
  175. "params": [
  176. "@mock-stream"
  177. ],
  178. "return": {
  179. "timed_out": false,
  180. "blocked": true,
  181. "eof": false,
  182. "stream_type": "tcp_socket\/ssl",
  183. "mode": "r+",
  184. "unread_bytes": 29,
  185. "seekable": false
  186. }
  187. },
  188. {
  189. "function": "feof",
  190. "params": [
  191. "@mock-stream"
  192. ],
  193. "return": false
  194. },
  195. {
  196. "function": "stream_get_line",
  197. "params": [
  198. "@mock-stream",
  199. 1024,
  200. "\r\n"
  201. ],
  202. "return": "sec-websocket-version: 13"
  203. },
  204. {
  205. "function": "stream_get_meta_data",
  206. "params": [
  207. "@mock-stream"
  208. ],
  209. "return": {
  210. "timed_out": false,
  211. "blocked": true,
  212. "eof": false,
  213. "stream_type": "tcp_socket\/ssl",
  214. "mode": "r+",
  215. "unread_bytes": 2,
  216. "seekable": false
  217. }
  218. },
  219. {
  220. "function": "feof",
  221. "params": [
  222. "@mock-stream"
  223. ],
  224. "return": false
  225. }
  226. ,
  227. {
  228. "function": "stream_get_line",
  229. "params": [
  230. "@mock-stream",
  231. 1024,
  232. "\r\n"
  233. ],
  234. "return": ""
  235. },
  236. {
  237. "function": "stream_get_meta_data",
  238. "params": [
  239. "@mock-stream"
  240. ],
  241. "return": {
  242. "timed_out": false,
  243. "blocked": true,
  244. "eof": false,
  245. "stream_type": "tcp_socket\/ssl",
  246. "mode": "r+",
  247. "unread_bytes": 0,
  248. "seekable": false
  249. }
  250. },
  251. {
  252. "function": "feof",
  253. "params": [
  254. "@mock-stream"
  255. ],
  256. "return": false
  257. },
  258. {
  259. "function": "fwrite",
  260. "params": [
  261. "@mock-stream",
  262. "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: YmysboNHNoWzWVeQpduY7xELjgU=\r\n\r\n"
  263. ],
  264. "return": 129
  265. },
  266. {
  267. "function": "fread",
  268. "params": [
  269. "@mock-stream",
  270. 2
  271. ],
  272. "return-op": "chr-array",
  273. "return": [129, 147]
  274. },
  275. {
  276. "function": "fread",
  277. "params": [
  278. "@mock-stream",
  279. 4
  280. ],
  281. "return-op": "chr-array",
  282. "return": [33, 111, 149, 174]
  283. },
  284. {
  285. "function": "fread",
  286. "params": [
  287. "@mock-stream",
  288. 19
  289. ],
  290. "return-op": "chr-array",
  291. "return": [115, 10, 246, 203, 72, 25, 252, 192, 70, 79, 244, 142, 76, 10, 230, 221, 64, 8, 240]
  292. },
  293. {
  294. "function": "get_resource_type",
  295. "params": [
  296. "@mock-stream"
  297. ],
  298. "return": "stream"
  299. },
  300. {
  301. "function": "fclose",
  302. "params": [
  303. "@mock-stream"
  304. ],
  305. "return": true
  306. }
  307. ]