Skip to content

Commit 012a5ad

Browse files
committed
Merge pull request php-curl-class#74 from zachborboa/master
Add PHP 5.3 to continuous integration tests
2 parents e727593 + 007bea9 commit 012a5ad

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ php:
99

1010
matrix:
1111
allow_failures:
12+
- php: 5.3
1213
- php: 5.6
1314
- php: hhvm
1415

src/Curl/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function setReferrer($referrer)
204204
public function setCookie($key, $value)
205205
{
206206
$this->cookies[$key] = $value;
207-
$this->setOpt(CURLOPT_COOKIE, http_build_query($this->cookies, '', '; ', PHP_QUERY_RFC3986));
207+
$this->setOpt(CURLOPT_COOKIE, str_replace('+', '%20', http_build_query($this->cookies, '', '; ')));
208208
}
209209

210210
public function setCookieFile($cookie_file)

tests/PHPCurlClass/PHPCurlClassTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88

99
class CurlTest extends PHPUnit_Framework_TestCase
1010
{
11-
public function testExtensionLoaded()
11+
public function testExtensionsLoaded()
1212
{
1313
$this->assertTrue(extension_loaded('curl'));
14+
$this->assertTrue(extension_loaded('gd'));
1415
}
1516

1617
public function testArrayAssociative()

tests/before_script.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
if [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
1+
if [[ "${TRAVIS_PHP_VERSION}" == "5.3" ]]; then
2+
sudo add-apt-repository -y ppa:nginx/stable
3+
sudo apt-get update
4+
sudo apt-get install -y nginx
5+
sudo apt-get install -y php5-fpm
6+
root="$(pwd)/tests/PHPCurlClass"
7+
sudo tee /etc/nginx/sites-enabled/default <<EOF
8+
server {
9+
listen 8000 default_server;
10+
root ${root};
11+
index index.php;
12+
server_name localhost;
13+
location / {
14+
try_files \$uri \$uri/ /index.php =404;
15+
}
16+
location ~ \.php$ {
17+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
18+
fastcgi_pass 127.0.0.1:9000;
19+
fastcgi_index index.php;
20+
include fastcgi_params;
21+
}
22+
}
23+
EOF
24+
sudo /etc/init.d/nginx restart
25+
elif [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
226
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
327
elif [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then
428
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &

tests/script.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
find . -type "f" -iname "*.php" | xargs -L "1" php -l
2-
3-
if [[ "${TRAVIS_PHP_VERSION}" != "5.3" ]]; then
4-
cd tests && phpunit --configuration phpunit.xml
5-
fi
2+
cd tests && phpunit --configuration phpunit.xml

0 commit comments

Comments
 (0)