update 1.0.8.0
Commits for version update
This commit is contained in:
24
vendor/guzzlehttp/psr7/tests/FunctionsTest.php
vendored
24
vendor/guzzlehttp/psr7/tests/FunctionsTest.php
vendored
@@ -439,7 +439,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = new Psr7\Request('PUT', 'http://foo.com/hi?123', [
|
||||
'Baz' => 'bar',
|
||||
'Qux' => ' ipsum'
|
||||
'Qux' => 'ipsum'
|
||||
], 'hello', '1.0');
|
||||
$this->assertEquals(
|
||||
"PUT /hi?123 HTTP/1.0\r\nHost: foo.com\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello",
|
||||
@@ -451,7 +451,7 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$response = new Psr7\Response(200, [
|
||||
'Baz' => 'bar',
|
||||
'Qux' => ' ipsum'
|
||||
'Qux' => 'ipsum'
|
||||
], 'hello', '1.0', 'FOO');
|
||||
$this->assertEquals(
|
||||
"HTTP/1.0 200 FOO\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello",
|
||||
@@ -573,8 +573,13 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testReturnsAsIsWhenNoChanges()
|
||||
{
|
||||
$request = new Psr7\Request('GET', 'http://foo.com');
|
||||
$this->assertSame($request, Psr7\modify_request($request, []));
|
||||
$r1 = new Psr7\Request('GET', 'http://foo.com');
|
||||
$r2 = Psr7\modify_request($r1, []);
|
||||
$this->assertTrue($r2 instanceof Psr7\Request);
|
||||
|
||||
$r1 = new Psr7\ServerRequest('GET', 'http://foo.com');
|
||||
$r2 = Psr7\modify_request($r1, []);
|
||||
$this->assertTrue($r2 instanceof \Psr\Http\Message\ServerRequestInterface);
|
||||
}
|
||||
|
||||
public function testReturnsUriAsIsWhenNoChanges()
|
||||
@@ -600,4 +605,15 @@ class FunctionsTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotSame($r1, $r2);
|
||||
$this->assertEquals('foo=bar', $r2->getUri()->getQuery());
|
||||
}
|
||||
|
||||
public function testModifyRequestKeepInstanceOfRequest()
|
||||
{
|
||||
$r1 = new Psr7\Request('GET', 'http://foo.com');
|
||||
$r2 = Psr7\modify_request($r1, ['remove_headers' => ['non-existent']]);
|
||||
$this->assertTrue($r2 instanceof Psr7\Request);
|
||||
|
||||
$r1 = new Psr7\ServerRequest('GET', 'http://foo.com');
|
||||
$r2 = Psr7\modify_request($r1, ['remove_headers' => ['non-existent']]);
|
||||
$this->assertTrue($r2 instanceof \Psr\Http\Message\ServerRequestInterface);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user