1
0
Fork 0
Go to file
jrfnl 7004e0d031 PHP 8.1/LibraryInstallerTest: add missing mock expectation
The `LibraryInstallerTest::testUninstall()` method mocks a `Package` object, but did not set an expectation for a call to `getName()`, while that method _is_ called in the `LibraryInstaller::uninstall()` method.

Without expectation, the mock returns `null`, which was subsequently being passed on to `strpos()` leading to the below error.

Fixes:
```
Deprecation triggered by Composer\Test\Installer\LibraryInstallerTest::testUninstall:
strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated

Stack trace:
0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 202)
1 src/Composer/Installer/LibraryInstaller.php(202): strpos(NULL, '...')
2 vendor/react/promise/src/FulfilledPromise.php(28): Composer\Installer\LibraryInstaller->Composer\Installer\{closure}(NULL)
3 src/Composer/Installer/LibraryInstaller.php(208): React\Promise\FulfilledPromise->then(Object(Closure))
4 tests/Composer/Test/Installer/LibraryInstallerTest.php(221): Composer\Installer\LibraryInstaller->uninstall(Object(Mock_InstalledRepositoryInterface_e3699f95), Object(Mock_Package_e4571076))
...
```
2021-08-12 03:38:56 +02:00
.github Update PHPStan and remove ignore 2021-07-21 10:10:09 +02:00
bin Register ErrorHandler early to catch deprecation notices while the Application is being initialized 2021-07-22 12:58:14 +02:00
doc Highlight the proprietary license trick 2021-07-22 12:08:25 +02:00
phpstan DiagnoseCommand - fix PHPDoc (#9991) 2021-07-07 21:52:53 +02:00
res Add "symlink" option for "bin-compat" config (#9959) 2021-06-09 11:33:44 +02:00
src Url: fix sanitize for new github tokens (#10048) 2021-08-11 13:24:41 +02:00
tests PHP 8.1/LibraryInstallerTest: add missing mock expectation 2021-08-12 03:38:56 +02:00
.editorconfig Enhancement: Add .editorconfig 2019-01-03 10:49:27 +01:00
.gitattributes Update HTTP URLs to their HTTPS if they already redirect automatically 2020-04-13 06:22:02 +07:00
.gitignore Fix EOL of text files (#9877) 2021-05-12 15:19:52 +02:00
.php_cs Uses config data from Composer object whenever possible on ArchiveCommand 2020-02-10 13:15:58 -02:00
CHANGELOG.md Update changelog 2021-07-23 10:35:14 +02:00
CODE_OF_CONDUCT.md Add coc file to appease the github UI 2020-04-23 11:14:08 +02:00
LICENSE lets avoid silly commits in the future 2017-01-19 12:10:26 +01:00
PORTING_INFO Import initial partial port of the libzypp satsolver. 2011-04-05 17:37:19 +02:00
README.md Update community section of readme 2021-05-19 15:24:01 +02:00
UPGRADE-2.0.md Escape special characters in Markdown files 2020-10-24 11:53:20 +01:00
composer.json More fixes for php8.1 deprecations 2021-07-22 12:42:01 +02:00
composer.lock Update to xdebug-handler 2.0.2 (#10047) 2021-08-11 13:02:22 +02:00
phpunit.xml.dist Prevent cache gc from happening during test suite runs, and add output so it is clear why it is blocking for a bit 2021-06-02 10:00:01 +02:00

README.md

Composer - Dependency Management for PHP

Composer helps you declare, manage, and install dependencies of PHP projects.

See https://getcomposer.org/ for more information and documentation.

Continuous Integration

Installation / Usage

Download and install Composer by following the official instructions.

For usage, see the documentation.

Packages

Find packages on Packagist.

Community

Follow @packagist or @seldaek on Twitter for announcements, or check the #composerphp hashtag.

For support, Stack Overflow offers a good collection of Composer related questions, or you can use the GitHub discussions.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project and its community you agree to abide by those terms.

Requirements

PHP 5.3.2 or above (at least 5.3.4 recommended to avoid potential bugs)

Authors

See also the list of contributors who participated in this project.

Security Reports

Please send any sensitive issue to security@packagist.org. Thanks!

License

Composer is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments