mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-14 12:26:51 +00:00
Fix continuous integration tests for PHP 7.0.
There was 1 error:
1) CurlTest\CurlTest::testMultipartFormDataContentType
Error: Call to undefined method CurlTest\CurlTest::assertStringContainsString()
./tests/PHPCurlClass/PHPCurlClassTest.php:590
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
This commit is contained in:
+20
-2
@@ -51,9 +51,26 @@ phpunit_shim() {
|
||||
sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/PHP"*
|
||||
}
|
||||
|
||||
phpunit_v7_5_shim() {
|
||||
remove_expectWarning() {
|
||||
# Fix "Call to undefined method CurlTest\CurlTest::expectWarning()".
|
||||
sed -i'' -e"/->expectWarning(/d" "$(pwd)/tests/PHPCurlClass/PHPCurlClassTest.php"
|
||||
sed -i'' -e"/->expectWarning(/d" "$(pwd)/tests/PHPCurlClass/PHP"*
|
||||
}
|
||||
|
||||
replace_assertStringContainsString() {
|
||||
# -->assertStringContainsString(
|
||||
# +->assertContains(
|
||||
find='->assertStringContainsString('
|
||||
replace='->assertContains('
|
||||
sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/PHP"*
|
||||
}
|
||||
|
||||
phpunit_v6_5_shim() {
|
||||
remove_expectWarning
|
||||
replace_assertStringContainsString
|
||||
}
|
||||
|
||||
phpunit_v7_5_shim() {
|
||||
remove_expectWarning
|
||||
}
|
||||
|
||||
set -x
|
||||
@@ -128,6 +145,7 @@ elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then
|
||||
reload_nginx
|
||||
phpunit_shim
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "7.0" ]]; then
|
||||
phpunit_v6_5_shim
|
||||
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
|
||||
elif [[ "${TRAVIS_PHP_VERSION}" == "7.1" ]]; then
|
||||
phpunit_v7_5_shim
|
||||
|
||||
Reference in New Issue
Block a user