Initial commit - Last War messaging system
This commit is contained in:
39
vendor/ratchet/rfc6455/tests/unit/Handshake/ResponseVerifierTest.php
vendored
Executable file
39
vendor/ratchet/rfc6455/tests/unit/Handshake/ResponseVerifierTest.php
vendored
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Ratchet\RFC6455\Test\Unit\Handshake;
|
||||
|
||||
use Ratchet\RFC6455\Handshake\ResponseVerifier;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers Ratchet\RFC6455\Handshake\ResponseVerifier
|
||||
*/
|
||||
class ResponseVerifierTest extends TestCase {
|
||||
/**
|
||||
* @var ResponseVerifier
|
||||
*/
|
||||
protected $_v;
|
||||
|
||||
protected function setUp(): void {
|
||||
$this->_v = new ResponseVerifier;
|
||||
}
|
||||
|
||||
public static function subProtocolsProvider(): array {
|
||||
return [
|
||||
[true, ['a'], ['a']]
|
||||
, [true, ['c', 'd', 'a'], ['a']]
|
||||
, [true, ['c, a', 'd'], ['a']]
|
||||
, [true, [], []]
|
||||
, [true, ['a', 'b'], []]
|
||||
, [false, ['c', 'd', 'a'], ['b', 'a']]
|
||||
, [false, ['a', 'b', 'c'], ['d']]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider subProtocolsProvider
|
||||
*/
|
||||
public function testVerifySubProtocol(bool $expected, array $request, array $response): void {
|
||||
$this->assertEquals($expected, $this->_v->verifySubProtocol($request, $response));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user