mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-18 16:31:34 +00:00
Update server used in PHP 5.4, 5.5, and 5.6 tests.
This change updates the server used for PHP 5.4, 5.5, and 5.6 tests in order to support SEARCH requests. Using the PHP built-in web server in these versions errors with 501 Not Implemented / Request method not supported.
This commit is contained in:
+43
-5
@@ -1,3 +1,35 @@
|
||||
install_nginx() {
|
||||
$superuser apt-get install -y nginx
|
||||
}
|
||||
|
||||
use_php_fpm() {
|
||||
root="$(pwd)/tests/PHPCurlClass"
|
||||
$superuser tee /etc/nginx/sites-enabled/default <<EOF
|
||||
server {
|
||||
listen 8000 default_server;
|
||||
root ${root};
|
||||
index index.php;
|
||||
server_name localhost;
|
||||
location / {
|
||||
rewrite ^ /index.php last;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
||||
fastcgi_param "PHP_CURL_CLASS_TEST_MODE_ENABLED" "yes";
|
||||
}
|
||||
}
|
||||
EOF
|
||||
$superuser php-fpm --daemonize
|
||||
}
|
||||
|
||||
reload_nginx() {
|
||||
$superuser /etc/init.d/nginx restart
|
||||
}
|
||||
|
||||
phpunit_shim() {
|
||||
# -class CurlTest extends \PHPUnit\Framework\TestCase
|
||||
# +class CurlTest extends \PHPUnit_Framework_TestCase
|
||||
@@ -50,7 +82,7 @@ if [[ "${TRAVIS_PHP_VERSION}" == "5.3" ]]; then
|
||||
fi
|
||||
$superuser add-apt-repository -y ppa:nginx/development
|
||||
$superuser apt-get update
|
||||
$superuser apt-get install -y nginx
|
||||
install_nginx
|
||||
$superuser apt-get install -y php5-fpm
|
||||
root="$(pwd)/tests/PHPCurlClass"
|
||||
$superuser tee /etc/nginx/sites-enabled/default <<EOF
|
||||
@@ -73,16 +105,22 @@ server {
|
||||
}
|
||||
EOF
|
||||
$superuser /etc/init.d/php5-fpm start
|
||||
$superuser /etc/init.d/nginx restart
|
||||
reload_nginx
|
||||
phpunit_shim
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
|
||||
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
|
||||
install_nginx
|
||||
use_php_fpm
|
||||
reload_nginx
|
||||
phpunit_shim
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then
|
||||
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
|
||||
install_nginx
|
||||
use_php_fpm
|
||||
reload_nginx
|
||||
phpunit_shim
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then
|
||||
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
|
||||
install_nginx
|
||||
use_php_fpm
|
||||
reload_nginx
|
||||
phpunit_shim
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "7.0" ]]; then
|
||||
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
FROM php:5.4-cli
|
||||
FROM php:5.4-fpm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Fix error:
|
||||
# "W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease Unable to find expected
|
||||
# entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)
|
||||
# E: Some index files failed to download. They have been ignored, or old ones used instead."
|
||||
RUN printf "%s\n" \
|
||||
"deb http://archive.debian.org/debian/ jessie main" \
|
||||
"deb-src http://archive.debian.org/debian/ jessie main" \
|
||||
"deb http://security.debian.org jessie/updates main" \
|
||||
"deb-src http://security.debian.org jessie/updates main" \
|
||||
> /etc/apt/sources.list
|
||||
|
||||
RUN apt-get --assume-yes --quiet update
|
||||
|
||||
RUN apt-get --assume-yes --quiet install git && \
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
FROM php:5.5-cli
|
||||
FROM php:5.5-fpm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Fix error:
|
||||
# "E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?".
|
||||
RUN printf "%s\n" \
|
||||
"deb http://archive.debian.org/debian/ jessie main" \
|
||||
"deb-src http://archive.debian.org/debian/ jessie main" \
|
||||
"deb http://security.debian.org jessie/updates main" \
|
||||
"deb-src http://security.debian.org jessie/updates main" \
|
||||
> /etc/apt/sources.list
|
||||
|
||||
RUN apt-get --assume-yes --quiet update
|
||||
|
||||
RUN apt-get --assume-yes --quiet install git && \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM php:5.6-cli
|
||||
FROM php:5.6-fpm
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get --assume-yes --quiet update
|
||||
|
||||
Reference in New Issue
Block a user