[TESTS] Fixing unit tests for versions

Adding a unit test for Hixie and fixing the unit test for RFC
This commit is contained in:
Mike Almond 2012-02-01 13:17:51 -05:00
parent 2996c08728
commit 10da7e4920
2 changed files with 20 additions and 1 deletions

View File

@ -30,4 +30,23 @@ class Hixie76Test extends \PHPUnit_Framework_TestCase {
, 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')
);
}
}

View File

@ -119,7 +119,7 @@ class RFC6455Test extends \PHPUnit_Framework_TestCase {
$request = RequestFactory::fromMessage($header);
if ($pass) {
$this->assertTrue(is_array($this->_version->handshake($request)));
$this->assertInstanceOf('\\Guzzle\\Http\\Message\\Response', $this->_version->handshake($request));
} else {
$this->setExpectedException('InvalidArgumentException');
$this->_version->handshake($request);