Commit Graph

256 Commits

Author SHA1 Message Date
Zach Borboa 06dc90ebf7 Fix typo 2026-03-01 22:34:09 -05:00
Zach Borboa 42c052f375 Fix flaky test using larger response size and slower download speed 2026-03-01 22:04:11 -05:00
Zach Borboa fd902b4b7c Fix CI (PHPUnit) (#918)
* 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
2025-02-17 18:24:42 -05:00
Zach Borboa 63bddcd230 Drop support for PHP 7.0 (#880) 2024-08-17 09:15:46 -04:00
Zach Borboa a6e6110051 Update checks for decoding gzip-encoded responses 2023-08-29 07:01:18 -07:00
Zach Borboa 11bd600918 Rename ::setError() to ::afterSend() 2023-08-25 06:39:12 -07:00
Zach Borboa 5e5d284a9b Implement Curl::setError() and MultiCurl::setError() 2023-08-22 20:20:47 -07:00
Zach Borboa cd924d10c3 Update PHP_CodeSniffer ruleset: PSR2 → PSR12 2023-06-30 01:23:37 -07:00
Zach Borboa 9bd4776b73 Apply additional coding standards 2023-06-30 00:37:30 -07:00
Zach Borboa 128a0c1ea2 Add PHP-CS-Fixer to check for unused imports 2023-06-24 19:33:48 -07:00
Zach Borboa 76e74fdc44 Improve and add tests for Curl::fastDownload() 2023-06-13 02:52:59 -07:00
Zach Borboa 1c270272c8 Update Curl::diagnose() to detect bit flags with negative values 2023-05-20 13:32:44 -07:00
Zach Borboa a304084a61 Display bit flags in use when calling Curl::diagnose()
This change attempts to determine which underlying constants were
bitmasked together to reach the resulting value passed to curl_setopt()
using Curl::setOpt().
2023-05-18 16:11:07 -07:00
Zach Borboa f7b216a3d9 Fix #777: Handle missing content-type response header in Curl::diagnose() 2023-05-15 19:33:59 -07:00
Zach Borboa 5b39126488 Update article in Curl::diagnose() Allow header warning 2023-05-07 02:50:08 -07: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 4ed7644250 Update tests to work with PHPUnit 10 2023-02-17 19:31:41 -08:00
Zach Borboa 99bd995288 Format response header type notice as sentence 2023-01-26 16:58:45 -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 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 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 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 523386ec01 Fix #714: Attempt to stop active requests when MultiCurl::stop() is called 2022-06-23 08:26:20 -04: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 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 0c8eab3083 Fix empty request headers value 2021-11-20 15:43:36 -05: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 620bf40691 Move ArrayUtil tests under ArrayUtilTest 2021-07-26 21:48:17 -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 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