#49 Fixed WsServer::getSubProtocolString method return value and related unit-test
This commit is contained in:
parent
eef375ddae
commit
410550b3b2
@ -208,7 +208,7 @@ class WsServer implements MessageComponentInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return substr($string, 0, -1);
|
return substr($string, 0, -1) ?: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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)));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user