Cleanup
CS Removed a var_dump Removed garbage from a unit test
This commit is contained in:
parent
935866c036
commit
0ef0410ab6
@ -40,8 +40,8 @@ class Hixie76 implements VersionInterface {
|
||||
, 'Sec-WebSocket-Location' => 'ws://' . $request->getHeader('Host', true) . $request->getPath()
|
||||
);
|
||||
|
||||
$response = new Response('101', $headers, $body);
|
||||
$response->setStatus('101', 'WebSocket Protocol Handshake');
|
||||
$response = new Response(101, $headers, $body);
|
||||
$response->setStatus(101, 'WebSocket Protocol Handshake');
|
||||
|
||||
return $response;
|
||||
}
|
||||
@ -68,7 +68,7 @@ class Hixie76 implements VersionInterface {
|
||||
}
|
||||
|
||||
public function generateKeyNumber($key) {
|
||||
if (0 === substr_count($key, ' ')) {
|
||||
if (0 === mb_substr_count($key, ' ', 'ASCII')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@ use Ratchet\WebSocket\Version\RFC6455\HandshakeVerifier;
|
||||
use Guzzle\Http\Message\RequestInterface;
|
||||
use Guzzle\Http\Message\Response;
|
||||
|
||||
|
||||
/**
|
||||
* @link http://tools.ietf.org/html/rfc6455
|
||||
*/
|
||||
|
@ -171,7 +171,6 @@ class WsServer implements MessageComponentInterface {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onError(ConnectionInterface $conn, \Exception $e) {
|
||||
var_dump($e);
|
||||
if ($conn->WebSocket->established) {
|
||||
$this->_decorating->onError($this->connections[$conn], $e);
|
||||
} else {
|
||||
|
@ -9,7 +9,7 @@ class Hixie76Test extends \PHPUnit_Framework_TestCase {
|
||||
protected $_version;
|
||||
|
||||
public function setUp() {
|
||||
$this->_version = new Hixie76();
|
||||
$this->_version = new Hixie76;
|
||||
}
|
||||
|
||||
public function testClassImplementsVersionInterface() {
|
||||
@ -18,27 +18,13 @@ class Hixie76Test extends \PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider HandshakeProvider
|
||||
*/
|
||||
public function INCOMPLETEtestKeySigningForHandshake($key, $accept) {
|
||||
// $this->assertEquals($accept, $this->_version->sign($key));
|
||||
}
|
||||
|
||||
public static function HandshakeProvider() {
|
||||
return array(
|
||||
array('', '')
|
||||
, array('', '')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider KeyProvider
|
||||
* @dataProvider keyProvider
|
||||
*/
|
||||
public function testKeySigningForHandshake($accept, $key) {
|
||||
$this->assertEquals($accept, $this->_version->generateKeyNumber($key));
|
||||
}
|
||||
|
||||
public static function KeyProvider() {
|
||||
public static function keyProvider() {
|
||||
return array(
|
||||
array(179922739, '17 9 G`ZD9 2 2b 7X 3 /r90')
|
||||
, array('', '17 9 G`ZD9 2 2b 7X 3 /r91')
|
||||
|
Loading…
Reference in New Issue
Block a user