summaryrefslogtreecommitdiffstats
path: root/vendor/textalk/websocket/tests/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:45:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:45:49 +0000
commit0ff39c83d38ce538a9f5dba53eca0fa9cb16d9e6 (patch)
tree84c735df2e97350a721273e9dd425729d43cc8a2 /vendor/textalk/websocket/tests/scripts
parentInitial commit. (diff)
downloadicingaweb2-module-pdfexport-0ff39c83d38ce538a9f5dba53eca0fa9cb16d9e6.tar.xz
icingaweb2-module-pdfexport-0ff39c83d38ce538a9f5dba53eca0fa9cb16d9e6.zip
Adding upstream version 0.10.2+dfsg1.upstream/0.10.2+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/textalk/websocket/tests/scripts')
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.close.json76
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-authed.json59
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-bad-context.json7
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-context.json59
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-error.json23
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-extended.json59
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-failed.json19
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-headers.json59
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-invalid-key.json50
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-invalid-upgrade.json50
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-persistent.json95
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect-timeout.json59
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.connect.json59
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.destruct.json23
-rw-r--r--vendor/textalk/websocket/tests/scripts/client.reconnect.json100
-rw-r--r--vendor/textalk/websocket/tests/scripts/close-remote.json55
-rw-r--r--vendor/textalk/websocket/tests/scripts/config-timeout.json24
-rw-r--r--vendor/textalk/websocket/tests/scripts/ping-pong.json150
-rw-r--r--vendor/textalk/websocket/tests/scripts/receive-bad-opcode.json18
-rw-r--r--vendor/textalk/websocket/tests/scripts/receive-broken-read.json58
-rw-r--r--vendor/textalk/websocket/tests/scripts/receive-client-timeout.json50
-rw-r--r--vendor/textalk/websocket/tests/scripts/receive-empty-read.json58
-rw-r--r--vendor/textalk/websocket/tests/scripts/receive-fragmentation.json126
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-bad-opcode.json9
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-broken-write.json43
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-convenicance.json86
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-failed-write.json43
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-receive-128.json50
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-receive-65536.json113
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-receive-multi-fragment.json112
-rw-r--r--vendor/textalk/websocket/tests/scripts/send-receive.json50
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.accept-destruct.json315
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.accept-error-connect.json18
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.accept-failed-connect.json14
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.accept-failed-http.json265
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.accept-failed-ws-key.json265
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.accept-timeout.json289
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.accept.json287
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.close.json70
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.construct-error-socket-server.json28
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.construct-failed-socket-server.json20
-rw-r--r--vendor/textalk/websocket/tests/scripts/server.construct.json11
42 files changed, 3424 insertions, 0 deletions
diff --git a/vendor/textalk/websocket/tests/scripts/client.close.json b/vendor/textalk/websocket/tests/scripts/client.close.json
new file mode 100644
index 0000000..d449c17
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.close.json
@@ -0,0 +1,76 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [],
+ "return": 12
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return":[136, 154]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return":[98, 250, 210, 113]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 26
+ ],
+ "return-op": "chr-array",
+ "return": [97, 18, 145, 29, 13, 137, 183, 81, 3, 153, 185, 31, 13, 141, 190, 20, 6, 157, 183, 21, 88, 218, 227, 65, 82, 202]
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return":true
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "Unknown"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-authed.json b/vendor/textalk/websocket/tests/scripts/client.connect-authed.json
new file mode 100644
index 0000000..6f75b6b
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-authed.json
@@ -0,0 +1,59 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "ssl:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 248
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-bad-context.json b/vendor/textalk/websocket/tests/scripts/client.connect-bad-context.json
new file mode 100644
index 0000000..e084a84
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-bad-context.json
@@ -0,0 +1,7 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [],
+ "return": "@mock-bad-context"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-context.json b/vendor/textalk/websocket/tests/scripts/client.connect-context.json
new file mode 100644
index 0000000..0fcc279
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-context.json
@@ -0,0 +1,59 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [],
+ "return": "stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 199
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-error.json b/vendor/textalk/websocket/tests/scripts/client.connect-error.json
new file mode 100644
index 0000000..e6c523d
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-error.json
@@ -0,0 +1,23 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "error": {
+ "msg": "A PHP error",
+ "type": 512
+ },
+ "return": false
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-extended.json b/vendor/textalk/websocket/tests/scripts/client.connect-extended.json
new file mode 100644
index 0000000..4659e3e
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-extended.json
@@ -0,0 +1,59 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 224
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-failed.json b/vendor/textalk/websocket/tests/scripts/client.connect-failed.json
new file mode 100644
index 0000000..47725c2
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-failed.json
@@ -0,0 +1,19 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": false
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-headers.json b/vendor/textalk/websocket/tests/scripts/client.connect-headers.json
new file mode 100644
index 0000000..69808ce
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-headers.json
@@ -0,0 +1,59 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 255
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-invalid-key.json b/vendor/textalk/websocket/tests/scripts/client.connect-invalid-key.json
new file mode 100644
index 0000000..6472317
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-invalid-key.json
@@ -0,0 +1,50 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 199
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: BAD"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-invalid-upgrade.json b/vendor/textalk/websocket/tests/scripts/client.connect-invalid-upgrade.json
new file mode 100644
index 0000000..28cbc7e
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-invalid-upgrade.json
@@ -0,0 +1,50 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 199
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return": "Invalid upgrade response"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-persistent.json b/vendor/textalk/websocket/tests/scripts/client.connect-persistent.json
new file mode 100644
index 0000000..d95af01
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-persistent.json
@@ -0,0 +1,95 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 5,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "persistent stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "persistent stream"
+ },
+ {
+ "function": "ftell",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 0
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 248
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "persistent stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "persistent stream"
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return":true
+ }
+]
+
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect-timeout.json b/vendor/textalk/websocket/tests/scripts/client.connect-timeout.json
new file mode 100644
index 0000000..c1ae6b5
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect-timeout.json
@@ -0,0 +1,59 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 300,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 300
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 199
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.connect.json b/vendor/textalk/websocket/tests/scripts/client.connect.json
new file mode 100644
index 0000000..eb7ecd2
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.connect.json
@@ -0,0 +1,59 @@
+[
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 199
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.destruct.json b/vendor/textalk/websocket/tests/scripts/client.destruct.json
new file mode 100644
index 0000000..c04755b
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.destruct.json
@@ -0,0 +1,23 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": true
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/client.reconnect.json b/vendor/textalk/websocket/tests/scripts/client.reconnect.json
new file mode 100644
index 0000000..9d505fe
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/client.reconnect.json
@@ -0,0 +1,100 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "Unknown"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_context_create",
+ "params": [],
+ "return": "@mock-stream-context"
+ },
+ {
+ "function": "stream_socket_client",
+ "params": [
+ "tcp:\/\/localhost:8000",
+ null,
+ null,
+ 5,
+ 4,
+ "@mock-stream-context"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 5
+ ],
+ "return": true
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return-op": "key-save",
+ "return": 199
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n\r\n"
+ ],
+ "return-op": "key-respond",
+ "return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [129, 147]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [33, 111, 149, 174]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 19
+ ],
+ "return-op": "chr-array",
+ "return": [115, 10, 246, 203, 72, 25, 252, 192, 70, 79, 244, 142, 76, 10, 230, 221, 64, 8, 240]
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/close-remote.json b/vendor/textalk/websocket/tests/scripts/close-remote.json
new file mode 100644
index 0000000..d2eea02
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/close-remote.json
@@ -0,0 +1,55 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [136, 137]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [54, 79, 233, 244]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 9
+ ],
+ "return-op": "chr-array",
+ "return": [117, 35, 170, 152, 89, 60, 128, 154, 81]
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [],
+ "return": 33
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": true
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/config-timeout.json b/vendor/textalk/websocket/tests/scripts/config-timeout.json
new file mode 100644
index 0000000..243ae22
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/config-timeout.json
@@ -0,0 +1,24 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 300
+ ],
+ "return": true
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/ping-pong.json b/vendor/textalk/websocket/tests/scripts/ping-pong.json
new file mode 100644
index 0000000..b647e91
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/ping-pong.json
@@ -0,0 +1,150 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 17
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 6
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [138, 139]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [1, 1, 1, 1]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 11
+ ],
+ "return-op": "chr-array",
+ "return": [82, 100, 115, 119, 100, 115, 33, 113, 104, 111, 102]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [138, 128]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [1, 1, 1, 1]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [137, 139]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [180, 77, 192, 201]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 11
+ ],
+ "return-op": "chr-array",
+ "return": [247, 33, 169, 172, 218, 57, 224, 185, 221, 35, 167]
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 17
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [129, 147]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [33, 111, 149, 174]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 19
+ ],
+ "return-op": "chr-array",
+ "return": [115, 10, 246, 203, 72, 25, 252, 192, 70, 79, 244, 142, 76, 10, 230, 221, 64, 8, 240]
+ }
+]
diff --git a/vendor/textalk/websocket/tests/scripts/receive-bad-opcode.json b/vendor/textalk/websocket/tests/scripts/receive-bad-opcode.json
new file mode 100644
index 0000000..27dd2ba
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/receive-bad-opcode.json
@@ -0,0 +1,18 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [140, 115]
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/receive-broken-read.json b/vendor/textalk/websocket/tests/scripts/receive-broken-read.json
new file mode 100644
index 0000000..15e3fa9
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/receive-broken-read.json
@@ -0,0 +1,58 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [],
+ "return": false
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": true,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": true,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return":true
+ }
+]
diff --git a/vendor/textalk/websocket/tests/scripts/receive-client-timeout.json b/vendor/textalk/websocket/tests/scripts/receive-client-timeout.json
new file mode 100644
index 0000000..5a258b0
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/receive-client-timeout.json
@@ -0,0 +1,50 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [],
+ "return": false
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": true,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 0,
+ "seekable": false
+ }
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return":true
+ }
+]
diff --git a/vendor/textalk/websocket/tests/scripts/receive-empty-read.json b/vendor/textalk/websocket/tests/scripts/receive-empty-read.json
new file mode 100644
index 0000000..f752017
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/receive-empty-read.json
@@ -0,0 +1,58 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [],
+ "return": ""
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 0,
+ "seekable": false
+ }
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": true,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return":true
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/receive-fragmentation.json b/vendor/textalk/websocket/tests/scripts/receive-fragmentation.json
new file mode 100644
index 0000000..5ae9572
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/receive-fragmentation.json
@@ -0,0 +1,126 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [1, 136]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [105, 29, 187, 18]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 8
+ ],
+ "return-op": "chr-array",
+ "return": [36, 104, 215, 102, 0, 61, 221, 96]
+ },
+
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [138, 139]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [1, 1, 1, 1]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 11
+ ],
+ "return-op": "chr-array",
+ "return": [82, 100, 115, 119, 100, 115, 33, 113, 104, 111, 102]
+ },
+
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [0, 136]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [221, 240, 46, 69]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 8
+ ],
+ "return-op": "chr-array",
+ "return": [188, 151, 67, 32, 179, 132, 14, 49]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [128, 131]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [9, 60, 117, 193]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 3
+ ],
+ "return-op": "chr-array",
+ "return": [108, 79, 1]
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/send-bad-opcode.json b/vendor/textalk/websocket/tests/scripts/send-bad-opcode.json
new file mode 100644
index 0000000..c0859d1
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-bad-opcode.json
@@ -0,0 +1,9 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/send-broken-write.json b/vendor/textalk/websocket/tests/scripts/send-broken-write.json
new file mode 100644
index 0000000..838c826
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-broken-write.json
@@ -0,0 +1,43 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 18
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": true,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "fclose",
+ "params": [],
+ "return": true
+ }
+]
diff --git a/vendor/textalk/websocket/tests/scripts/send-convenicance.json b/vendor/textalk/websocket/tests/scripts/send-convenicance.json
new file mode 100644
index 0000000..194cb5a
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-convenicance.json
@@ -0,0 +1,86 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 26
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 6
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 6
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:12345"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:8000"
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:12345"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/send-failed-write.json b/vendor/textalk/websocket/tests/scripts/send-failed-write.json
new file mode 100644
index 0000000..ea3d46b
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-failed-write.json
@@ -0,0 +1,43 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": true,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "fclose",
+ "params": [],
+ "return": true
+ }
+]
diff --git a/vendor/textalk/websocket/tests/scripts/send-receive-128.json b/vendor/textalk/websocket/tests/scripts/send-receive-128.json
new file mode 100644
index 0000000..66abea7
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-receive-128.json
@@ -0,0 +1,50 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 132
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [129, 126]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [0, 128]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 128
+ ],
+ "return-op": "file",
+ "return": ["payload.128.txt", 0, 132]
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/send-receive-65536.json b/vendor/textalk/websocket/tests/scripts/send-receive-65536.json
new file mode 100644
index 0000000..67604b5
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-receive-65536.json
@@ -0,0 +1,113 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 65546
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [129, 127]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 8
+ ],
+ "return-op": "chr-array",
+ "return": [0, 0, 0, 0, 0, 1, 0, 0]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 65536
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 0, 16374]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 49162
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 16374, 8192]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 40970
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 24566, 8192]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 32778
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 32758, 8192]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 24586
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 40950, 8192]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 16394
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 49142, 8192]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 8202
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 57334, 8192]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 10
+ ],
+ "return-op": "file",
+ "return": ["payload.65536.txt", 65526, 10]
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/send-receive-multi-fragment.json b/vendor/textalk/websocket/tests/scripts/send-receive-multi-fragment.json
new file mode 100644
index 0000000..426434e
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-receive-multi-fragment.json
@@ -0,0 +1,112 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [],
+ "return": 14
+ },
+ {
+ "function": "fwrite",
+ "params": [],
+ "return": 14
+ },
+ {
+ "function": "fwrite",
+ "params": [],
+ "return": 9
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [1, 136]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [105, 29, 187, 18]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 8
+ ],
+ "return-op": "chr-array",
+ "return": [36, 104, 215, 102, 0, 61, 221, 96]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [0, 136]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [221, 240, 46, 69]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 8
+ ],
+ "return-op": "chr-array",
+ "return": [188, 151, 67, 32, 179, 132, 14, 49]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [128, 131]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [9, 60, 117, 193]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 3
+ ],
+ "return-op": "chr-array",
+ "return": [108, 79, 1]
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/send-receive.json b/vendor/textalk/websocket/tests/scripts/send-receive.json
new file mode 100644
index 0000000..7ad0350
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/send-receive.json
@@ -0,0 +1,50 @@
+[
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 23
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [129, 147]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [33, 111, 149, 174]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 19
+ ],
+ "return-op": "chr-array",
+ "return": [115, 10, 246, 203, 72, 25, 252, 192, 70, 79, 244, 142, 76, 10, 230, 221, 64, 8, 240]
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.accept-destruct.json b/vendor/textalk/websocket/tests/scripts/server.accept-destruct.json
new file mode 100644
index 0000000..970286b
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.accept-destruct.json
@@ -0,0 +1,315 @@
+[
+ {
+ "function": "stream_socket_accept",
+ "params": [
+ "@mock-socket"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:12345"
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "GET \/my\/mock\/path HTTP\/1.1"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 171,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "host: localhost:8000"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 149,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "user-agent: websocket-client-php"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 115,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "connection: Upgrade"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 94,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "upgrade: websocket"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 74,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-key: cktLWXhUdDQ2OXF0ZCFqOQ=="
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 29,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-version: 13"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ }
+ ,
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": ""
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 0,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream",
+ "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: YmysboNHNoWzWVeQpduY7xELjgU=\r\n\r\n"
+ ],
+ "return": 129
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [129, 147]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [33, 111, 149, 174]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 19
+ ],
+ "return-op": "chr-array",
+ "return": [115, 10, 246, 203, 72, 25, 252, 192, 70, 79, 244, 142, 76, 10, 230, 221, 64, 8, 240]
+ },
+
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": true
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.accept-error-connect.json b/vendor/textalk/websocket/tests/scripts/server.accept-error-connect.json
new file mode 100644
index 0000000..f0fef27
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.accept-error-connect.json
@@ -0,0 +1,18 @@
+[
+ {
+ "function": "stream_socket_accept",
+ "params": [],
+ "error": {
+ "msg": "A PHP error",
+ "type": 512
+ },
+ "return": false
+ },
+ {
+ "function": "fclose",
+ "params": [
+ false
+ ],
+ "return": true
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.accept-failed-connect.json b/vendor/textalk/websocket/tests/scripts/server.accept-failed-connect.json
new file mode 100644
index 0000000..24692db
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.accept-failed-connect.json
@@ -0,0 +1,14 @@
+[
+ {
+ "function": "stream_socket_accept",
+ "params": [],
+ "return": false
+ },
+ {
+ "function": "fclose",
+ "params": [
+ false
+ ],
+ "return": true
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.accept-failed-http.json b/vendor/textalk/websocket/tests/scripts/server.accept-failed-http.json
new file mode 100644
index 0000000..ab66db4
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.accept-failed-http.json
@@ -0,0 +1,265 @@
+[
+ {
+ "function": "stream_socket_accept",
+ "params": [
+ "@mock-socket"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:12345"
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "missing http header"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 171,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "host: localhost:8000"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 149,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "user-agent: websocket-client-php"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 115,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "connection: Upgrade"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 94,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "upgrade: websocket"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 74,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "no key in upgrade request"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 29,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-version: 13"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ }
+ ,
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": ""
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 0,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.accept-failed-ws-key.json b/vendor/textalk/websocket/tests/scripts/server.accept-failed-ws-key.json
new file mode 100644
index 0000000..06bf4e6
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.accept-failed-ws-key.json
@@ -0,0 +1,265 @@
+[
+ {
+ "function": "stream_socket_accept",
+ "params": [
+ "@mock-socket"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:12345"
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "GET \/my\/mock\/path HTTP\/1.1"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 171,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "host: localhost:8000"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 149,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "user-agent: websocket-client-php"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 115,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "connection: Upgrade"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 94,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "upgrade: websocket"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 74,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "no key in upgrade request"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 29,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-version: 13"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ }
+ ,
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": ""
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 0,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.accept-timeout.json b/vendor/textalk/websocket/tests/scripts/server.accept-timeout.json
new file mode 100644
index 0000000..17a5660
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.accept-timeout.json
@@ -0,0 +1,289 @@
+[
+ {
+ "function": "stream_socket_accept",
+ "params": [
+ "@mock-socket",
+ 300
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "stream_set_timeout",
+ "params": [
+ "@mock-stream",
+ 300
+ ],
+ "return": true
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:12345"
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "GET \/my\/mock\/path HTTP\/1.1"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 171,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "host: localhost:8000"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 149,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "user-agent: websocket-client-php"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 115,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "connection: Upgrade"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 94,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "upgrade: websocket"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 74,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-key: cktLWXhUdDQ2OXF0ZCFqOQ=="
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 29,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-version: 13"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ }
+ ,
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": ""
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 0,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream",
+ "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: YmysboNHNoWzWVeQpduY7xELjgU=\r\n\r\n"
+ ],
+ "return": 129
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.accept.json b/vendor/textalk/websocket/tests/scripts/server.accept.json
new file mode 100644
index 0000000..a1463dc
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.accept.json
@@ -0,0 +1,287 @@
+[
+ {
+ "function": "stream_socket_accept",
+ "params": [
+ "@mock-socket"
+ ],
+ "return": "@mock-stream"
+ },
+ {
+ "function": "stream_socket_get_name",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "127.0.0.1:12345"
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "GET \/my\/mock\/path HTTP\/1.1"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 171,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "host: localhost:8000"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 149,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "user-agent: websocket-client-php"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 115,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "connection: Upgrade"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 94,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "upgrade: websocket"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 74,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-key: cktLWXhUdDQ2OXF0ZCFqOQ=="
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 29,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": "sec-websocket-version: 13"
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 2,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ }
+ ,
+ {
+ "function": "stream_get_line",
+ "params": [
+ "@mock-stream",
+ 1024,
+ "\r\n"
+ ],
+ "return": ""
+ },
+ {
+ "function": "stream_get_meta_data",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": {
+ "timed_out": false,
+ "blocked": true,
+ "eof": false,
+ "stream_type": "tcp_socket\/ssl",
+ "mode": "r+",
+ "unread_bytes": 0,
+ "seekable": false
+ }
+ },
+ {
+ "function": "feof",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": false
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream",
+ "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: YmysboNHNoWzWVeQpduY7xELjgU=\r\n\r\n"
+ ],
+ "return": 129
+ },
+ {
+ "function": "fwrite",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": 13
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.close.json b/vendor/textalk/websocket/tests/scripts/server.close.json
new file mode 100644
index 0000000..b6e045c
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.close.json
@@ -0,0 +1,70 @@
+[
+
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": true
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fwrite",
+ "params": [],
+ "return":12
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "stream"
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 2
+ ],
+ "return-op": "chr-array",
+ "return": [136,154]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 4
+ ],
+ "return-op": "chr-array",
+ "return": [245,55,62,8]
+ },
+ {
+ "function": "fread",
+ "params": [
+ "@mock-stream",
+ 26
+ ],
+ "return-op": "chr-array",
+ "return": [246,223,125,100,154,68,91,40,148,84,85,102,154,64,82,109,145,80,91,108,207,23,15,56,197,7]
+ },
+ {
+ "function": "fclose",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": true
+ },
+ {
+ "function": "get_resource_type",
+ "params": [
+ "@mock-stream"
+ ],
+ "return": "Unknown"
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.construct-error-socket-server.json b/vendor/textalk/websocket/tests/scripts/server.construct-error-socket-server.json
new file mode 100644
index 0000000..3f4909f
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.construct-error-socket-server.json
@@ -0,0 +1,28 @@
+[
+ {
+ "function": "stream_socket_server",
+ "params": [
+ "tcp://0.0.0.0:9999",
+ null,
+ null
+ ],
+ "error": {
+ "msg": "A PHP error",
+ "type": 512
+ },
+ "return": false
+ },
+ {
+ "function": "stream_socket_server",
+ "params": [
+ "tcp://0.0.0.0:10000",
+ null,
+ null
+ ],
+ "error": {
+ "msg": "A PHP error",
+ "type": 512
+ },
+ "return": false
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.construct-failed-socket-server.json b/vendor/textalk/websocket/tests/scripts/server.construct-failed-socket-server.json
new file mode 100644
index 0000000..30d1ea6
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.construct-failed-socket-server.json
@@ -0,0 +1,20 @@
+[
+ {
+ "function": "stream_socket_server",
+ "params": [
+ "tcp://0.0.0.0:9999",
+ null,
+ null
+ ],
+ "return": false
+ },
+ {
+ "function": "stream_socket_server",
+ "params": [
+ "tcp://0.0.0.0:10000",
+ null,
+ null
+ ],
+ "return": false
+ }
+] \ No newline at end of file
diff --git a/vendor/textalk/websocket/tests/scripts/server.construct.json b/vendor/textalk/websocket/tests/scripts/server.construct.json
new file mode 100644
index 0000000..c3181f3
--- /dev/null
+++ b/vendor/textalk/websocket/tests/scripts/server.construct.json
@@ -0,0 +1,11 @@
+[
+ {
+ "function": "stream_socket_server",
+ "params": [
+ "tcp://0.0.0.0:8000",
+ null,
+ null
+ ],
+ "return": "@mock-socket"
+ }
+] \ No newline at end of file