Commit Graph

520 Commits

Author SHA1 Message Date
Zach Borboa 8666fc38fb Add exclusion to fix incorrectly flagged error
Error message:

    FILE: ...lass/php-curl-class/tests/PHPCurlClass/PHPMultiCurlClassTest.php
    ----------------------------------------------------------------------
    FOUND 8 ERRORS AFFECTING 8 LINES
    ----------------------------------------------------------------------
    3575 | ERROR | list() will assign variable from left-to-right since
        |       | PHP 7.0. Ensure all variables in list() are unique to
        |       | prevent unexpected results.
        |       | (PHPCompatibility.Lists.AssignmentOrder.Affected)
    [...]
    ----------------------------------------------------------------------
2022-09-23 10:15:20 -07:00
Zach Borboa 3ddc22e590 Fix installed_paths config for PHPCS23Utils
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)
2022-09-23 08:25:55 -07:00
Zach Borboa 6ce21bb755 Update PHPCompatibility
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)
2022-09-23 07:59:39 -07:00
Zach Borboa 3ff53bfbdf Replace egrep with grep --extended-regexp' (grep -E')
Warning message:
    egrep: warning: egrep is obsolescent; using grep -E
2022-09-23 07:14:56 -07:00
Zach Borboa e8b66975d0 Fix risky test missing assertion 2022-08-23 14:19:57 -07:00
Zach Borboa c2eec0667e Fix building post data for object
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
2022-08-19 09:46:26 -04:00
Zach Borboa 85e94ba1b1 Fix #725: Encode keys for post data with numeric keys 2022-07-28 23:47:29 -04:00
Zach Borboa a33b7bde4e Fix #707: Call MultiCurl::beforeSend() before each request is made 2022-07-01 11:21:57 -04:00
Zach Borboa 30ffe42915 Fix #712: Retain keys for arrays with null values 2022-06-23 12:44:46 -04:00
Zach Borboa 2e9c738de4 Improve future release flag warning message 2022-06-23 09:47:38 -04:00
Zach Borboa 523386ec01 Fix #714: Attempt to stop active requests when MultiCurl::stop() is called 2022-06-23 08:26:20 -04:00
Zach Borboa 12b5757c22 Implement MultiCurl::stop() 2022-03-10 18:29:48 -08:00
Zach Borboa dc4d0db091 Rename variable 2022-03-10 18:29:40 -08:00
Zach Borboa 1b64ab6e84 Add shebang to fix bash invalid option error
Error:
    ++ declare -A pids
    ./run.sh: line 55: declare: -A: invalid option
    declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
2022-03-10 18:17:03 -08:00
Zach Borboa 9c03d19715 Remove some uses of function_exists() where no longer necessary 2021-11-25 11:11:32 -05:00
Zach Borboa 21564e7429 Allow test failures on future PHP releases to fail more quietly
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"
2021-11-24 23:12:31 -05:00
Zach Borboa 7dae1c6b54 Update server test names 2021-11-23 23:24:54 -05:00
Theodoros-Franz Gerakitis e999cb4e25 Fix #686: Build url without using data parameter
Also for PATCH, PUT & SEARCH requests
2021-11-23 23:23:08 -05:00
Zach Borboa 31a65e2dfb Remove void return type when running tests on PHP 7.0
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

    [...]
2021-11-23 21:53:32 -05:00
Zach Borboa 860645c623 Add option to skip slow tests using an environment variable
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
2021-11-23 20:37:33 -05:00
Zach Borboa 92a8f3bbe2 Fix #686: Build url without using data parameter 2021-11-20 23:43:44 -05:00
Zach Borboa 2973f50df8 Determine request method using helper method 2021-11-20 23:13:10 -05:00
Zach Borboa 3d9acedb66 Correct the post/redirect/get logic when using MultiCurl::addPost() 2021-11-20 22:17:32 -05:00
Zach Borboa 0c8eab3083 Fix empty request headers value 2021-11-20 15:43:36 -05:00
Zach Borboa bd85374938 Add PHPCompatibility ruleset to coding standards check 2021-09-21 15:28:48 -04:00
Zach Borboa a4d91d28ba Run check coding standard commands from the project root directory 2021-09-21 15:21:21 -04:00
Zach Borboa 5c0a351e41 Unify continuous integration and run scripts more closely 2021-09-21 10:42:56 -04:00
Zach Borboa a4f4223b98 Implement Curl::setStop() for stopping requests early
Use Curl::setStop() to stop requests early without downloading
the full response.
2021-09-15 05:49:25 -04:00
Zach Borboa a8714527e6 Increase tolerance of request start time 2021-08-19 20:18:04 -04:00
Zach Borboa eadd466f66 Fix parsing schemeless url 2021-08-07 17:48:47 -04:00
Zach Borboa 25e9126f77 Make Url::parseUrl() and Url::percentEncodeChars() static functions. 2021-08-06 21:01:02 -04:00
Zach Borboa 620bf40691 Move ArrayUtil tests under ArrayUtilTest 2021-07-26 21:48:17 -04:00
Zach Borboa c51b175748 Increase amount of time drift allowed
(noisy neighbors?)
2021-07-26 20:44:33 -04:00
Zach Borboa cd825550b2 Fix Curl::downloadFileName not being correctly set 2021-07-26 20:17:14 -04:00
Zach Borboa 285b4f02e6 Update tests to more closely match one another 2021-07-26 10:29:24 -04:00
Zach Borboa 7af4a8d383 Fix some errors caused by using strict types 2021-07-26 10:08:44 -04:00
Zach Borboa bb1a190071 Use strict types 2021-07-26 00:48:18 -04:00
Zach Borboa 6ceabf7293 Clean up 2021-07-26 00:35:01 -04:00
Zach Borboa 1226bb1a6c Implement option to capture output of Curl::diagnose() 2021-07-20 23:28:20 -04:00
Zach Borboa 7348de72f3 Clean up 2021-07-20 23:10:20 -04:00
Zach Borboa 18e76855c2 Fix assertion 2021-07-20 23:01:40 -04:00
Zach Borboa 2a899465c4 Add method to run basic request diagnostics 2021-07-18 21:56:03 -04:00
Zach Borboa 250421927f Add additional Curl::set* and MultiCurl::set* helper methods 2021-06-17 11:14:29 -04:00
Zach Borboa b06af57cb3 Clean up 2021-06-11 08:24:40 -04:00
Zach Borboa 8d62a97719 Unify continuous integration and run scripts more closely 2021-06-11 00:19:33 -04:00
Zach Borboa 2c5fe57d60 Fix missing rsync error: "sh: 2: rsync: not found" 2021-06-09 21:38:21 -04:00
Zach Borboa fe829855cb Fix #670: Add additional checks before attempting to close curl handles 2021-06-09 20:58:33 -04:00
Zach Borboa 1f96291b04 Run test script when testing inside containers 2021-06-09 20:25:47 -04:00
Zach Borboa 3305e9c0b1 Rename continuous integration script 2021-03-29 10:08:46 -04:00
Zach Borboa a315b541be Consolidate continuous integration scripts
Merge before_script.sh into script.sh
2021-03-29 09:59:19 -04:00