1
0
Fork 0
Commit Graph

2452 Commits (3d9e9ba66f77c506e6c69b7df41d300959e2f962)

Author SHA1 Message Date
jakobvibe d06eb1ec3a
Fix types on mock tests (#10230)
* Fix types on mock tests

* Added $tty again

Co-authored-by: Jakob Vibe <jv@ipw.dk>
2021-10-27 14:56:39 +02:00
jakobvibe 1ba1463013
Added types to plugin test (#10231)
Co-authored-by: Jakob Vibe <jv@ipw.dk>
2021-10-27 14:52:34 +02:00
megubyte c2a2198089
phpstan: update tests/Composer/Test/Installer/* to level 6 standard (#10225) 2021-10-27 14:41:30 +02:00
jakobvibe f667c7b8de
Add types to tests/composer/test/json (#10222)
Co-authored-by: Jakob Vibe <jv@ipw.dk>
2021-10-27 11:37:51 +02:00
megubyte 135f806f6f
phpstan: update tests/Composer/Test/Autoload/* to level 6 standard (#10223) 2021-10-26 21:48:56 +02:00
Martin Herndl 3d5a100018
Add types to `Question` tests (#10219) 2021-10-26 21:17:28 +02:00
Martin Herndl 79da1c266e
Add types to `Script` tests (#10220) 2021-10-26 21:08:54 +02:00
Christian 4071125172
Added return type docs (#10221) 2021-10-26 21:05:03 +02:00
Cédric Anne a7686e82f0
Filter candidates requiring an unknown platform package; fixes #10167 (#10184) 2021-10-26 17:24:17 +02:00
Martin Herndl bd8b39fe01
Add types to `Package` (#10210) 2021-10-25 13:45:09 +02:00
Martin Herndl aa4c2ab63c
Add types to `Plugin` (#10194) 2021-10-25 11:02:54 +02:00
Paolo Rossi a921d9b233
Reaching phpstan level 6 in EventDispatcher Exception and Installer folders (#10192) 2021-10-25 10:44:29 +02:00
immeëmosol 50d738eeee
Reaching phpstan level 6 in Composer/DependencyResolver (refs #10159) (#10178) 2021-10-18 22:33:37 +02:00
Jordi Boggiano a6f1e803b1
Use more BasePackage instead of PackageInterface 2021-10-17 14:43:34 +02:00
Jordi Boggiano 9599eb613b
Type annotations 2021-10-16 11:14:10 +02:00
Jordi Boggiano c3c6969cf5
Type annotations 2021-10-16 10:25:12 +02:00
Jordi Boggiano 97fe881af4
Add some docblocks 2021-10-15 16:36:28 +02:00
Jordi Boggiano 260ac0011c
Add constants to describe error codes from Installer::run 2021-10-14 15:12:06 +02:00
Jordi Boggiano cf7fa7087c
Fix test 2021-10-13 22:23:18 +02:00
Jordi Boggiano 2828ce59cf
Merge branch '1.10' 2021-10-13 22:12:54 +02:00
John Stevenson 906442117c Carriage returns are ignored by cmd 2021-10-13 14:54:37 +01:00
John Stevenson 0783b043d2 Fix Windows escaping in tests 2021-10-10 17:02:22 +01:00
John Stevenson 8f974fe741 Improve Windows escaping 2021-10-10 16:24:49 +01:00
Jordi Boggiano 18e24976c1
Merge branch '1.10' 2021-10-05 09:43:00 +02:00
Jordi Boggiano ca5e2f8d50
Fix escaping issues on Windows which could lead to command injection, fixes GHSA-frqg-7g38-6gcf 2021-10-05 09:39:50 +02:00
David Zülke 28b2b5c0c9
tests for solver handling multiple packages with same name and version (#10110)
Not a case with regular Packagist packages, but some custom installers with custom repos do this, and the current behavior should not randomly change at some point, as that would cause downstream breakage.
2021-10-02 19:02:22 +02:00
Jordi Boggiano d64d1adf61
Rewrite php file cleaning step to be less regex intensive and support extreme cases better, fixes #10106 (#10107) 2021-10-02 14:39:39 +02:00
Jordi Boggiano d99b200cf3
Fix tests 2021-10-01 10:54:33 +02:00
Jordi Boggiano f85e2136fd
Merge branch '1.10' 2021-10-01 10:34:36 +02:00
Jordi Boggiano 8cd2d0e541
Fix scanning of classmaps in files containing invalid Unicode, fixes #10102 2021-09-15 11:31:43 +02:00
Jordi Boggiano 4bcd860b65
Add more type annotations 2021-09-05 17:34:12 +02:00
Jordi Boggiano dd49db6f08
Make sure that names with wildcards which are not preceded by dots are also seen as package names and not version constraints 2021-09-05 09:56:28 +02:00
Jordi Boggiano 0761474599
Add type info to many properties/methods 2021-08-30 14:46:49 +02:00
Jordi Boggiano f4e2b389a1
Fix test 2021-08-29 20:10:24 +02:00
Jordi Boggiano 922ba01d07
Merge pull request #10072 from jrfnl/feature/10067-fix-classmap-regression
ClassMapGenerator: stabilize the heredoc/nowdoc stripping
2021-08-29 12:26:20 +02:00
Jordi Boggiano d8054d1d2f
Add more possessive quantifiers, unicode flag and support for more post-heredoc syntax, fix test file syntax being invalid 2021-08-29 12:23:02 +02:00
Jordi Boggiano 3f79e59f69
Add test assertions for heredoc marker inside the text 2021-08-23 13:14:16 +02:00
powellblyth 5e75017166
Just some comments with 'it's' that should have been 'its' (#10071)
Co-authored-by: Toby Powell-Blyth <tobypowell-blyth@elasticstage.com>
2021-08-22 13:41:18 +02:00
jrfnl b66b23a03f
ClassMapGeneratorTest: add test with consecutive duplicate heredoc markers
... as well as a test with heredoc markers with only a newline character between the start and end marker.
2021-08-21 17:45:42 +02:00
Jordi Boggiano d3c176ec69
PHPStan Level 5 (#10070)
* Bump PHPStan to level 5

* Update seld/phar-utils to latest

* Add phpstan-setup / phpstan scripts
2021-08-21 17:41:52 +02:00
Jordi Boggiano 74b231a4bc
Fix lib-openssl detection on FreeBSD, fixes #10046 2021-08-19 15:00:08 +02:00
Jordi Boggiano a586a753df
Fix all remaining php8.1 test suite deprecations 2021-08-19 13:00:30 +02:00
Jordi Boggiano b77fce8a4f
More deprecation fixes by using ProcessExecutorMock and a couple of PackageInterface type fixes 2021-08-18 23:35:27 +02:00
Jordi Boggiano 6aa2d15868
Introduce ProcessExecutorMock to fix deprecations and amount of mocking pain 2021-08-18 17:17:56 +02:00
Jordi Boggiano 5062619046
Fix deprecation warnings with strpos receiving null 2021-08-18 15:55:37 +02:00
Jordi Boggiano 0b09e08f4b
Fix direct deprecations 2021-08-18 15:17:06 +02:00
Jordi Boggiano cac4c190f1
Merge pull request #10053 from jrfnl/feature/php-8.1-null-to-non-nullable-fix-2
PHP 8.1: prevent a "null to non-nullable" deprecation notice [2] (test only fix)
2021-08-18 14:39:51 +02:00
Jordi Boggiano 9708f4568f
Merge pull request #10055 from jrfnl/feature/php-8.1-fix-missing-mock-expectation
PHP 8.1/LibraryInstallerTest: add missing mock expectation
2021-08-18 14:31:30 +02:00
Jordi Boggiano b232ee6663
Fix test 2021-08-18 14:25:35 +02:00
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