From 702e4a13eab6ec6a8d8cfdfbed0b817c79089832 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Mon, 17 Feb 2020 14:44:45 -0800 Subject: [PATCH] Fix continuous integration tests for PHP 7.1. There was 1 failure: 1) CurlTest\CurlTest::testRequiredOptionCurlOptReturnTransferEmitsWarning Failed asserting that exception of type "Error" matches expected exception "\PHPUnit\Framework\Error\Warning". Message was: "Call to undefined method CurlTest\CurlTest::expectWarning()" at ./tests/PHPCurlClass/PHPCurlClassTest.php:3036 --- tests/before_script.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/before_script.sh b/tests/before_script.sh index 73486ab..d05fe55 100755 --- a/tests/before_script.sh +++ b/tests/before_script.sh @@ -51,6 +51,11 @@ phpunit_shim() { sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/PHP"* } +phpunit_v7_5_shim() { + # Fix "Call to undefined method CurlTest\CurlTest::expectWarning()". + sed -i'' -e"/->expectWarning(/d" "$(pwd)/tests/PHPCurlClass/PHPCurlClassTest.php" +} + set -x echo "TRAVIS_PHP_VERSION: ${TRAVIS_PHP_VERSION}" php -r "var_dump(phpversion());" @@ -125,6 +130,7 @@ elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then elif [[ "${TRAVIS_PHP_VERSION}" == "7.0" ]]; then php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ & elif [[ "${TRAVIS_PHP_VERSION}" == "7.1" ]]; then + phpunit_v7_5_shim php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ & elif [[ "${TRAVIS_PHP_VERSION}" == "7.2" ]]; then php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &