Fix setting of options by passing of MultiCurl options to new Curl
instances earlier. Set options during the Curl initialization instead of
waiting until the request instance is configured in
MultiCurl::initHandle().
Fixes error:
$ ./tests/check_coding_standards.sh
PHP_CodeSniffer version 3.7.1 (stable) by Squiz (http://www.squiz.net)
ERROR: Referenced sniff "PHPCS23Utils" does not exist
Run "phpcs --help" for usage information
Error: found standard violation(s)
Comment out installed_paths config to fix error:
$ ./tests/check_coding_standards.sh
PHP_CodeSniffer version 3.7.1 (stable) by Squiz (http://www.squiz.net)
ERROR: Referenced sniff "PHPCS23Utils" does not exist
Run "phpcs --help" for usage information
Error: found standard violation(s)
PHP 8 error messages:
TypeError: array_keys(): Argument #1 ($array) must be of type array, stdClass given
TypeError: array_values(): Argument #1 ($array) must be of type array, stdClass given
PHP 7 error messages:
TypeError: array_keys() expects parameter 1 to be array, object given
TypeError: array_values() expects parameter 1 to be array, object given
This change allows continuous integration test failures on future PHP
releases without triggering some of the user interface warnings:
- Red x mark instead of a green checkmark
- Pull request merge warning:
"Some checks were not successful
7 successful and 1 failing checks"
The void return type was implemented in PHP 7.1 and PHP 7.0 treats the
void return type as a class name.
Errors:
1) CurlTest\CurlTest::testExtensionsLoaded
TypeError: Return value of CurlTest\CurlTest::setUp() must be an instance of CurlTest\void, none returned
/home/runner/work/php-curl-class/php-curl-class/tests/PHPCurlClass/PHPCurlClassTest.php:18
2) CurlTest\CurlTest::testCaseInsensitiveArrayGet
TypeError: Return value of CurlTest\CurlTest::setUp() must be an instance of CurlTest\void, none returned
/home/runner/work/php-curl-class/php-curl-class/tests/PHPCurlClass/PHPCurlClassTest.php:18
3) CurlTest\CurlTest::testCaseInsensitiveArraySet
TypeError: Return value of CurlTest\CurlTest::setUp() must be an instance of CurlTest\void, none returned
/home/runner/work/php-curl-class/php-curl-class/tests/PHPCurlClass/PHPCurlClassTest.php:18
[...]
Enable the PHP_CURL_CLASS_SKIP_SLOW_TESTS flag to skip the slow tests:
$ time ./tests/run.sh
real 16m24.624s ←
user 0m1.682s
sys 0m1.645s
$ time PHP_CURL_CLASS_SKIP_SLOW_TESTS=1 ./tests/run.sh
real 0m47.441s ←
user 0m20.005s
sys 0m10.802s