test: add testSendProxied

This commit is contained in:
Jozef Rebjak 2023-06-26 13:52:36 +02:00
parent 1db90c402b
commit 9a41f6b18c
No known key found for this signature in database
GPG Key ID: FA4CD0840816FD28

View File

@ -718,6 +718,18 @@ final class CURLRequestTest extends CIUnitTestCase
$this->assertSame('Hi there', $response->getBody());
}
public function testSendProxied()
{
$request = $this->getRequest([
'base_uri' => 'http://www.foo.com/api/v1/',
'delay' => 100,
]);
$request->setOutput("HTTP/1.1 200 Connection established:\x0d\x0a\x0d\x0aHi there");
$response = $request->get('answer');
$this->assertSame('Hi there', $response->getBody());
}
/**
* See: https://github.com/codeigniter4/CodeIgniter4/issues/3261
*/