代码同步
This commit is contained in:
76
Server/vendor/textalk/websocket/tests/scripts/client.close.json
vendored
Normal file
76
Server/vendor/textalk/websocket/tests/scripts/client.close.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-authed.json
vendored
Normal file
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-authed.json
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"function": "fwrite",
|
||||
"params": [
|
||||
"@mock-stream"
|
||||
],
|
||||
"return": 13
|
||||
}
|
||||
]
|
||||
7
Server/vendor/textalk/websocket/tests/scripts/client.connect-bad-context.json
vendored
Normal file
7
Server/vendor/textalk/websocket/tests/scripts/client.connect-bad-context.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"function": "get_resource_type",
|
||||
"params": [],
|
||||
"return": "@mock-bad-context"
|
||||
}
|
||||
]
|
||||
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-context.json
vendored
Normal file
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-context.json
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"function": "fwrite",
|
||||
"params": [
|
||||
"@mock-stream"
|
||||
],
|
||||
"return": 13
|
||||
}
|
||||
]
|
||||
23
Server/vendor/textalk/websocket/tests/scripts/client.connect-error.json
vendored
Normal file
23
Server/vendor/textalk/websocket/tests/scripts/client.connect-error.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-extended.json
vendored
Normal file
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-extended.json
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"function": "fwrite",
|
||||
"params": [
|
||||
"@mock-stream"
|
||||
],
|
||||
"return": 13
|
||||
}
|
||||
]
|
||||
19
Server/vendor/textalk/websocket/tests/scripts/client.connect-failed.json
vendored
Normal file
19
Server/vendor/textalk/websocket/tests/scripts/client.connect-failed.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
65
Server/vendor/textalk/websocket/tests/scripts/client.connect-handshake-error.json
vendored
Normal file
65
Server/vendor/textalk/websocket/tests/scripts/client.connect-handshake-error.json
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"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
|
||||
}
|
||||
}
|
||||
]
|
||||
67
Server/vendor/textalk/websocket/tests/scripts/client.connect-headers.json
vendored
Normal file
67
Server/vendor/textalk/websocket/tests/scripts/client.connect-headers.json
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\nX-Very-Long_Header: This is added to provoke split reads of headers in client 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456\r\n"
|
||||
},
|
||||
{
|
||||
"function": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "Next234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"function": "fwrite",
|
||||
"params": [
|
||||
"@mock-stream"
|
||||
],
|
||||
"return": 13
|
||||
}
|
||||
]
|
||||
49
Server/vendor/textalk/websocket/tests/scripts/client.connect-invalid-key.json
vendored
Normal file
49
Server/vendor/textalk/websocket/tests/scripts/client.connect-invalid-key.json
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: BAD\r\n\r\n"
|
||||
}
|
||||
]
|
||||
49
Server/vendor/textalk/websocket/tests/scripts/client.connect-invalid-upgrade.json
vendored
Normal file
49
Server/vendor/textalk/websocket/tests/scripts/client.connect-invalid-upgrade.json
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return": "Invalid upgrade response\r\n\r\n"
|
||||
}
|
||||
]
|
||||
94
Server/vendor/textalk/websocket/tests/scripts/client.connect-persistent.json
vendored
Normal file
94
Server/vendor/textalk/websocket/tests/scripts/client.connect-persistent.json
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
|
||||
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-timeout.json
vendored
Normal file
58
Server/vendor/textalk/websocket/tests/scripts/client.connect-timeout.json
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"function": "fwrite",
|
||||
"params": [
|
||||
"@mock-stream"
|
||||
],
|
||||
"return": 13
|
||||
}
|
||||
]
|
||||
58
Server/vendor/textalk/websocket/tests/scripts/client.connect.json
vendored
Normal file
58
Server/vendor/textalk/websocket/tests/scripts/client.connect.json
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"function": "fwrite",
|
||||
"params": [
|
||||
"@mock-stream"
|
||||
],
|
||||
"return": 13
|
||||
}
|
||||
]
|
||||
23
Server/vendor/textalk/websocket/tests/scripts/client.destruct.json
vendored
Normal file
23
Server/vendor/textalk/websocket/tests/scripts/client.destruct.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
99
Server/vendor/textalk/websocket/tests/scripts/client.reconnect.json
vendored
Normal file
99
Server/vendor/textalk/websocket/tests/scripts/client.reconnect.json
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
[
|
||||
{
|
||||
"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": "fgets",
|
||||
"params": [
|
||||
"@mock-stream",
|
||||
1024
|
||||
],
|
||||
"return-op": "key-respond",
|
||||
"return": "HTTP\/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: {key}\r\n\r\n"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
55
Server/vendor/textalk/websocket/tests/scripts/close-remote.json
vendored
Normal file
55
Server/vendor/textalk/websocket/tests/scripts/close-remote.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
24
Server/vendor/textalk/websocket/tests/scripts/config-timeout.json
vendored
Normal file
24
Server/vendor/textalk/websocket/tests/scripts/config-timeout.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
150
Server/vendor/textalk/websocket/tests/scripts/ping-pong.json
vendored
Normal file
150
Server/vendor/textalk/websocket/tests/scripts/ping-pong.json
vendored
Normal file
@@ -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]
|
||||
}
|
||||
]
|
||||
18
Server/vendor/textalk/websocket/tests/scripts/receive-bad-opcode.json
vendored
Normal file
18
Server/vendor/textalk/websocket/tests/scripts/receive-bad-opcode.json
vendored
Normal file
@@ -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]
|
||||
}
|
||||
]
|
||||
58
Server/vendor/textalk/websocket/tests/scripts/receive-broken-read.json
vendored
Normal file
58
Server/vendor/textalk/websocket/tests/scripts/receive-broken-read.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
50
Server/vendor/textalk/websocket/tests/scripts/receive-client-timeout.json
vendored
Normal file
50
Server/vendor/textalk/websocket/tests/scripts/receive-client-timeout.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
58
Server/vendor/textalk/websocket/tests/scripts/receive-empty-read.json
vendored
Normal file
58
Server/vendor/textalk/websocket/tests/scripts/receive-empty-read.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
126
Server/vendor/textalk/websocket/tests/scripts/receive-fragmentation.json
vendored
Normal file
126
Server/vendor/textalk/websocket/tests/scripts/receive-fragmentation.json
vendored
Normal file
@@ -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]
|
||||
}
|
||||
]
|
||||
9
Server/vendor/textalk/websocket/tests/scripts/send-bad-opcode.json
vendored
Normal file
9
Server/vendor/textalk/websocket/tests/scripts/send-bad-opcode.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"function": "get_resource_type",
|
||||
"params": [
|
||||
"@mock-stream"
|
||||
],
|
||||
"return": "stream"
|
||||
}
|
||||
]
|
||||
43
Server/vendor/textalk/websocket/tests/scripts/send-broken-write.json
vendored
Normal file
43
Server/vendor/textalk/websocket/tests/scripts/send-broken-write.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
86
Server/vendor/textalk/websocket/tests/scripts/send-convenicance.json
vendored
Normal file
86
Server/vendor/textalk/websocket/tests/scripts/send-convenicance.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
43
Server/vendor/textalk/websocket/tests/scripts/send-failed-write.json
vendored
Normal file
43
Server/vendor/textalk/websocket/tests/scripts/send-failed-write.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
50
Server/vendor/textalk/websocket/tests/scripts/send-receive-128.json
vendored
Normal file
50
Server/vendor/textalk/websocket/tests/scripts/send-receive-128.json
vendored
Normal file
@@ -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]
|
||||
}
|
||||
]
|
||||
113
Server/vendor/textalk/websocket/tests/scripts/send-receive-65536.json
vendored
Normal file
113
Server/vendor/textalk/websocket/tests/scripts/send-receive-65536.json
vendored
Normal file
@@ -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]
|
||||
}
|
||||
]
|
||||
112
Server/vendor/textalk/websocket/tests/scripts/send-receive-multi-fragment.json
vendored
Normal file
112
Server/vendor/textalk/websocket/tests/scripts/send-receive-multi-fragment.json
vendored
Normal file
@@ -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]
|
||||
}
|
||||
]
|
||||
50
Server/vendor/textalk/websocket/tests/scripts/send-receive.json
vendored
Normal file
50
Server/vendor/textalk/websocket/tests/scripts/send-receive.json
vendored
Normal file
@@ -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]
|
||||
}
|
||||
]
|
||||
315
Server/vendor/textalk/websocket/tests/scripts/server.accept-destruct.json
vendored
Normal file
315
Server/vendor/textalk/websocket/tests/scripts/server.accept-destruct.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
18
Server/vendor/textalk/websocket/tests/scripts/server.accept-error-connect.json
vendored
Normal file
18
Server/vendor/textalk/websocket/tests/scripts/server.accept-error-connect.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"function": "stream_socket_accept",
|
||||
"params": [],
|
||||
"error": {
|
||||
"msg": "A PHP error",
|
||||
"type": 512
|
||||
},
|
||||
"return": false
|
||||
},
|
||||
{
|
||||
"function": "fclose",
|
||||
"params": [
|
||||
false
|
||||
],
|
||||
"return": true
|
||||
}
|
||||
]
|
||||
14
Server/vendor/textalk/websocket/tests/scripts/server.accept-failed-connect.json
vendored
Normal file
14
Server/vendor/textalk/websocket/tests/scripts/server.accept-failed-connect.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"function": "stream_socket_accept",
|
||||
"params": [],
|
||||
"return": false
|
||||
},
|
||||
{
|
||||
"function": "fclose",
|
||||
"params": [
|
||||
false
|
||||
],
|
||||
"return": true
|
||||
}
|
||||
]
|
||||
265
Server/vendor/textalk/websocket/tests/scripts/server.accept-failed-http.json
vendored
Normal file
265
Server/vendor/textalk/websocket/tests/scripts/server.accept-failed-http.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
265
Server/vendor/textalk/websocket/tests/scripts/server.accept-failed-ws-key.json
vendored
Normal file
265
Server/vendor/textalk/websocket/tests/scripts/server.accept-failed-ws-key.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
289
Server/vendor/textalk/websocket/tests/scripts/server.accept-timeout.json
vendored
Normal file
289
Server/vendor/textalk/websocket/tests/scripts/server.accept-timeout.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
287
Server/vendor/textalk/websocket/tests/scripts/server.accept.json
vendored
Normal file
287
Server/vendor/textalk/websocket/tests/scripts/server.accept.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
70
Server/vendor/textalk/websocket/tests/scripts/server.close.json
vendored
Normal file
70
Server/vendor/textalk/websocket/tests/scripts/server.close.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
]
|
||||
28
Server/vendor/textalk/websocket/tests/scripts/server.construct-error-socket-server.json
vendored
Normal file
28
Server/vendor/textalk/websocket/tests/scripts/server.construct-error-socket-server.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
20
Server/vendor/textalk/websocket/tests/scripts/server.construct-failed-socket-server.json
vendored
Normal file
20
Server/vendor/textalk/websocket/tests/scripts/server.construct-failed-socket-server.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
]
|
||||
11
Server/vendor/textalk/websocket/tests/scripts/server.construct.json
vendored
Normal file
11
Server/vendor/textalk/websocket/tests/scripts/server.construct.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"function": "stream_socket_server",
|
||||
"params": [
|
||||
"tcp://0.0.0.0:8000",
|
||||
null,
|
||||
null
|
||||
],
|
||||
"return": "@mock-socket"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user