diff --git a/tests/ci.sh b/tests/ci.sh index 78be95e..2ce5ae0 100755 --- a/tests/ci.sh +++ b/tests/ci.sh @@ -24,6 +24,14 @@ phpunit_v8_1_shim() { remove_expectWarning } +php_v7_0_shim() { + # -protected function setUp(): void + # +protected function setUp() + find='protected function setUp(): void' + replace='protected function setUp()' + sed -i'' -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* +} + set -x composer self-update @@ -76,6 +84,10 @@ elif [[ "${phpunit_version}" == "8.1."* ]]; then phpunit_v8_1_shim fi +if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then + php_v7_0_shim +fi + # Run tests. "${phpunit_to_use}" --version "${phpunit_to_use}" \ diff --git a/tests/run.sh b/tests/run.sh index 112cb0b..079df22 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -24,6 +24,14 @@ phpunit_v8_1_shim() { remove_expectWarning } +php_v7_0_shim() { + # -protected function setUp(): void + # +protected function setUp() + find='protected function setUp(): void' + replace='protected function setUp()' + sed -i'' -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* +} + set -x # Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable. @@ -73,6 +81,10 @@ elif [[ "${phpunit_version}" == "8.1."* ]]; then phpunit_v8_1_shim fi +if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then + php_v7_0_shim +fi + # Run tests. extra_args="${@}" "${phpunit_to_use}" --version