#49 Fixed WsServer::getSubProtocolString method return value and related unit-test

This commit is contained in:
Vladimir Kartaviy 2012-09-22 01:18:53 +03:00
parent eef375ddae
commit 410550b3b2
2 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ class WsServer implements MessageComponentInterface {
} }
} }
return substr($string, 0, -1); return substr($string, 0, -1) ?: '';
} }
/** /**

View File

@ -45,6 +45,6 @@ class WsServerTest extends \PHPUnit_Framework_TestCase {
$method = $class->getMethod('getSubProtocolString'); $method = $class->getMethod('getSubProtocolString');
$method->setAccessible(true); $method->setAccessible(true);
$this->assertEquals($expected, $method->invokeArgs($this->serv, array($req))); $this->assertSame($expected, $method->invokeArgs($this->serv, array($req)));
} }
} }