From 96b3d50c2eaaaf0e303b7d93bef612adead884e2 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 24 Dec 2016 12:16:10 -0800 Subject: [PATCH] Simplify setCookie tests --- tests/PHPCurlClass/PHPCurlClassTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index b9f3987..50fcb0b 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -957,9 +957,8 @@ class CurlTest extends PHPUnit_Framework_TestCase { $test = new Test(); $test->curl->setCookie('mycookie', 'yum'); - $this->assertEquals('yum', $test->server('cookie', 'GET', array( - 'key' => 'mycookie', - ))); + $test->server('setcookie', 'GET'); + $this->assertEquals('yum', $test->curl->responseCookies['mycookie']); } public function testSetCookies() @@ -971,9 +970,11 @@ class CurlTest extends PHPUnit_Framework_TestCase ); $test = new Test(); $test->curl->setCookies($cookies); - $test->server('cookie', 'GET'); + $test->server('setcookie', 'GET'); - $this->assertEquals(http_build_query($cookies, '', '&'), $test->curl->response); + $this->assertEquals('yum', $test->curl->responseCookies['mycookie']); + $this->assertEquals('apple', $test->curl->responseCookies['fruit']); + $this->assertEquals('red', $test->curl->responseCookies['color']); } public function testSetCookieEncodingSpace()