1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00
Commit graph

101 commits

Author SHA1 Message Date
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
Alex Theobold
7528c86e58
Test json format on failed platform reqs (#11477)
* test: Adds case for json format arg

* test: A failed platofrm requirement

* chore: style fix

* chore: removes redundant test case
2023-05-28 15:15:21 +02:00
Jordi Boggiano
0d68dabb5f
Add more tests for install command, refs #11277 2023-05-15 21:54:40 +02:00
Alex Theobold
fb2c17d696
Test install command (#11277)
* Adds test class boilerplate

* test: Tests warning returned with dev flag

* test: warning returned with no-suggest flag

* test: packages passed is invalid

* test: no-install flag passed

---------

Co-authored-by: alex.theobold <alex.theobold@sykescottages.co.uk>
2023-05-14 14:15:44 +02:00
Jordi Boggiano
f6f972a699
Fix require regression with --fixed, fixes #11247 2023-01-19 21:42:22 +01:00
Jordi Boggiano
0d96fd8149
Warn when require ends up auto-selecting a feature branch, fixes #11264 (#11270) 2023-01-19 21:42:09 +01:00
Alex Theobold
2431b12230
Test home command (#11254)
Co-authored-by: alex.theobold <alex.theobold@sykescottages.co.uk>
2023-01-13 09:34:03 +01:00
Dan Barrett
ca9fb64691
Added tests for the Suggests command 2023-01-06 12:38:47 +11:00
Dan Barrett
7560873740
Added tests for the Remove command 2023-01-06 12:38:47 +11:00
Dan Barrett
29ae7b632a
Add "missing lockfile" test for the Audit command 2023-01-06 12:38:40 +11:00
Jeffrey Cafferata
da611e089a
Docs: fix documention deep links (#11233)
* Docs: Fixed the deep links to the documentation website.

Search scope: `src/Composer/Command`.

* Docs: Fixed the deep links to the documentation website.
2022-12-21 09:32:50 +01:00
Ion Bazan
8ff237afb6
[Tests] Use static data providers (#11197) 2022-11-24 14:39:08 +01:00
Jordi Boggiano
36bc30ffab
Make the require command guess versions more accurately by delegating to the solver (except with --no-update) (#11160) 2022-11-01 15:48:52 +01:00
Jordi Boggiano
6e55cb36d8
Add support for adding Command classes as scripts, (#11151)
* Add support for adding Command classes as scripts, fixes #11134

* Allow all options to be forwarded and allow using references to other scripts with args

* Fix build

* Add more checks

* Ensure exceptions are not swallowed, and remove naming restriction by using a single-command app

* Update docs

* Add tests, fix issue merging params when combining nested scripts and CLI params
2022-10-28 14:24:55 +02:00
Jordi Boggiano
a63ce7cf96
Add message when doing composer outdated --direct and there is nothing to show, fixes #11152 (#11156) 2022-10-27 16:21:53 +02:00
Alex Theobold
97f4fbc4b0
Adds test coverage to the Fund Command (#11150)
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2022-10-26 13:40:01 +02:00
Alex Theobold
b5b4e15876
test: Create test for CheckPlatformReqsCommand (#10932) 2022-10-25 19:42:42 +02:00
Giulio
1b3a2ed6f6
test: Coverage for ValidateCommand (#11133)
Co-authored-by: giulio-Joshi <me@joshi.it>
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2022-10-25 16:38:01 +02:00
Leo Viezens
13e673df76
#10796 Add test for ExecCommand (#11094) 2022-10-13 11:21:19 +02:00
Gaëtan Faugère
52f91b2dd9
Add test and documentation regarding audit command when no packages are required (#11092) 2022-10-13 10:53:26 +02:00
Jesper Skytte Marcussen
b52e6b4a74
Add tests for BumpCommand (#11097)
I've added tests for the BumpCommand to increase the test coverage.

See #10796

Signed-off-by: Jesper Skytte <jesper@skytte.it>

Signed-off-by: Jesper Skytte <jesper@skytte.it>
2022-10-13 10:42:03 +02:00
Jesper Skytte Marcussen
d1bf685ea8
Added lots of new tests for InitCommand (#11106)
This commit adds tests for all the different input options.
2022-10-13 10:39:51 +02:00
Jesper Skytte Marcussen
c728569d33
Added new LicensesCommandTest class (#11105) 2022-10-12 17:25:28 +02:00
Mauro Bonfietti
d8a0127c0c
Added tests for Clear Cache Command. (#11066)
* Added tests for Clear Cache Command.

* Fix side-effects breaking other tests

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
2022-10-12 17:19:58 +02:00
Abdullahi Temidayo Jimoh
05aecfbe8b
Test for About command (#11078) 2022-10-12 14:22:28 +02:00
Jordi Boggiano
822fd640d0
Add warning when outdated command rejects an existing version due to platform requirements, fixes #11016 (#11113) 2022-10-12 13:57:14 +02:00
Kuba Werłos
e870206c4a
Add "--dry-run" to bump command (#11047) 2022-09-19 08:45:49 +02:00
Jordi Boggiano
ec8bbe9056
Fix package filter on bump command, fixes #11053 2022-09-14 14:00:27 +02:00
Jordi Boggiano
4164b30236
Fix show --platform regression failing if no composer.json exists, fixes #11046 2022-09-13 14:49:25 +02:00
Jordi Boggiano
3177b21324
Fix handling for double-zero prefix, refs #11032 2022-08-31 09:47:59 +02:00
Jordi Boggiano
2d48c7dbb0
Fix handling of zero-major versions in outdated --major-only flag, fixes #11032 2022-08-30 20:45:07 +02:00
Thomas Landauer
ceb8bef778
Adding hint what "Direct dependencies" means (#11013) 2022-08-20 09:24:25 +02:00
Jordi Boggiano
131da999ac
Fix CS (#11003) 2022-08-17 14:20:07 +02:00
Jordi Boggiano
f95471f221
Show/outdated command fixes (#11000)
* Fix show command showing the split of direct/transitive deps from outdated, fixes #10999

* Fix a few minor edge cases in show command, add tests for show and outdated commands
2022-08-17 12:08:59 +02:00
Ion Bazan
74a045783b
Add SearchCommand tests (#10982)
Signed-off-by: Ion Bazan <ion.bazan@gmail.com>
2022-08-16 10:52:01 +02:00