Fixed failing HTTP unit tests from PSR-7

This commit is contained in:
Chris Boden 2016-02-11 18:24:29 -05:00
parent 2f79840f30
commit 524f879954
2 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,5 @@
<?php
namespace Ratchet\Http;
use Ratchet\Http\HttpRequestParser;
/**
* @covers Ratchet\Http\HttpRequestParser
@ -46,6 +45,6 @@ class HttpRequestParserTest extends \PHPUnit_Framework_TestCase {
$conn = $this->getMock('\Ratchet\ConnectionInterface');
$return = $this->parser->onMessage($conn, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n");
$this->assertInstanceOf('\Guzzle\Http\Message\RequestInterface', $return);
$this->assertInstanceOf('\Psr\Http\Message\RequestInterface', $return);
}
}

View File

@ -9,8 +9,8 @@ class OriginCheckTest extends AbstractMessageComponentTestCase {
protected $_reqStub;
public function setUp() {
$this->_reqStub = $this->getMock('Guzzle\Http\Message\RequestInterface');
$this->_reqStub->expects($this->any())->method('getHeader')->will($this->returnValue('localhost'));
$this->_reqStub = $this->getMock('Psr\Http\Message\RequestInterface');
$this->_reqStub->expects($this->any())->method('getHeader')->will($this->returnValue(['localhost']));
parent::setUp();
@ -34,7 +34,7 @@ class OriginCheckTest extends AbstractMessageComponentTestCase {
}
public function testCloseOnNonMatchingOrigin() {
$this->_serv->allowedOrigins = array('socketo.me');
$this->_serv->allowedOrigins = ['socketo.me'];
$this->_conn->expects($this->once())->method('close');
$this->_serv->onOpen($this->_conn, $this->_reqStub);