mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-29 19:54:49 +00:00
Fix #47: Add http header redirect parsing test
This commit is contained in:
@@ -381,6 +381,13 @@ class CurlTest extends PHPUnit_Framework_TestCase {
|
||||
$this->assertEquals($response_headers['eTaG'], $etag);
|
||||
}
|
||||
|
||||
public function testHeaderRedirect() {
|
||||
$test = new Test();
|
||||
$test->curl->setOpt(CURLOPT_FOLLOWLOCATION, true);
|
||||
$test->server('redirect', 'GET');
|
||||
$this->assertEquals($test->curl->response, 'OK');
|
||||
}
|
||||
|
||||
public function testRequestURL() {
|
||||
$test = new Test();
|
||||
$this->assertFalse(substr($test->server('request_uri', 'GET'), -1) === '?');
|
||||
|
||||
@@ -139,6 +139,15 @@ else if ($test === 'error_message') {
|
||||
}
|
||||
exit;
|
||||
}
|
||||
else if ($test === 'redirect') {
|
||||
if (!isset($_GET['redirect'])) {
|
||||
header('Location: ?redirect');
|
||||
exit;
|
||||
}
|
||||
|
||||
echo 'OK';
|
||||
exit;
|
||||
}
|
||||
|
||||
header('Content-Type: text/plain');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user