Fix continuous integration tests for PHP 5.3.

Error message:
    Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in [...]
This commit is contained in:
Zach Borboa
2020-02-17 16:02:40 -08:00
parent 947848bd2a
commit 7340e8ede3
+9
View File
@@ -30,6 +30,10 @@ reload_nginx() {
$superuser /etc/init.d/nginx restart
}
php_v5_3_shim() {
remove_double_colon_class_name_resolution
}
phpunit_shim() {
# -class CurlTest extends \PHPUnit\Framework\TestCase
# +class CurlTest extends \PHPUnit_Framework_TestCase
@@ -51,6 +55,10 @@ phpunit_shim() {
sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/PHP"*
}
remove_double_colon_class_name_resolution() {
sed -i'' -e"/::class/d" "$(pwd)/tests/PHPCurlClass/PHP"*
}
remove_expectWarning() {
# Fix "Call to undefined method CurlTest\CurlTest::expectWarning()".
sed -i'' -e"/->expectWarning(/d" "$(pwd)/tests/PHPCurlClass/PHP"*
@@ -129,6 +137,7 @@ EOF
$superuser /etc/init.d/php5-fpm start
reload_nginx
phpunit_shim
php_v5_3_shim
elif [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
install_nginx
use_php_fpm