Fixed issue with client tests
This commit is contained in:
parent
6676b05d02
commit
f1451e0bd8
@ -377,6 +377,7 @@ class Frame implements FrameInterface {
|
|||||||
|
|
||||||
$byte_length = $this->getNumPayloadBytes();
|
$byte_length = $this->getNumPayloadBytes();
|
||||||
if ($this->bytesRecvd < 1 + $byte_length) {
|
if ($this->bytesRecvd < 1 + $byte_length) {
|
||||||
|
$this->defPayLen = -1;
|
||||||
throw new \UnderflowException('Not enough data buffered to determine payload length');
|
throw new \UnderflowException('Not enough data buffered to determine payload length');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ require __DIR__ . '/AbConnectionContext.php';
|
|||||||
|
|
||||||
define('AGENT', 'RatchetRFC/0.0.0');
|
define('AGENT', 'RatchetRFC/0.0.0');
|
||||||
|
|
||||||
|
$testServer = "127.0.0.1";
|
||||||
|
|
||||||
|
|
||||||
class EmConnectionContext extends AbConnectionContext implements \Evenement\EventEmitterInterface, Ratchet\RFC6455\Messaging\Streaming\ContextInterface {
|
class EmConnectionContext extends AbConnectionContext implements \Evenement\EventEmitterInterface, Ratchet\RFC6455\Messaging\Streaming\ContextInterface {
|
||||||
use \Evenement\EventEmitterTrait;
|
use \Evenement\EventEmitterTrait;
|
||||||
@ -39,10 +41,11 @@ $factory = new \React\SocketClient\Connector($loop, $dnsResolver);
|
|||||||
|
|
||||||
function getTestCases() {
|
function getTestCases() {
|
||||||
global $factory;
|
global $factory;
|
||||||
|
global $testServer;
|
||||||
|
|
||||||
$deferred = new Deferred();
|
$deferred = new Deferred();
|
||||||
|
|
||||||
$factory->create('127.0.0.1', 9001)->then(function (\React\Stream\Stream $stream) use ($deferred) {
|
$factory->create($testServer, 9001)->then(function (\React\Stream\Stream $stream) use ($deferred) {
|
||||||
$cn = new \Ratchet\RFC6455\Handshake\ClientNegotiator("/getCaseCount");
|
$cn = new \Ratchet\RFC6455\Handshake\ClientNegotiator("/getCaseCount");
|
||||||
$cnRequest = $cn->getRequest();
|
$cnRequest = $cn->getRequest();
|
||||||
|
|
||||||
@ -92,12 +95,13 @@ function getTestCases() {
|
|||||||
function runTest($case)
|
function runTest($case)
|
||||||
{
|
{
|
||||||
global $factory;
|
global $factory;
|
||||||
|
global $testServer;
|
||||||
|
|
||||||
$casePath = "/runCase?case={$case}&agent=" . AGENT;
|
$casePath = "/runCase?case={$case}&agent=" . AGENT;
|
||||||
|
|
||||||
$deferred = new Deferred();
|
$deferred = new Deferred();
|
||||||
|
|
||||||
$factory->create('127.0.0.1', 9001)->then(function (\React\Stream\Stream $stream) use ($deferred, $casePath, $case) {
|
$factory->create($testServer, 9001)->then(function (\React\Stream\Stream $stream) use ($deferred, $casePath, $case) {
|
||||||
$cn = new \Ratchet\RFC6455\Handshake\ClientNegotiator($casePath);
|
$cn = new \Ratchet\RFC6455\Handshake\ClientNegotiator($casePath);
|
||||||
$cnRequest = $cn->getRequest();
|
$cnRequest = $cn->getRequest();
|
||||||
|
|
||||||
@ -145,10 +149,11 @@ function runTest($case)
|
|||||||
|
|
||||||
function createReport() {
|
function createReport() {
|
||||||
global $factory;
|
global $factory;
|
||||||
|
global $testServer;
|
||||||
|
|
||||||
$deferred = new Deferred();
|
$deferred = new Deferred();
|
||||||
|
|
||||||
$factory->create('127.0.0.1', 9001)->then(function (\React\Stream\Stream $stream) use ($deferred) {
|
$factory->create($testServer, 9001)->then(function (\React\Stream\Stream $stream) use ($deferred) {
|
||||||
$cn = new \Ratchet\RFC6455\Handshake\ClientNegotiator('/updateReports?agent=' . AGENT);
|
$cn = new \Ratchet\RFC6455\Handshake\ClientNegotiator('/updateReports?agent=' . AGENT);
|
||||||
$cnRequest = $cn->getRequest();
|
$cnRequest = $cn->getRequest();
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
}
|
}
|
||||||
, "outdir": "./reports/clients"
|
, "outdir": "./reports/clients"
|
||||||
, "cases": ["*"]
|
, "cases": ["*"]
|
||||||
, "cases_failing": ["9.3.2", "9.3.3", "9.3.4", "9.4.2", "9.4.3", "9.4.4"]
|
|
||||||
, "exclude-cases": ["12.*", "13.*"]
|
, "exclude-cases": ["12.*", "13.*"]
|
||||||
, "exclude-agent-cases": {}
|
, "exclude-agent-cases": {}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user