[TESTS] Fixing unit tests for versions
Adding a unit test for Hixie and fixing the unit test for RFC
This commit is contained in:
parent
2996c08728
commit
10da7e4920
@ -30,4 +30,23 @@ class Hixie76Test extends \PHPUnit_Framework_TestCase {
|
|||||||
, array('', '')
|
, array('', '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider KeyProvider
|
||||||
|
*/
|
||||||
|
public function testKeySigningForHandshake($accept, $key) {
|
||||||
|
$this->assertEquals($accept, $this->_version->generateKeyNumber($key));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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')
|
||||||
|
, array('906585445', '3e6b263 4 17 80')
|
||||||
|
, array('', '3e6b263 4 17 80')
|
||||||
|
, array('', '3e6b63 4 17 80')
|
||||||
|
, array('', '3e6b6341780')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
@ -119,7 +119,7 @@ class RFC6455Test extends \PHPUnit_Framework_TestCase {
|
|||||||
$request = RequestFactory::fromMessage($header);
|
$request = RequestFactory::fromMessage($header);
|
||||||
|
|
||||||
if ($pass) {
|
if ($pass) {
|
||||||
$this->assertTrue(is_array($this->_version->handshake($request)));
|
$this->assertInstanceOf('\\Guzzle\\Http\\Message\\Response', $this->_version->handshake($request));
|
||||||
} else {
|
} else {
|
||||||
$this->setExpectedException('InvalidArgumentException');
|
$this->setExpectedException('InvalidArgumentException');
|
||||||
$this->_version->handshake($request);
|
$this->_version->handshake($request);
|
||||||
|
Loading…
Reference in New Issue
Block a user