61 Commits (b85e0eebc115688653d3739aa4928c1ddfc45311)

Author SHA1 Message Date
Jordi Boggiano 7abc8da7d3
Add more types 2 years ago
Jordi Boggiano eda9014bef
Add return types to all code which is not being extended by open source packages 2 years ago
Jordi Boggiano 137ebddc25
Clean up useless mocks 2 years ago
Jordi Boggiano abdc6893a6
Add void types where no return statement is present 2 years ago
Jordi Boggiano 6ed3aeb343
Remove setExpectedException wrapper 3 years ago
Jordi Boggiano ffd62795bc
Get rid of all the ->at() mock invocations 3 years ago
Jordi Boggiano 2a771dfb2d
Update PHPUnit to 8.5 3 years ago
megubyte c2a2198089
phpstan: update tests/Composer/Test/Installer/* to level 6 standard (#10225) 3 years ago
Jordi Boggiano d3c176ec69
PHPStan Level 5 (#10070)
* Bump PHPStan to level 5

* Update seld/phar-utils to latest

* Add phpstan-setup / phpstan scripts
3 years ago
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))
...
```
3 years ago
Jordi Boggiano d942c65e0c
Fix more warnings 4 years ago
Jordi Boggiano 45ecbae8f5
Merge branch 'master' into 2.0 4 years ago
Ion Bazan db32d6bc18 do not use env 4 years ago
Jordi Boggiano 3dfcae99a9 Add parallel download capability to FileDownloader and derivatives 6 years ago
Gabriel Caruso 2a13bb2649 Fixes from PHPStan (#7687)
* fix docblocks

* remove redundant conditional

* fix wrong variable name

* fix wrong namespaces

* add missing private members

* remove unused/redundant arguments

* move testcase class

* exclude TestCase.php

* Tweak RuleWatchGraph type hints

* Tweak doc comment
6 years ago
Jordi Boggiano 066351c5b9 Remove use of deprecated getMock method 6 years ago
Jordi Boggiano 122e422682 CS fixes 7 years ago
Jordi Boggiano 59596ff012 Make sure we do not overwrite binaries but only re-create missing ones, refs #5127 8 years ago
Jeremy Benoist e9fc0e6548 Re-install binaries on update/install
Binaries are re-installed after an update/install (ie: removed and then installed)
8 years ago
Helmut Hummel b1ec99faed Extract binary installation and removal to own class
The functionality to install binaries might be useful
for other installers.
Create API for that by extracting this functionality from
the LibraryInstaller class.
8 years ago
Rob Bast a8995b2572 use dirsep so phpunit on windows doesnt fail 9 years ago
Rob Bast adf3b956d0 try to use unique test directories
any tests that use the filesystem should have their own unique directory, as we run our test suite in parallel and
cleanup of tests (removing directories) should not interfere with currently running tests
9 years ago
Jordi Boggiano 8398c9f2ab Fix target-dir update checks, fixes #2395 11 years ago
Jordi Boggiano 807600b255 Fix edge case where one adds a target-dir on a package that didnt have one before, refs #2279 11 years ago
Jordi Boggiano a813867065 Merge remote-tracking branch 'chx/913' 11 years ago
Jordi Boggiano 38917c2047 Add parallel build to travis script 11 years ago
Karoly Negyesi e32e4ad490 change the test to test for a target dir change 11 years ago
Karoly Negyesi 24c9ef72d6 make LibraryInstallerTest a little more strict 11 years ago
Karoly Negyesi c6ec739766 allow injecting a mock filesystem into LibraryInstaller and fix LibraryInstallerTest 11 years ago
Martin Hasoň b1c4eed57f Throw exception if the local repository does not contain a package to uninstall 11 years ago
Filippo Tessarotto 470adc47df Switched rand() to mt_rand() 12 years ago
Jordi Boggiano d6de4a0036 Rename Package interfaces to reduce BC issues 12 years ago
Jordi Boggiano a2171e2ed1 Expose LibraryInstallerTest properties to child classes 12 years ago
Alexey Prilipko ac3cebc633 Update PEAR Package Extractor to use 'task:replace', 'phprelease' commands and install role='script' files
Add PearInstaller
Change PEAR packages type from 'library' to 'pear-library' and dist type from 'pear' to 'file'
Remove PearDownloader
Refactor Channel Installer
12 years ago
Jordi Boggiano a4c829749e Expose the whole composer context to the custom installers, fixes #672 12 years ago
Grégoire Pineau f4e9dd4fb8 Fixed PSR rules 12 years ago
Jordi Boggiano ef300ca56a Fix tests 12 years ago
Jordi Boggiano 89e095b4b5 Handle --dev installs/updates 12 years ago
Jordi Boggiano ada9c20db1 Update Git/Hg downloaders tests, making sure they never use a live filesystem instance 13 years ago
Wookieb f93135b3bd Cosmetic tests fix - remove test directories 13 years ago
Wookieb 8d3b40ff8e Tests should remove created directories after testing process 13 years ago
Jordi Boggiano 3fe87b1e35 Force dev packages to be installed from source 13 years ago
Wookieb 2467456d3f Fix installer that create vendor and bin directory even if --dry-run parameter provided
* Move directories creation from constructor to "install" and "update" method
* Tests for LibraryInstaller
13 years ago
Jordi Boggiano 5da021ffa7 Moved Filesystem to base Util namespace 13 years ago
Jordi Boggiano 2262a3f864 Fix test 13 years ago
digitalkaoz 4d0fae688e removed replace, reinstalling as install 13 years ago
digitalkaoz 30e89a2402 fixed broken packages on filesystem 13 years ago
Jordi Boggiano e4dbee2648 Fix tests 13 years ago
Jordi Boggiano 94a8e8809c Fix travis builds 13 years ago
Jordi Boggiano 116b17dfc0 Fix test suite for OSX 13 years ago