mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-10-14 16:08:34 +00:00
fd902b4b7c
* Add shims for PHPUnit * Fix PHPUnit error: undefined method returnValue() 1) CurlTest\PHPCurlClassTest::testMock Error: Call to undefined method CurlTest\PHPCurlClassTest::returnValue() * Fix PHPUnit risky test by restoring error handler before exception thrown There was 1 risky test: 1) CurlTest\PHPCurlClassTest::testRequiredOptionCurlOptReturnTransferEmitsWarningPHPUnit10Plus Test code or tested code did not remove its own error handlers * Fix psalm errors * Add attributes for version constraint * Temporarily pin psalm to fix ci
45 lines
1.0 KiB
Bash
Executable File
45 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -x
|
|
|
|
if [[ "${CI}" == "true" ]]; then
|
|
composer self-update
|
|
composer install --prefer-source --no-interaction
|
|
fi
|
|
|
|
|
|
# Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable.
|
|
export PATH="${PWD}/vendor/bin:${PATH}"
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "${SCRIPT_DIR}"
|
|
|
|
source "set_vars.inc.sh"
|
|
|
|
echo "CI_PHP_VERSION: ${CI_PHP_VERSION}"
|
|
echo "CI_PHP_FUTURE_RELEASE: ${CI_PHP_FUTURE_RELEASE}"
|
|
php -r "var_dump(phpversion());"
|
|
php -r "var_dump(curl_version());"
|
|
|
|
errors=()
|
|
|
|
source "run_syntax_check.sh"
|
|
|
|
source "run_coding_standards_check.sh"
|
|
|
|
source "run_phpunit.sh"
|
|
|
|
source "run_static_analysis_check_phpstan.sh"
|
|
|
|
source "run_static_analysis_check_psalm.sh"
|
|
|
|
set +x
|
|
|
|
source "display_errors.inc.sh"
|
|
|
|
if [[ "${CI_PHP_FUTURE_RELEASE}" != "true" ]]; then
|
|
exit "${#errors[@]}"
|
|
elif [[ "${#errors[@]}" -ne 0 ]]; then
|
|
echo "One or more tests failed, but allowed as the CI_PHP_FUTURE_RELEASE flag is on for PHP version ${CI_PHP_VERSION}."
|
|
fi
|