Merge branch 'refs/heads/tests' into 0.3
This commit is contained in:
commit
d7cbafb074
16
Makefile
16
Makefile
@ -8,21 +8,21 @@ cover:
|
||||
phpunit --coverage-text --coverage-html=reports/coverage
|
||||
|
||||
abtests:
|
||||
ulimit -n 2048 && php tests/AutobahnTestSuite/bin/fuzzingserver-libevent.php 8001 &
|
||||
ulimit -n 2048 && php tests/AutobahnTestSuite/bin/fuzzingserver-stream.php 8002 &
|
||||
ulimit -n 2048 && php tests/AutobahnTestSuite/bin/fuzzingserver-noutf8.php 8003 &
|
||||
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-libevent.php 8001 &
|
||||
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-stream.php 8002 &
|
||||
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-noutf8.php 8003 &
|
||||
wstest -m testeeserver -w ws://localhost:8000 &
|
||||
wstest -m fuzzingclient -s tests/AutobahnTestSuite/fuzzingclient-all.json
|
||||
wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-all.json
|
||||
killall php wstest
|
||||
|
||||
abtest:
|
||||
ulimit -n 2048 && php tests/AutobahnTestSuite/bin/fuzzingserver-stream.php &
|
||||
wstest -m fuzzingclient -s tests/AutobahnTestSuite/fuzzingclient-quick.json
|
||||
ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver-stream.php &
|
||||
wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-quick.json
|
||||
killall php
|
||||
|
||||
profile:
|
||||
php -d 'xdebug.profiler_enable=1' tests/AutobahnTestSuite/bin/fuzzingserver-libevent.php &
|
||||
wstest -m fuzzingclient -s tests/AutobahnTestSuite/fuzzingclient-profile.json
|
||||
php -d 'xdebug.profiler_enable=1' tests/autobahn/bin/fuzzingserver-libevent.php &
|
||||
wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-profile.json
|
||||
killall php
|
||||
|
||||
apidocs:
|
||||
|
@ -20,14 +20,13 @@
|
||||
}
|
||||
, "autoload": {
|
||||
"psr-0": {
|
||||
"Ratchet\\Tests": "tests"
|
||||
, "Ratchet": "src"
|
||||
"Ratchet": "src"
|
||||
}
|
||||
}
|
||||
, "require": {
|
||||
"php": ">=5.3.9"
|
||||
, "react/socket": "0.3.*"
|
||||
, "guzzle/http": "3.6.*"
|
||||
, "guzzle/http": ">=3.6.0,<3.8.0-dev"
|
||||
, "symfony/http-foundation": "~2.2"
|
||||
, "symfony/routing": "~2.2"
|
||||
}
|
||||
|
108
composer.lock
generated
108
composer.lock
generated
@ -3,7 +3,7 @@
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
|
||||
],
|
||||
"hash": "d5a238bcdccc33fab13dd3c65b663beb",
|
||||
"hash": "a45c5bcb9c18e390adc2a60ffd059a52",
|
||||
"packages": [
|
||||
{
|
||||
"name": "evenement/evenement",
|
||||
@ -47,17 +47,17 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzle/common",
|
||||
"version": "v3.6.0",
|
||||
"version": "v3.7.1",
|
||||
"target-dir": "Guzzle/Common",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/common.git",
|
||||
"reference": "v3.6.0"
|
||||
"reference": "v3.7.1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/common/zipball/v3.6.0",
|
||||
"reference": "v3.6.0",
|
||||
"url": "https://api.github.com/repos/guzzle/common/zipball/v3.7.1",
|
||||
"reference": "v3.7.1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -67,7 +67,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.6-dev"
|
||||
"dev-master": "3.7-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -87,21 +87,21 @@
|
||||
"event",
|
||||
"exception"
|
||||
],
|
||||
"time": "2013-05-30 07:01:25"
|
||||
"time": "2013-07-05 20:17:54"
|
||||
},
|
||||
{
|
||||
"name": "guzzle/http",
|
||||
"version": "v3.6.0",
|
||||
"version": "v3.7.1",
|
||||
"target-dir": "Guzzle/Http",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/http.git",
|
||||
"reference": "v3.6.0"
|
||||
"reference": "v3.7.1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/http/zipball/v3.6.0",
|
||||
"reference": "v3.6.0",
|
||||
"url": "https://api.github.com/repos/guzzle/http/zipball/v3.7.1",
|
||||
"reference": "v3.7.1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -116,7 +116,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.6-dev"
|
||||
"dev-master": "3.7-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -144,21 +144,21 @@
|
||||
"http",
|
||||
"http client"
|
||||
],
|
||||
"time": "2013-05-30 07:01:25"
|
||||
"time": "2013-07-02 19:53:26"
|
||||
},
|
||||
{
|
||||
"name": "guzzle/parser",
|
||||
"version": "v3.6.0",
|
||||
"version": "v3.7.1",
|
||||
"target-dir": "Guzzle/Parser",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/parser.git",
|
||||
"reference": "v3.6.0"
|
||||
"reference": "v3.7.1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/parser/zipball/v3.6.0",
|
||||
"reference": "v3.6.0",
|
||||
"url": "https://api.github.com/repos/guzzle/parser/zipball/v3.7.1",
|
||||
"reference": "v3.7.1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -167,7 +167,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.6-dev"
|
||||
"dev-master": "3.7-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -188,21 +188,21 @@
|
||||
"message",
|
||||
"url"
|
||||
],
|
||||
"time": "2013-05-30 07:01:25"
|
||||
"time": "2013-06-11 00:24:07"
|
||||
},
|
||||
{
|
||||
"name": "guzzle/stream",
|
||||
"version": "v3.6.0",
|
||||
"version": "v3.7.1",
|
||||
"target-dir": "Guzzle/Stream",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/stream.git",
|
||||
"reference": "v3.6.0"
|
||||
"reference": "v3.7.1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/stream/zipball/v3.6.0",
|
||||
"reference": "v3.6.0",
|
||||
"url": "https://api.github.com/repos/guzzle/stream/zipball/v3.7.1",
|
||||
"reference": "v3.7.1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -215,7 +215,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.6-dev"
|
||||
"dev-master": "3.7-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -241,21 +241,21 @@
|
||||
"component",
|
||||
"stream"
|
||||
],
|
||||
"time": "2013-05-30 07:01:25"
|
||||
"time": "2013-06-27 00:50:43"
|
||||
},
|
||||
{
|
||||
"name": "react/event-loop",
|
||||
"version": "v0.3.2",
|
||||
"version": "v0.3.3",
|
||||
"target-dir": "React/EventLoop",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactphp/event-loop.git",
|
||||
"reference": "v0.3.2"
|
||||
"reference": "v0.3.3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/reactphp/event-loop/zipball/v0.3.2",
|
||||
"reference": "v0.3.2",
|
||||
"url": "https://api.github.com/repos/reactphp/event-loop/zipball/v0.3.3",
|
||||
"reference": "v0.3.3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -284,7 +284,7 @@
|
||||
"keywords": [
|
||||
"event-loop"
|
||||
],
|
||||
"time": "2013-01-14 23:11:47"
|
||||
"time": "2013-07-08 22:38:22"
|
||||
},
|
||||
{
|
||||
"name": "react/socket",
|
||||
@ -330,17 +330,17 @@
|
||||
},
|
||||
{
|
||||
"name": "react/stream",
|
||||
"version": "v0.3.2",
|
||||
"version": "v0.3.3",
|
||||
"target-dir": "React/Stream",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactphp/stream.git",
|
||||
"reference": "v0.3.2"
|
||||
"reference": "v0.3.3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/reactphp/stream/zipball/v0.3.2",
|
||||
"reference": "v0.3.2",
|
||||
"url": "https://api.github.com/repos/reactphp/stream/zipball/v0.3.3",
|
||||
"reference": "v0.3.3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -371,28 +371,28 @@
|
||||
"pipe",
|
||||
"stream"
|
||||
],
|
||||
"time": "2013-05-10 15:12:22"
|
||||
"time": "2013-07-09 00:44:12"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v2.3.0",
|
||||
"version": "v2.3.2",
|
||||
"target-dir": "Symfony/Component/EventDispatcher",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/EventDispatcher.git",
|
||||
"reference": "v2.3.0-RC1"
|
||||
"reference": "v2.3.2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.3.0-RC1",
|
||||
"reference": "v2.3.0-RC1",
|
||||
"url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.3.2",
|
||||
"reference": "v2.3.2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/dependency-injection": ">=2.0,<3.0"
|
||||
"symfony/dependency-injection": "~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
@ -429,17 +429,17 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v2.3.0",
|
||||
"version": "v2.3.2",
|
||||
"target-dir": "Symfony/Component/HttpFoundation",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/HttpFoundation.git",
|
||||
"reference": "v2.3.0-RC1"
|
||||
"reference": "v2.3.2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.3.0-RC1",
|
||||
"reference": "v2.3.0-RC1",
|
||||
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.3.2",
|
||||
"reference": "v2.3.2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -475,31 +475,31 @@
|
||||
],
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2013-05-10 06:00:03"
|
||||
"time": "2013-07-17 05:57:53"
|
||||
},
|
||||
{
|
||||
"name": "symfony/routing",
|
||||
"version": "v2.3.0",
|
||||
"version": "v2.3.2",
|
||||
"target-dir": "Symfony/Component/Routing",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Routing.git",
|
||||
"reference": "v2.3.0"
|
||||
"reference": "v2.3.2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Routing/zipball/v2.3.0",
|
||||
"reference": "v2.3.0",
|
||||
"url": "https://api.github.com/repos/symfony/Routing/zipball/v2.3.2",
|
||||
"reference": "v2.3.2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/common": ">=2.2,<3.0",
|
||||
"psr/log": ">=1.0,<2.0",
|
||||
"symfony/config": ">=2.2,<3.0",
|
||||
"symfony/yaml": ">=2.0,<3.0"
|
||||
"doctrine/common": "~2.2",
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~2.2",
|
||||
"symfony/yaml": "~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/common": "",
|
||||
@ -533,7 +533,7 @@
|
||||
],
|
||||
"description": "Symfony Routing Component",
|
||||
"homepage": "http://symfony.com",
|
||||
"time": "2013-05-20 08:57:26"
|
||||
"time": "2013-06-23 08:16:02"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
|
@ -2,7 +2,7 @@
|
||||
<phpunit
|
||||
forceCoversAnnotation="true"
|
||||
mapTestClassNameToCoveredClassName="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
colors="true"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
@ -11,15 +11,20 @@
|
||||
>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Ratchet Test Suite">
|
||||
<directory>./tests/Ratchet/</directory>
|
||||
<testsuite name="unit">
|
||||
<directory>./tests/unit/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="integration">
|
||||
<directory>./tests/integration/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<blacklist>
|
||||
<directory>./tests/</directory>
|
||||
<directory>./vendor/</directory>
|
||||
</blacklist>
|
||||
<whitelist>
|
||||
<directory>./src/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
@ -79,7 +79,7 @@ class App {
|
||||
/**
|
||||
* @param string $path
|
||||
* @param ComponentInterface $controller
|
||||
* @return Symfony\Component\Routing\Route
|
||||
* @return \Symfony\Component\Routing\Route
|
||||
*/
|
||||
public function route($path, ComponentInterface $controller) {
|
||||
if ($controller instanceof HttpServerInterface || $controller instanceof WsServer) {
|
||||
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
require dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php';
|
||||
|
||||
$loop = new React\EventLoop\LibEvLoop;
|
||||
$sock = new React\Socket\Server($loop);
|
||||
$app = new Ratchet\Http\HttpServer(new Ratchet\WebSocket\WsServer(new Ratchet\Server\EchoServer));
|
||||
|
||||
$port = $argc > 1 ? $argv[1] : 8000;
|
||||
$sock->listen($port, '0.0.0.0');
|
||||
|
||||
$server = new Ratchet\Server\IoServer($app, $sock, $loop);
|
||||
$server->run();
|
5
tests/bootstrap.php
Normal file
5
tests/bootstrap.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$loader = require __DIR__ . '/../vendor/autoload.php';
|
||||
$loader->add('Ratchet', __DIR__ . '/helpers');
|
||||
$loader->register();
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests;
|
||||
namespace Ratchet;
|
||||
|
||||
abstract class AbstractMessageComponentTestCase extends \PHPUnit_Framework_TestCase {
|
||||
protected $_app;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Mock;
|
||||
namespace Ratchet\Mock;
|
||||
use Ratchet\MessageComponentInterface;
|
||||
use Ratchet\WebSocket\WsServerInterface;
|
||||
use Ratchet\ConnectionInterface;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Mock;
|
||||
namespace Ratchet\Mock;
|
||||
use Ratchet\ConnectionInterface;
|
||||
|
||||
class Connection implements ConnectionInterface {
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Mock;
|
||||
namespace Ratchet\Mock;
|
||||
use Ratchet\AbstractConnectionDecorator;
|
||||
|
||||
class ConnectionDecorator extends AbstractConnectionDecorator {
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Mock;
|
||||
namespace Ratchet\Mock;
|
||||
use Ratchet\Wamp\WampServerInterface;
|
||||
use Ratchet\WebSocket\WsServerInterface;
|
||||
use Ratchet\ConnectionInterface;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Mock;
|
||||
namespace Ratchet;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use Ratchet\MessageComponentInterface;
|
||||
use Ratchet\WebSocket\WsServerInterface;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Wamp\Stub;
|
||||
namespace Ratchet\Wamp\Stub;
|
||||
use Ratchet\WebSocket\WsServerInterface;
|
||||
use Ratchet\Wamp\WampServerInterface;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket\Stub;
|
||||
namespace Ratchet\WebSocket\Stub;
|
||||
use Ratchet\MessageComponentInterface;
|
||||
use Ratchet\WebSocket\WsServerInterface;
|
||||
|
53
tests/integration/GuzzleTest.php
Normal file
53
tests/integration/GuzzleTest.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
use Guzzle\Http\Message\Request;
|
||||
|
||||
class GuzzleTest extends \PHPUnit_Framework_TestCase {
|
||||
protected $_request;
|
||||
|
||||
protected $_headers = array(
|
||||
'Upgrade' => 'websocket'
|
||||
, 'Connection' => 'Upgrade'
|
||||
, 'Host' => 'localhost:8080'
|
||||
, 'Origin' => 'chrome://newtab'
|
||||
, 'Sec-WebSocket-Protocol' => 'one, two, three'
|
||||
, 'Sec-WebSocket-Key' => '9bnXNp3ae6FbFFRtPdiPXA=='
|
||||
, 'Sec-WebSocket-Version' => '13'
|
||||
);
|
||||
|
||||
public function setUp() {
|
||||
$this->_request = new Request('GET', 'http://localhost', $this->_headers);
|
||||
}
|
||||
|
||||
public function testGetHeaderString() {
|
||||
$this->assertEquals('Upgrade', (string)$this->_request->getHeader('connection'));
|
||||
$this->assertEquals('9bnXNp3ae6FbFFRtPdiPXA==', (string)$this->_request->getHeader('Sec-Websocket-Key'));
|
||||
}
|
||||
|
||||
public function testGetHeaderInteger() {
|
||||
$this->assertSame('13', (string)$this->_request->getHeader('Sec-Websocket-Version'));
|
||||
$this->assertSame(13, (int)(string)$this->_request->getHeader('Sec-WebSocket-Version'));
|
||||
}
|
||||
|
||||
public function testGetHeaderObject() {
|
||||
$this->assertInstanceOf('Guzzle\Http\Message\Header', $this->_request->getHeader('Origin'));
|
||||
$this->assertNull($this->_request->getHeader('Non-existant-header'));
|
||||
}
|
||||
|
||||
public function testHeaderObjectNormalizeValues() {
|
||||
$expected = 1 + substr_count($this->_headers['Sec-WebSocket-Protocol'], ',');
|
||||
$protocols = $this->_request->getHeader('Sec-WebSocket-Protocol')->normalize();
|
||||
$count = 0;
|
||||
|
||||
foreach ($protocols as $protocol) {
|
||||
$count++;
|
||||
}
|
||||
|
||||
$this->assertEquals($expected, $count);
|
||||
$this->assertEquals($expected, count($protocols));
|
||||
}
|
||||
|
||||
public function testRequestFactoryCreateSignature() {
|
||||
$ref = new \ReflectionMethod('Guzzle\Http\Message\RequestFactory', 'create');
|
||||
$this->assertEquals(2, $ref->getNumberOfRequiredParameters());
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests;
|
||||
use Ratchet\Tests\Mock\ConnectionDecorator;
|
||||
namespace Ratchet;
|
||||
use Ratchet\Mock\ConnectionDecorator;
|
||||
|
||||
/**
|
||||
* @covers Ratchet\AbstractConnectionDecorator
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Http\Guzzle\Http\Message;
|
||||
namespace Ratchet\Http\Guzzle\Http\Message;
|
||||
use Ratchet\Http\Guzzle\Http\Message\RequestFactory;
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Http;
|
||||
namespace Ratchet\Http;
|
||||
use Ratchet\Http\HttpRequestParser;
|
||||
|
||||
/**
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Http;
|
||||
use Ratchet\Tests\AbstractMessageComponentTestCase;
|
||||
namespace Ratchet\Http;
|
||||
use Ratchet\AbstractMessageComponentTestCase;
|
||||
|
||||
/**
|
||||
* @covers Ratchet\Http\HttpServer
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Http;
|
||||
namespace Ratchet\Http;
|
||||
use Ratchet\Http\Router;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Server;
|
||||
namespace Ratchet\Server;
|
||||
use Ratchet\Server\EchoServer;
|
||||
|
||||
class EchoServerTest extends \PHPUnit_Framework_TestCase {
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Application\Server;
|
||||
namespace Ratchet\Application\Server;
|
||||
use Ratchet\Server\FlashPolicy;
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Application\Server;
|
||||
namespace Ratchet\Application\Server;
|
||||
use Ratchet\Server\IoConnection;
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Server;
|
||||
namespace Ratchet\Server;
|
||||
use Ratchet\Server\IoServer;
|
||||
use React\EventLoop\StreamSelectLoop;
|
||||
use React\Socket\Server;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Server;
|
||||
namespace Ratchet\Server;
|
||||
use Ratchet\Server\IpBlackList;
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Session\Serialize;
|
||||
namespace Ratchet\Session\Serialize;
|
||||
use Ratchet\Session\Serialize\PhpHandler;
|
||||
|
||||
/**
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Session;
|
||||
use Ratchet\Tests\AbstractMessageComponentTestCase;
|
||||
namespace Ratchet\Session;
|
||||
use Ratchet\AbstractMessageComponentTestCase;
|
||||
use Ratchet\Session\SessionProvider;
|
||||
use Ratchet\Tests\Mock\MemorySessionHandler;
|
||||
use Ratchet\Mock\MemorySessionHandler;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler;
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
|
||||
use Guzzle\Http\Message\Request;
|
||||
@ -31,7 +31,7 @@ class SessionProviderTest extends AbstractMessageComponentTestCase {
|
||||
}
|
||||
|
||||
public function getDecoratorClassString() {
|
||||
return '\Ratchet\Tests\Mock\NullComponent';
|
||||
return '\Ratchet\NullComponent';
|
||||
}
|
||||
|
||||
public function getComponentClassString() {
|
||||
@ -119,7 +119,7 @@ class SessionProviderTest extends AbstractMessageComponentTestCase {
|
||||
}
|
||||
|
||||
public function testGetSubProtocolsGetFromApp() {
|
||||
$mock = $this->getMock('Ratchet\\Tests\\WebSocket\\Stub\\WsMessageComponentInterface');
|
||||
$mock = $this->getMock('Ratchet\WebSocket\Stub\WsMessageComponentInterface');
|
||||
$mock->expects($this->once())->method('getSubProtocols')->will($this->returnValue(array('hello', 'world')));
|
||||
$comp = new SessionProvider($mock, new NullSessionHandler);
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Wamp;
|
||||
namespace Ratchet\Wamp;
|
||||
use Ratchet\Wamp\ServerProtocol;
|
||||
use Ratchet\Wamp\WampConnection;
|
||||
use Ratchet\Tests\Mock\Connection;
|
||||
use Ratchet\Tests\Mock\WampComponent as TestComponent;
|
||||
use Ratchet\Mock\Connection;
|
||||
use Ratchet\Mock\WampComponent as TestComponent;
|
||||
|
||||
/**
|
||||
* @covers Ratchet\Wamp\ServerProtocol
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Wamp;
|
||||
namespace Ratchet\Wamp;
|
||||
use Ratchet\Wamp\TopicManager;
|
||||
|
||||
/**
|
||||
@ -20,7 +20,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
public function setUp() {
|
||||
$this->conn = $this->getMock('\Ratchet\ConnectionInterface');
|
||||
$this->mock = $this->getMock('\Ratchet\Wamp\\WampServerInterface');
|
||||
$this->mock = $this->getMock('\Ratchet\Wamp\WampServerInterface');
|
||||
$this->mngr = new TopicManager($this->mock);
|
||||
|
||||
$this->conn->WAMP = new \StdClass;
|
||||
@ -28,19 +28,19 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
public function testGetTopicReturnsTopicObject() {
|
||||
$class = new \ReflectionClass('Ratchet\\Wamp\\TopicManager');
|
||||
$class = new \ReflectionClass('Ratchet\Wamp\TopicManager');
|
||||
$method = $class->getMethod('getTopic');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$topic = $method->invokeArgs($this->mngr, array('The Topic'));
|
||||
|
||||
$this->assertInstanceOf('Ratchet\\Wamp\\Topic', $topic);
|
||||
$this->assertInstanceOf('Ratchet\Wamp\Topic', $topic);
|
||||
}
|
||||
|
||||
public function testGetTopicCreatesTopicWithSameName() {
|
||||
$name = 'The Topic';
|
||||
|
||||
$class = new \ReflectionClass('Ratchet\\Wamp\\TopicManager');
|
||||
$class = new \ReflectionClass('Ratchet\Wamp\TopicManager');
|
||||
$method = $class->getMethod('getTopic');
|
||||
$method->setAccessible(true);
|
||||
|
||||
@ -50,7 +50,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
public function testGetTopicReturnsSameObject() {
|
||||
$class = new \ReflectionClass('Ratchet\\Wamp\\TopicManager');
|
||||
$class = new \ReflectionClass('Ratchet\Wamp\TopicManager');
|
||||
$method = $class->getMethod('getTopic');
|
||||
$method->setAccessible(true);
|
||||
|
||||
@ -71,7 +71,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
$this->mock->expects($this->once())->method('onCall')->with(
|
||||
$this->conn
|
||||
, $id
|
||||
, $this->isInstanceOf('Ratchet\\Wamp\\Topic')
|
||||
, $this->isInstanceOf('Ratchet\Wamp\Topic')
|
||||
, array()
|
||||
);
|
||||
|
||||
@ -80,7 +80,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
public function testOnSubscribeCreatesTopicObject() {
|
||||
$this->mock->expects($this->once())->method('onSubscribe')->with(
|
||||
$this->conn, $this->isInstanceOf('Ratchet\\Wamp\\Topic')
|
||||
$this->conn, $this->isInstanceOf('Ratchet\Wamp\Topic')
|
||||
);
|
||||
|
||||
$this->mngr->onSubscribe($this->conn, 'new topic');
|
||||
@ -89,7 +89,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testTopicIsInConnectionOnSubscribe() {
|
||||
$name = 'New Topic';
|
||||
|
||||
$class = new \ReflectionClass('Ratchet\\Wamp\\TopicManager');
|
||||
$class = new \ReflectionClass('Ratchet\Wamp\TopicManager');
|
||||
$method = $class->getMethod('getTopic');
|
||||
$method->setAccessible(true);
|
||||
|
||||
@ -110,7 +110,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testUnsubscribeEvent() {
|
||||
$name = 'in and out';
|
||||
$this->mock->expects($this->once())->method('onUnsubscribe')->with(
|
||||
$this->conn, $this->isInstanceOf('Ratchet\\Wamp\\Topic')
|
||||
$this->conn, $this->isInstanceOf('Ratchet\Wamp\Topic')
|
||||
);
|
||||
|
||||
$this->mngr->onSubscribe($this->conn, $name);
|
||||
@ -129,7 +129,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testUnsubscribeRemovesTopicFromConnection() {
|
||||
$name = 'Bye Bye Topic';
|
||||
|
||||
$class = new \ReflectionClass('Ratchet\\Wamp\\TopicManager');
|
||||
$class = new \ReflectionClass('Ratchet\Wamp\TopicManager');
|
||||
$method = $class->getMethod('getTopic');
|
||||
$method->setAccessible(true);
|
||||
|
||||
@ -146,7 +146,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
$this->mock->expects($this->once())->method('onPublish')->with(
|
||||
$this->conn
|
||||
, $this->isInstanceOf('Ratchet\\Wamp\\Topic')
|
||||
, $this->isInstanceOf('Ratchet\Wamp\Topic')
|
||||
, $msg
|
||||
, $this->isType('array')
|
||||
, $this->isType('array')
|
||||
@ -163,7 +163,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
public function testConnIsRemovedFromTopicOnClose() {
|
||||
$name = 'State testing';
|
||||
|
||||
$class = new \ReflectionClass('Ratchet\\Wamp\\TopicManager');
|
||||
$class = new \ReflectionClass('Ratchet\Wamp\TopicManager');
|
||||
$method = $class->getMethod('getTopic');
|
||||
$method->setAccessible(true);
|
||||
|
||||
@ -188,7 +188,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
public function testGetSubProtocolsBubbles() {
|
||||
$subs = array('hello', 'world');
|
||||
$app = $this->getMock('Ratchet\\Tests\\Wamp\\Stub\\WsWampServerInterface');
|
||||
$app = $this->getMock('Ratchet\Wamp\Stub\WsWampServerInterface');
|
||||
$app->expects($this->once())->method('getSubProtocols')->will($this->returnValue($subs));
|
||||
$mngr = new TopicManager($app);
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Wamp;
|
||||
namespace Ratchet\Wamp;
|
||||
use Ratchet\Wamp\Topic;
|
||||
use Ratchet\Wamp\WampConnection;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Wamp;
|
||||
namespace Ratchet\Wamp;
|
||||
use Ratchet\Wamp\WampConnection;
|
||||
|
||||
/**
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\Wamp;
|
||||
namespace Ratchet\Wamp;
|
||||
use Ratchet\Wamp\WampServer;
|
||||
use Ratchet\Tests\AbstractMessageComponentTestCase;
|
||||
use Ratchet\AbstractMessageComponentTestCase;
|
||||
|
||||
/**
|
||||
* @covers Ratchet\Wamp\WampServer
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket\Version;
|
||||
namespace Ratchet\WebSocket\Version;
|
||||
use Ratchet\WebSocket\Version\Hixie76;
|
||||
use Ratchet\Http\HttpServer;
|
||||
use Ratchet\WebSocket\WsServer;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket\Version;
|
||||
namespace Ratchet\WebSocket\Version;
|
||||
use Ratchet\WebSocket\Version\HyBi10;
|
||||
use Ratchet\WebSocket\Version\RFC6455\Frame;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket\Version\RFC6455;
|
||||
namespace Ratchet\WebSocket\Version\RFC6455;
|
||||
use Ratchet\WebSocket\Version\RFC6455\Frame;
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket\Version\RFC6455;
|
||||
namespace Ratchet\WebSocket\Version\RFC6455;
|
||||
use Ratchet\WebSocket\Version\RFC6455\HandshakeVerifier;
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket\Version\RFC6455\Message;
|
||||
namespace Ratchet\WebSocket\Version\RFC6455\Message;
|
||||
use Ratchet\WebSocket\Version\RFC6455\Message;
|
||||
use Ratchet\WebSocket\Version\RFC6455\Frame;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket\Version;
|
||||
namespace Ratchet\WebSocket\Version;
|
||||
use Ratchet\WebSocket\Version\RFC6455;
|
||||
use Ratchet\WebSocket\Version\RFC6455\Frame;
|
||||
use Guzzle\Http\Message\RequestFactory;
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket;
|
||||
namespace Ratchet\WebSocket;
|
||||
use Ratchet\WebSocket\VersionManager;
|
||||
use Ratchet\WebSocket\Version\RFC6455;
|
||||
use Ratchet\WebSocket\Version\HyBi10;
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Ratchet\Tests\WebSocket;
|
||||
namespace Ratchet\WebSocket;
|
||||
use Ratchet\WebSocket\WsServer;
|
||||
use Ratchet\Tests\Mock\Component as MockComponent;
|
||||
use Ratchet\Mock\Component as MockComponent;
|
||||
|
||||
/**
|
||||
* @covers Ratchet\WebSocket\WsServer
|
Loading…
Reference in New Issue
Block a user