phpunit_shim() { # -class CurlTest extends \PHPUnit\Framework\TestCase # +class CurlTest extends \PHPUnit_Framework_TestCase find='class CurlTest extends \\PHPUnit\\Framework\\TestCase' replace='class CurlTest extends \\PHPUnit_Framework_TestCase' sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/PHP"* # -\PHPUnit\Framework\Assert # +\PHPUnit_Framework_Assert find='\\PHPUnit\\Framework\\Assert' replace='\\PHPUnit_Framework_Assert' sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/PHP"* sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/Helper.php" # -\PHPUnit\Framework\Error\Warning # +\PHPUnit_Framework_Error_Warning find='\\PHPUnit\\Framework\\Error\\Warning' replace='\\PHPUnit_Framework_Error_Warning' sed -i'' -e"s/${find}/${replace}/" "$(pwd)/tests/PHPCurlClass/PHP"* } set -x echo "TRAVIS_PHP_VERSION: ${TRAVIS_PHP_VERSION}" php -r "var_dump(phpversion());" php -r "var_dump(curl_version());" composer self-update composer install --prefer-source --no-interaction # Use docker-specific settings. if [ -f "/.dockerenv" ]; then # Skip using sudo. superuser="" # Use unix socket. fastcgi_pass="unix:/var/run/php5-fpm.sock" else # Use sudo. superuser="sudo" # Use ip socket. fastcgi_pass="127.0.0.1:9000" fi # Let test server know we should allow testing. export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" if [[ "${TRAVIS_PHP_VERSION}" == "5.3" ]]; then if ! [ -x "$(command -v add-apt-repository)" ]; then $superuser apt-get install -y python-software-properties fi $superuser add-apt-repository -y ppa:nginx/development $superuser apt-get update $superuser apt-get install -y nginx $superuser apt-get install -y php5-fpm root="$(pwd)/tests/PHPCurlClass" $superuser tee /etc/nginx/sites-enabled/default <