Commit Graph

553 Commits

Author SHA1 Message Date
Zach Borboa 4133006c9f Remove coding standard ruleset exclusion 2023-02-26 12:07:58 -08:00
Zach Borboa 1aa3f87115 Replace some private method names not in camel caps format 2023-02-26 12:07:58 -08:00
Zach Borboa c6256e31b3 Remove coding standard ruleset exclusion 2023-02-26 12:07:58 -08:00
Zach Borboa d4af343164 Add emits warning test for PHPUnit 10 2023-02-17 21:32:20 -08:00
Zach Borboa 10ead55ca4 Fail on risky tests
Catch the following:
  There was 1 risky test:

  1) CurlTest\PHPCurlClassTest::testRequiredOptionCurlOptReturnTransferEmitsWarning
  This test did not perform any assertions

  /home/runner/work/php-curl-class/php-curl-class/tests/PHPCurlClass/PHPCurlClassTest.php:3097
2023-02-17 20:21:54 -08:00
Zach Borboa 4ed7644250 Update tests to work with PHPUnit 10 2023-02-17 19:31:41 -08:00
Zach Borboa acf5443a68 Fix sed command portability
Error messages:
    $ sed -i'' '-e/->expectWarning(/d' ./PHPCurlClass/PHPCurlClassTest.php ./PHPCurlClass/PHPMultiCurlClassTest.php
    sed: 1: "./PHPCurlClass/PHPCurlC ...": invalid command code .

    + phpunit_v10_shim
    + remove_expectWarning
    + sed -i '' '-e/->expectWarning(/d' ./PHPCurlClass/PHPCurlClassTest.php ./PHPCurlClass/PHPMultiCurlClassTest.php
    sed: can't read : No such file or directory
2023-02-17 19:29:22 -08:00
Zach Borboa bcf3c1ad33 Remove --verbose option removed in PHPUnit 10
Error:
  + ../vendor/bin/phpunit --configuration phpunit.xml --verbose
  PHPUnit 10.0.1 by Sebastian Bergmann and contributors.

  Unknown option "--verbose"
2023-02-03 17:24:13 -08:00
Zach Borboa 43e666de0f Remove --debug option removed in PHPUnit 10 for continuous integration tests
Error:
  + ../vendor/bin/phpunit --configuration phpunit.xml --debug --verbose
  PHPUnit 10.0.1 by Sebastian Bergmann and contributors.

  Unknown option "--debug"
2023-02-03 17:16:17 -08:00
Zach Borboa 08850b1a90 Remove --debug option removed in PHPUnit 10
Error:
  + ../vendor/bin/phpunit --configuration phpunit.xml --debug --verbose
  PHPUnit 10.0.1 by Sebastian Bergmann and contributors.

  Unknown option "--debug"
2023-02-03 17:04:12 -08:00
Zach Borboa 99bd995288 Format response header type notice as sentence 2023-01-26 16:58:45 -08:00
Zach Borboa f6ed305633 Clean up 2023-01-15 19:09:34 -08:00
Zach Borboa b41168b89b Clean up 2023-01-15 13:28:04 -08:00
Zach Borboa 673564609a Add tests for using CURLStringFile 2023-01-15 13:28:04 -08:00
Zach Borboa b6b3800dfa Fix psalm UndefinedClass error
Message:
    ERROR: UndefinedClass - ../src/Curl/ArrayUtil.php:96:87 - Class, interface or enum named CURLStringFile does not exist (see https://psalm.dev/019)
        } elseif (class_exists('CURLStringFile') && $value instanceof \CURLStringFile) {
2023-01-15 13:28:04 -08:00
Zach Borboa de7751b4e1 Add additional test cases for Curl::diagnose() 2023-01-13 05:42:29 -08:00
Zach Borboa 85794dacbe Display error messages found in Curl::diagnose() 2023-01-12 07:25:24 -08:00
Zach Borboa d40c3b3cb1 Fix Curl::diagnose() request type output for POST requests 2023-01-12 06:47:36 -08:00
Zach Borboa b20f535f7c Replace use of #[\AllowDynamicProperties] 2023-01-10 13:18:26 -08:00
Michael Bolli 95f4aac970 silence PHP 8.2 deprecation notices 2023-01-10 10:27:19 +01:00
Zach Borboa 5b388dd4dd Add script to run static analysis checks 2022-12-16 05:14:40 -08:00
Zach Borboa 3cfe83b222 Move static analysis config under tests/ and exclude from git archive 2022-12-16 04:03:56 -08:00
Zach Borboa d8ed09f266 Fix #747: Ensure string response before gzip decode 2022-12-12 05:53:53 -08:00
Zach Borboa c5a471ff2d Add assertions for response content type and content encoding 2022-12-10 11:50:37 -08:00
Zach Borboa 1f06b2c2a0 Fix #747: Disable warning when gzip-decoding response errors 2022-12-10 08:15:18 -08:00
Zach Borboa 7b07ab5166 Add automatic gzip decoding of response (#740) 2022-12-05 18:41:56 -08:00
Zach Borboa b86aca6f74 Add Curl::diagnose() HTTP method check matches methods allowed 2022-12-04 13:09:07 -08:00
Zach Borboa 4fb8e2867f Display request options in Curl::diagnose() output
Request options are now displayed when Curl::diagnose() is called and a
deferred constant curlOptionCodeConstants has been added.
2022-11-05 15:27:09 -07:00
Zach Borboa 99795d1d69 Fix MultiCurl::setCookieString() 2022-11-05 14:43:21 -07:00
Zach Borboa cb6a0e83e6 Pass MultiCurl options to new Curl instances earlier
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().
2022-11-05 13:48:30 -07:00
Zach Borboa 5bfe59109a Add files to run PHP 8.1 tests inside a docker container 2022-09-30 19:39:50 -07:00
Zach Borboa f66b365896 Allow running script from outside the script directory 2022-09-29 19:12:16 -07:00
Zach Borboa 7bce4bfcd5 Add script for running test suite while skipping slow tests 2022-09-28 14:54:23 -07:00
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