Fix #31: Combine multiple header fields into a comma-separated list

This commit is contained in:
Zach Borboa
2014-03-29 02:24:04 -07:00
parent 967181499a
commit 93350fe3a9
3 changed files with 13 additions and 1 deletions
+6
View File
@@ -277,6 +277,12 @@ class CurlTest extends PHPUnit_Framework_TestCase {
$this->assertFalse(file_exists($cookie_file));
}
public function testMultipleCookieResponse() {
$test = new Test();
$test->server('multiple_cookie', 'GET');
$this->assertEquals($test->curl->response_headers['Set-Cookie'], 'cookie1=scrumptious,cookie2=mouthwatering');
}
public function testError() {
$test = new Test();
$test->curl->setOpt(CURLOPT_CONNECTTIMEOUT_MS, 2000);
+5
View File
@@ -80,6 +80,11 @@ else if ($test === 'cookiejar') {
setcookie('mycookie', 'yum');
exit;
}
else if ($test === 'multiple_cookie') {
setcookie('cookie1', 'scrumptious');
setcookie('cookie2', 'mouthwatering');
exit;
}
else if ($test === 'response_header') {
header('Content-Type: application/json');
header('ETag: ' . md5('worldpeace'));