Fixed failing HTTP unit tests from PSR-7
This commit is contained in:
parent
2f79840f30
commit
524f879954
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Ratchet\Http;
|
namespace Ratchet\Http;
|
||||||
use Ratchet\Http\HttpRequestParser;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Ratchet\Http\HttpRequestParser
|
* @covers Ratchet\Http\HttpRequestParser
|
||||||
@ -46,6 +45,6 @@ class HttpRequestParserTest extends \PHPUnit_Framework_TestCase {
|
|||||||
$conn = $this->getMock('\Ratchet\ConnectionInterface');
|
$conn = $this->getMock('\Ratchet\ConnectionInterface');
|
||||||
$return = $this->parser->onMessage($conn, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n");
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@ class OriginCheckTest extends AbstractMessageComponentTestCase {
|
|||||||
protected $_reqStub;
|
protected $_reqStub;
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
$this->_reqStub = $this->getMock('Guzzle\Http\Message\RequestInterface');
|
$this->_reqStub = $this->getMock('Psr\Http\Message\RequestInterface');
|
||||||
$this->_reqStub->expects($this->any())->method('getHeader')->will($this->returnValue('localhost'));
|
$this->_reqStub->expects($this->any())->method('getHeader')->will($this->returnValue(['localhost']));
|
||||||
|
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ class OriginCheckTest extends AbstractMessageComponentTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testCloseOnNonMatchingOrigin() {
|
public function testCloseOnNonMatchingOrigin() {
|
||||||
$this->_serv->allowedOrigins = array('socketo.me');
|
$this->_serv->allowedOrigins = ['socketo.me'];
|
||||||
$this->_conn->expects($this->once())->method('close');
|
$this->_conn->expects($this->once())->method('close');
|
||||||
|
|
||||||
$this->_serv->onOpen($this->_conn, $this->_reqStub);
|
$this->_serv->onOpen($this->_conn, $this->_reqStub);
|
||||||
|
Loading…
Reference in New Issue
Block a user