WordPress / Requests

Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.
https://requests.ryanmccue.info/
Other
3.57k stars 494 forks source link

Tests: fix PHPUnit deprecation notices #871

Closed jrfnl closed 3 months ago

jrfnl commented 3 months ago

Pull Request Type

This is a:

Context

Tests: fix PHPUnit deprecation notices [1]

Removes the key from the entries returned by the TypeProviderHelper methods.

This puts the responsibility for having names for the individual entries in each dataset on the data provider methods in the tests (if so desired). This prevents the TypeProviderHelper class having influence on what the parameter names for test methods should be.

This fixes a number of PHPUnit (10.5+) deprecation notices along the lines of "Providing invalid named argument $input for method WpOrg\Requests\Tests**Test::test*() is deprecated and will not be supported in PHPUnit 11.0.".

Includes minor documentation fix for the affected methods in the TypeProviderHelper class.

Tests: fix PHPUnit deprecation notices [2]

Ensure the keys in datasets match the parameter names of the test methods to which the datasets are being passed.

This fixes a number of PHPUnit (10.5+) deprecation notices along the lines of "Providing invalid named argument $input for method WpOrg\Requests\Tests**Test::test*() is deprecated and will not be supported in PHPUnit 11.0.".

Tests: fix PHPUnit deprecation notices [3]

Make sure data providers only pass the arguments supported by the test.

This fixes a number of PHPUnit (10.5+) deprecation notices along the lines of "Providing invalid named argument $ for method WpOrg\Requests\Tests**Test::test() is deprecated and will not be supported in PHPUnit 11.0.".