1
0
Fork 0
Commit Graph

135 Commits (1e7857d682d3d88f9e108623b89f529eb4bf4ac7)

Author SHA1 Message Date
Viktor Szépe 8728a75930
Fix typos (#12133) 2024-10-02 12:28:32 +02:00
Jordi Boggiano c8bd0e6278
Add --patch-only flag to update command to restrict updates to patch versions and make them safer (#12122)
Fixes #11446
2024-09-21 13:54:03 +02:00
Jordi Boggiano 3a2a18175d
Add ability to reinstall packages by type (#12114)
Fixes #11364
2024-09-21 13:37:55 +02:00
Jordi Boggiano 58905ffe4e
Validate licenses passed into init command (#12115)
Fixes #10838
2024-09-19 17:07:28 +02:00
Carlos Granados c8838f198e
Add option to run bump after update (#11942)
* Add option to run bump after update

* Convert the option into a bool | string parameter and change a couple of texts

* Apply suggestions from code review

* Fix tests

---------

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2024-09-18 15:34:25 +02:00
Job Vink be7d9abc66
Improve interactive package updates (#11990)
* Improve interactive package updates

* Exclude platform packages and up to date packages, follow stability flags, ignore-platform-reqs etc

* Add tests and support for lock file + empty lock/vendor

---------

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2024-09-18 10:43:42 +02:00
Jordi Boggiano f17df6d5a1
Fix handling of platform packages in why-not command and partial updates, fixes #12104 (#12110) 2024-09-17 13:31:33 +02:00
Mohamed Hubail 1684f82a43
Add `InitCommand.php` Interactive test case (#12068)
* Add single test case for interactive `init` command

* Fix spelling + use single quotes

* Fix test expectations

---------

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2024-08-22 10:49:55 +02:00
Mohamed Hubail 8c5f2dbb97
Add `GlobalCommandTest.php` (#12073)
* Add `GlobalCommandTest.php`

- `testGlobal` to check `COMPOSER_HOME` is followed correctly + check
  `COMPOSER` is unset.
- `testNotCreateHome` to test handling invalid `COMPOSER_HOME`.

* Add error string for non obvious test case

* Clean up env vars and minor code style changes

---------

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2024-08-22 10:38:16 +02:00
Mohamed Hubail dca85cc940
Add "require command with conflicting keys" test (#12072)
* Add test case for conflicting both with `--dev` and without

* Implement interactive case

* Restrcture so that interactive case is actually interactive

I don't know why specifying `'--no-interaction' => !$isInteractive,`
didn't give the desired behavior of the prompt being interactive.

You can verify that by printing the `$appTester->getDisplay()` which
doesn't contain a prompt.  In fact, it doesn't make any difference
whether I set it to true or false.  The only difference is if I set it
or don't set it.

* Fix dreaded trainling comma
2024-08-22 10:27:58 +02:00
Mohamed Hubail 47b924d27c
Add Update Interactive tests (#12065)
* Add Update Interactive tests

* Fix type + remove extra comma

* Used `php-cs-fixer`

* Normalize for windows + fix use of `Generator`
2024-08-21 18:14:40 +02:00
Jordi Boggiano dc857b4f91
Fixed PSR violations for classes not matching the namespace of a rule being hidden, fixes #11957 2024-05-31 17:52:05 +02:00
Jordi Boggiano 37d722e73c
PHPStan/tests updates (#11996)
* Remove a bunch of inline ignores and migrate all PHPUnit assertions to static calls

* Update baseline (1573, 93)

* Update commit hash
2024-05-29 23:12:06 +02:00
Jordi Boggiano f83b6b1026
Enable new phpstan option 2024-05-27 17:11:31 +02:00
Krzysztof Ciszewski 4d7476ca30
composer#11852 fix: ability to remove autoload* keys (#11967) 2024-05-08 11:19:05 +02:00
Jordi Boggiano 80631d2fc8
Fix one more case of unsetting a key in an object 2024-04-29 11:19:52 +02:00
Jordi Boggiano 232f4e7a5c
Fix config command issue handling objects in some conditions, fixes #11945 2024-04-29 10:59:35 +02:00
Jordi Boggiano 92f641ac3d
Fix show command output to remove v prefixes on versions, making for more uniform output, fixes #11925 2024-04-15 13:23:25 +02:00
Jordi Boggiano b12a88b7f3
Fix call 2024-03-22 09:29:43 +01:00
Jordi Boggiano 54870a78c4
Add a new test to confirm that show --direct <name> works with direct dependents/dev-dependents 2024-03-21 16:59:41 +01:00
Jordi Boggiano 94fe294545
Fix self-update tests on releases 2024-03-11 17:32:50 +01:00
Pol Dellaiera a0d474f75c
Add a warning message when Composer is not able to guess the root package version (#11858)
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2024-02-23 10:47:36 +01:00
Yuto Takakura 1b7a71f7e7
Add tests for SelfUpdateCommand (#11816)
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2024-02-21 20:59:50 +01:00
theoboldalex 7a6bb18e21
Adds a test for no dev (#11833) 2024-02-08 11:06:34 +01:00
Jordi Boggiano 67d80e1c9d
Fix php7.2 2024-02-07 22:44:22 +01:00
Jordi Boggiano df8f9f05a3
Update tests 2024-02-07 22:37:22 +01:00
theoboldalex 338bc16a11
test: Covers audit of pkg with no sec advisories (#11789) 2024-02-07 11:40:29 +01:00
Jordi Boggiano 55db88f51b
Add error when composer show --direct <transient-dependency> is used to show a dependency which is not direct, fixes #11728 2024-01-11 09:53:00 +01:00
Jordi Boggiano 284821543a
Merge branch '2.6' 2024-01-08 16:10:20 +01:00
Jordi Boggiano 534bc20beb
Add support for combining show --self with --installed or --locked (#11785) 2024-01-08 14:14:44 +01:00
theoboldalex 3be0ca8467
Adds a test for invalid arg combo (#11783) 2024-01-08 11:03:34 +01:00
Jordi Boggiano 53a1f32061
Add --sort-by-age to show/outdated commands, and also release date for latest package in --latest mode (#11762) 2023-12-20 15:37:27 +01:00
Jordi Boggiano 9b0f9b40a4
Show package source in very verbose updates, fixes #11733 (#11763) 2023-12-19 17:17:48 +01:00
Jordi Boggiano 4a209b7d3d
Fix bump command not bumping versions with a v prefix e.g. ^v2.4, fixes #11723 (#11764) 2023-12-19 17:17:32 +01:00
theoboldalex aaff0ae4df
Adds a test for UpdateCommand (#11724)
* test: Interactive mode should throw if no package

* PHPStan fix. Missing return type on test method
2023-12-08 18:26:05 +01:00
Travis Carden aefa46dfba
Add support for "scripts-aliases" in composer.json (#11666) 2023-10-27 11:36:59 +02:00
Dan Wallis 8c0f1e10dc
Display error instead of throwing exception when unable to update with temporary constraint (#11692) 2023-10-26 11:38:02 +02:00
Dan Wallis 81b662d388
Suggest running 'require' not 'update' if a root req fails to update (#11691) 2023-10-26 11:08:03 +02:00
Jesper Skytte Marcussen 9a407b5ad3
10796 Increase coverage of ShowCommand (#11677)
* Added more tests for ShowCommand class

By doing so, my local setup shows increase in coverage from some 38% to
67%.

* PHP-CS-Fixer

* PHPStan fixes
2023-10-11 13:43:30 +02:00
Pol Dellaiera b608b8e87e
feat: improve Composer's output reproducibility (#11663)
* AutoloadGenerator: add `Locker` parameter to the `dump` method
* AutoloadGenerator: do not create a random hash, re-use the one from the lock file if it exists
* FileSystem: make sure `safeCopy` copy also the file time metadata
2023-09-28 11:43:52 +02:00
Alex Theobold 218b9041c9
Test status command (#11522) 2023-09-14 11:45:18 +02:00
Damien Carrier e0abc40ded
Add test for `ArchiveCommand` with package name (#11551)
* test(ArchiveCommand): Add test for ArchiveCommand with package name

* fix : using explicit variable name for eventDispatcher Mock

---------

Co-authored-by: Damien Carrier <damien.carrier@alximy.io>
2023-08-31 13:46:43 +02:00
Martin Herndl 6fd145f01e
Allow --strict-psr in `DumpAutoloadCommand` also with --classmap-authoritative (#11607) 2023-08-30 21:43:16 +02:00
Martin Herndl 02e4a2d1a3
Add test case for `DumpAutoloadCommand` with failing --strict-psr check (#11606) 2023-08-30 21:42:45 +02:00
Martin Herndl 879524d8e3
Add tests for DumpAutoloadCommand (#11581) 2023-08-30 16:09:05 +02:00
Rober Díaz 4137bf38ad
Tests for base dependency command (#11547)
* 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
2023-08-29 15:06:19 +02:00
David Zülke 3e9c148b63
Fix trailing whitespace in 'composer show -N' (#11536)
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).
2023-07-21 11:29:38 +02:00
David Zülke 07f706e57d
Fix 'composer show --platform <package>' erroring if no composer.json is present (#11533)
Sort of related to #11046 (although this is not a regression, but didn't work before, either)
2023-07-21 11:28:36 +02:00
Athos Ribeiro 4b210d916e
Add support for phpunit 10 (#11532)
* 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
2023-07-21 10:39:20 +02:00
Alex Theobold bc28582723
Reinstall command test (#11502) 2023-06-23 09:47:36 +02:00