From 525be941e06c2a128bf5e6e48420505da776cde1 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 4 Feb 2021 09:50:28 -0800 Subject: [PATCH] Add test for php5 for pure php implementation (#8251) * Add test for php5 for pure php implementation * Add php5.6 to docker image * Add php5.6 to php 32-bit docker image --- kokoro/linux/dockerfile/test/php/Dockerfile | 20 +++++++++++++++++++ .../dockerfile/test/php_32bit/Dockerfile | 19 ++++++++++++++++++ php/composer.json | 4 ++-- tests.sh | 11 ++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/kokoro/linux/dockerfile/test/php/Dockerfile b/kokoro/linux/dockerfile/test/php/Dockerfile index f2fe836a55..4c9d69d181 100644 --- a/kokoro/linux/dockerfile/test/php/Dockerfile +++ b/kokoro/linux/dockerfile/test/php/Dockerfile @@ -55,6 +55,26 @@ RUN mv composer.phar /usr/local/bin/composer # Download php source code RUN git clone https://github.com/php/php-src +# php 5.6 +RUN cd php-src \ + && git checkout PHP-5.6.39 \ + && ./buildconf --force +RUN cd php-src \ + && ./configure \ + --enable-bcmath \ + --enable-mbstring \ + --with-gmp \ + --with-openssl \ + --with-zlib \ + --prefix=/usr/local/php-5.6 \ + && make \ + && make install \ + && make clean + +RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \ + && chmod +x phpunit \ + && mv phpunit /usr/local/php-5.6/bin + # php 7.0 RUN cd php-src \ && git checkout PHP-7.0.33 \ diff --git a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile b/kokoro/linux/dockerfile/test/php_32bit/Dockerfile index ed2acbef7c..d657af1649 100644 --- a/kokoro/linux/dockerfile/test/php_32bit/Dockerfile +++ b/kokoro/linux/dockerfile/test/php_32bit/Dockerfile @@ -53,6 +53,25 @@ RUN mv composer.phar /usr/local/bin/composer # Download php source code RUN git clone https://github.com/php/php-src +# php 5.6 +RUN cd php-src \ + && git checkout PHP-5.6.39 \ + && ./buildconf --force +RUN cd php-src \ + && ./configure \ + --enable-bcmath \ + --enable-mbstring \ + --with-openssl \ + --with-zlib \ + --prefix=/usr/local/php-5.6 \ + && make \ + && make install \ + && make clean + +RUN wget -O phpunit https://phar.phpunit.de/phpunit-5.phar \ + && chmod +x phpunit \ + && mv phpunit /usr/local/php-5.6/bin + # php 7.0 RUN wget https://github.com/php/php-src/archive/php-7.0.33.tar.gz -O /var/local/php-7.0.33.tar.gz diff --git a/php/composer.json b/php/composer.json index 28d379bdec..4c1b5ac675 100644 --- a/php/composer.json +++ b/php/composer.json @@ -6,10 +6,10 @@ "homepage": "https://developers.google.com/protocol-buffers/", "license": "BSD-3-Clause", "require": { - "php": ">=7.0.0" + "php": ">=5.5.0" }, "require-dev": { - "phpunit/phpunit": ">=6.0.0" + "phpunit/phpunit": ">=5.0.0" }, "autoload": { "psr-4": { diff --git a/tests.sh b/tests.sh index 75ebc12c7d..1135f95ca8 100755 --- a/tests.sh +++ b/tests.sh @@ -484,6 +484,16 @@ use_php_zts() { internal_build_cpp } +build_php5.6() { + use_php 5.6 + pushd php + rm -rf vendor + composer update + composer test + popd + (cd conformance && make test_php) +} + build_php7.0() { use_php 7.0 pushd php @@ -683,6 +693,7 @@ build_php8.0_all() { } build_php_all_32() { + build_php5.6 build_php7.0 build_php7.1 build_php7.4