Fix #47: Add http header redirect parsing test

This commit is contained in:
Zach Borboa
2014-04-28 19:45:36 -07:00
parent c315c5f920
commit aa71e75cea
2 changed files with 16 additions and 0 deletions
+7
View File
@@ -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) === '?');
+9
View File
@@ -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');