Add test to ensure request url contains "?" only when explicitly specified in the url

This commit is contained in:
Zach Borboa
2013-12-13 22:42:54 -08:00
parent 76f6b3400a
commit 54bb4a943b
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -188,4 +188,11 @@ class CurlTest extends PHPUnit_Framework_TestCase {
'key' => 'HTTP_ACCEPT',
)) === 'application/json');
}
public function testRequestURL() {
$test = new Test();
$this->assertFalse(substr($test->server('request_uri', 'POST'), -1) === '?');
$test = new Test();
$this->assertFalse(substr($test->server('request_uri', 'GET'), -1) === '?');
}
}
+4
View File
@@ -43,6 +43,10 @@ else if ($test === 'request_method') {
echo $request_method;
exit;
}
else if ($test === 'request_uri') {
echo $_SERVER['REQUEST_URI'];
exit;
}
header('Content-Type: text/plain');