From 007bea958f9b3cbef7d2a7cb67eac71fa3a86139 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 16 Aug 2014 23:26:37 -0700 Subject: [PATCH] Fix #73: Add PHP 5.3 to continuous integration tests --- .travis.yml | 1 + src/Curl/Curl.php | 2 +- tests/PHPCurlClass/PHPCurlClassTest.php | 3 ++- tests/before_script.sh | 26 ++++++++++++++++++++++++- tests/script.sh | 5 +---- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28b51cb..a4a6196 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ php: matrix: allow_failures: + - php: 5.3 - php: 5.6 - php: hhvm diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 27e947e..aa20126 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -204,7 +204,7 @@ class Curl public function setCookie($key, $value) { $this->cookies[$key] = $value; - $this->setOpt(CURLOPT_COOKIE, http_build_query($this->cookies, '', '; ', PHP_QUERY_RFC3986)); + $this->setOpt(CURLOPT_COOKIE, str_replace('+', '%20', http_build_query($this->cookies, '', '; '))); } public function setCookieFile($cookie_file) diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index b8971a4..1d800f7 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -8,9 +8,10 @@ use \Helper\Test; class CurlTest extends PHPUnit_Framework_TestCase { - public function testExtensionLoaded() + public function testExtensionsLoaded() { $this->assertTrue(extension_loaded('curl')); + $this->assertTrue(extension_loaded('gd')); } public function testArrayAssociative() diff --git a/tests/before_script.sh b/tests/before_script.sh index 9dae6d3..ac23bba 100644 --- a/tests/before_script.sh +++ b/tests/before_script.sh @@ -1,4 +1,28 @@ -if [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then +if [[ "${TRAVIS_PHP_VERSION}" == "5.3" ]]; then + sudo add-apt-repository -y ppa:nginx/stable + sudo apt-get update + sudo apt-get install -y nginx + sudo apt-get install -y php5-fpm + root="$(pwd)/tests/PHPCurlClass" + sudo tee /etc/nginx/sites-enabled/default <