* GH Actions: run against PHP 8.3
What with PHP 8.3 being close to the first RC, I'd like to suggest enabling runs against PHP 8.3 for the linting and test runs.
* Linting passes on PHP 8.3, so I propose to not allow new failures to be introduced there.
* The test runs, however, do not pass against PHP 8.3, so I'm marking those as `experimental` for now to allow for fixing the issue(s).
As for the compatibility issues (based on the test runs):
* PR 11599 fixes all known deprecation notices.
* There is, however, one test failure, which I'm not exactly sure how to fix, so I'm leaving this for the maintainers to decide upon.
Details:
Prior to PHP 8.3, `ReflectionMethod` could set a `private` method on a parent class to accessible. This is no longer possible in PHP 8.3 since php/php-src 9470 and breaks the `Composer\Test\Repository\ComposerRepositoryTest::testWhatProvides` test.
Also see: https://3v4l.org/8YcIk/rfc#vgit.master
* GH Actions: update addition of PHP 8.3
* Don't add PHP 8.3 to the `lint` workflow.
* Replace the PHP 8.2 extra builds instead of adding to them for `test`.
* Don't allow builds to fail.
---------
Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
Prior to PHP 8.3, ReflectionMethod could set a private method on a parent class to accessible. This is no longer possible in PHP 8.3 since php/php-src 9470 and breaks the Composer\Test\Repository\ComposerRepositoryTest::testWhatProvides test.
Also see: https://3v4l.org/8YcIk/rfc#vgit.master
Fixed now.
Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
Co-authored-by: Christophe Coevoet <stof@notk.org>
* PHP 8.3 | ZipDownloaderTest: fix deprecation notice
Calling `ReflectionProperty::setValue()` with only one argument (to set a static property) is deprecated.
Passing `null` as the first (`$object`) parameter will work cross-version.
As the `ZipDownloaderTest::setPrivateProperty()` method has a `null` default value for the `$obj` parameter anyway, this means the if/else toggle can be removed.
Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue
* PHP 8.3 | InstalledVersionsTest: fix deprecation notice
Calling `ReflectionProperty::setValue()` with only one argument (to set a static property) is deprecated.
Passing `null` as the first (`$object`) parameter will work cross-version.
Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue
---------
Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
* Audit: ignores configured repository options
* ComposerRepository: add test case to assert that repo http options are used to make security advisory POST request
* add a test case for "not provided a required parameter"
* add a test cases for "not provided locked file"
* cleanup for case provider
* add a test case for "package existence"
* add a test case for "warning when dependencies are not installed"
* fix the test case for "warning when dependencies are not installed"
* add a test case for "package was not found in the project"
* add a test cases for `why-not` command
- also they were fixed docblocks
* add a test cases for `why` command
* versions were added to dependency objects
* it was avoided HEREDOC due it seems to be failing in PHP 7.2
* it was avoided mismatches due different platforms EOL
* it was used full output instead of an array of messages (to avoid EOL isues)
* it increased code coverage to 97%
* All test case docblocks were corrected according to CR feedback
* ensure that `why-not` should say that an installed package requires an incompatible version of the inspected package
The name column was always padded to maximum width, even if no other columns were printed.
This makes it difficult to use the output e.g. in pipelines.
Fixed for all possible columns, and with tests for two cases (regular show and show outdated).
On macOS, if libcurl is built against SecureTransport, the platform repository will contain an invalid package name:
% composer show --platform | grep curl
ext-curl 8.2.7 The curl PHP extension
lib-curl 8.1.2 The curl library
lib-curl-(securetransport) openssl 3.1.1 curl (securetransport) openss...
lib-curl-libssh2 1.11.0 curl libssh2 version
lib-curl-zlib 1.2.11 curl zlib version
This change fixes it:
% bin/composer show --platform | grep curl
lib-curl 8.1.2 The curl library
lib-curl-libssh2 1.11.0 curl libssh2 version
lib-curl-securetransport 3.1.1 curl (securetransport) openssl ...
lib-curl-zlib 1.2.11 curl zlib version
(second column width difference comes from the Composer dev version number)
* Use static test data providers
Using non-static methods as a data providers was deprecated in phpunit
10.
* Rename abstract test class
Abstract test case classes with Test suffix are deprecated in PHPUnit
10. We also change the ArchiverTest file name to match the new class
name (ArchiverTestCase).
* https://github.com/sebastianbergmann/phpunit/issues/5132