Fix #73: Add PHP 5.3 to continuous integration tests

This commit is contained in:
Zach Borboa
2014-08-16 23:26:37 -07:00
parent e7275937bf
commit 007bea958f
5 changed files with 30 additions and 7 deletions
+1
View File
@@ -9,6 +9,7 @@ php:
matrix:
allow_failures:
- php: 5.3
- php: 5.6
- php: hhvm
+1 -1
View File
@@ -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)
+2 -1
View File
@@ -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()
+25 -1
View File
@@ -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 <<EOF
server {
listen 8000 default_server;
root ${root};
index index.php;
server_name localhost;
location / {
try_files \$uri \$uri/ /index.php =404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
EOF
sudo /etc/init.d/nginx restart
elif [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
elif [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
+1 -4
View File
@@ -1,5 +1,2 @@
find . -type "f" -iname "*.php" | xargs -L "1" php -l
if [[ "${TRAVIS_PHP_VERSION}" != "5.3" ]]; then
cd tests && phpunit --configuration phpunit.xml
fi
cd tests && phpunit --configuration phpunit.xml