313 Commits (3cdca37e8588d262efbb3b589f8a68eea73738a2)

Author SHA1 Message Date
Nils Adermann 6409ed0fc2 Validate: Warn about providing or replacing packages you require 4 years ago
Jordi Boggiano c01e3bd2f0
Make async test more robust 4 years ago
Simon Berger 80d71ccb3f Merged isset, unset and str_replace calls 4 years ago
Simon Berger 80a75e9959 Minor code improvements 4 years ago
Jordi Boggiano d942c65e0c
Fix more warnings 4 years ago
Jordi Boggiano 1593b67230
Fix warnings on higher phpunit versions 4 years ago
Simon Berger f3936b82cd Added test to cancel ProcessExecutor::asyncExecute 4 years ago
Nils Adermann 1385412748 Merge branch 'master' into filter-packages
* master:
  Add tests for edge cases of packages providing names which exist as real packages
  Add another test verifying that a package may provide an incompatible version of sth that actually exists
  Fix provider coexistence test, needs another requirement to install both
  Fix test filename to end with .test extension so it gets run
  Update config section to note required scope for GitLab tokens
  Fix pre/post-package-install/update/uninstall events receiving a partial list of operations, fixes #9079
  Also remove credentials from cache dirs in git/svn drivers, fixes #7439, refs #9155
  AuthHelper: Allow fall-through GitLab-specific HTTP headers for auth
  Sanitize repo URLs to mask HTTP auth passwords from cache directory
  Util/Zip: fix strpos args order
4 years ago
Ayesh Karunaratne 931a1ff1f8
AuthHelper: Allow fall-through GitLab-specific HTTP headers for auth
Previously, `AuthHelper` consumed the authentication credentials for GitLab domains and added access tokens as GitLab-specific headers.
[Composer repositories now supported in GitLab](https://php.watch/articles/composer-gitlab-repositories) require standard Authorization headers with a personal access to function, which failed to work due to out GitLab-specific headers.

With this commit, AuthHelper checks if the password is an access token, and falls through to HTTP basic authentication even if the domain name is a GitLab domain name.
4 years ago
Jordi Boggiano 9a04ecefbf
Merge branch 'master' into filter-packages 4 years ago
Jordi Boggiano 4d20e6f5d6
Move Version util to Platform namespace, fix CS nitpicks, make regexes case insensitive for robustness, refs #9093 4 years ago
Jordi Boggiano 7e1ef19a5a
Expand library version checking capabilities (closes #9093) 4 years ago
Wissem Riahi 657ae5519e
Add support for TAR in Artifact packages (#9105) 4 years ago
Wissem Riahi c353ac835c
Add exception for multiple composer.json files (#3) 4 years ago
Jordi Boggiano 942562c382
Clean up Zip Util to be more strict about what is a valid package archive, fixes #8931 4 years ago
Yanick Witschi ea0ce9dd7d Merge branch 'master' into filter-packages 4 years ago
Michael Chekin 6d9bf42655
Additional Util\RemoteFileSystem tests (#8960)
* RemoteFilesystemTest: simplifying some mock expectations calls

- will($this->returnValue()) to willReturn()
- will($this->returnCallBack()) to willReturnCallback()

* RemoteFilesystemTest: extracting identical mocks for IOInterface into a separate getIOInterfaceMock() method

* RemoteFilesystemTest: converting protected helper methods to private.

* RemoteFilesystemTest: moving getConfigMock() private method after the public methods (with other private methods)

* adding RemoteFileSystemTest::testCopyWithRetryAuthFailureFalse() unit test.

* Allow optional injecting of AuthHelper into RemoteFilesystem constructor.

* adding RemoteFileSystemTest::testCopyWithSuccessOnRetry() unit test.

* using backward compatible @expectedException in RemoteFilesystemTest.php

* RemoteFilesystemTest: extracting RemoteFilesystem with mocked method creation into a separate method.

* RemoteFilesystemTest: extracting AuthHelper with mocked method creation into a separate method.
4 years ago
Jordi Boggiano 67a88880ec
Get rid of EmptyConstraint 4 years ago
Jordi Boggiano 4e1f8cf89d
Build tweaks 4 years ago
Jordi Boggiano dd0c8b4278
Merge pull request #8723 from helhum/fix-package-sorting
Fix package sorting
4 years ago
Michael Chekin c23670c3ec
Add Util\AuthHelper unit test coverage (#8863)
* Add AuthHelper::addAuthenticationHeader() test on missing authentication credentials.

* Add AuthHelper::addAuthenticationHeader() test on bearer password.

* Add AuthHelper::addAuthenticationHeader() test on Github token.

* Add AuthHelper::addAuthenticationHeader() test on Gitlab Oauth token.

* Add $authenticationDisplayMessage write expectation to AuthHelper::addAuthenticationHeader() tests.

* Add AuthHelper::addAuthenticationHeader() test on Gitlab private token.

* Add AuthHelper::addAuthenticationHeader() test on Bitbucket Oauth token.

* Add AuthHelper::addAuthenticationHeader() test on Bitbucket public urls.

* Add AuthHelper::addAuthenticationHeader() test on Basic Http Authentication.

* Add AuthHelper::isPublicBitBucketDownload() tests.

* Rename AuthHelperTest $credentials variable to $auth.

* Add AuthHelper::storeAuth() test for auto-store option.

* Add AuthHelper::storeAuth() test for user prompt and y(es) answer.

* Add AuthHelper::storeAuth() test for user prompt and n(o) answer.

* Add AuthHelper::storeAuth() test for user prompt with invalid answer.

* Add AuthHelper::promptAuthIfNeeded() test for Github authentication failure.

- add GitHub hard dependency mock (new GitHub(...) mock)

* Run AuthHelper::promptAuthIfNeeded() tests only with PHP > 5.3

* Run AuthHelper::promptAuthIfNeeded() tests only with PHP >= 5.4

* Run AuthHelper::promptAuthIfNeeded() tests only with PHP 5.4

* Exclude PHPStan analyses of '../tests/Composer/Test/Util/Mocks/*'

* Exclude AuthHelper::promptAuthIfNeeded() tests from current pull request.

* Extract repetitive AuthHelperTest authentication expectation into a method.
4 years ago
Helmut Hummel 7c891701e6 Fix package sorting
PackageSorter weighs the importance of a package
by counting how many times it is required by other packages.
This works by calculating the weight for each package name.

However currently the package index of the package array
is currently passed the weigh function, which basically
disables package sorting.

The reason for that is, that a package repository previously
returned the package list as associative array with  package name as keys,
but currently just as an array with integer keys.

Therefore we must extract the package name from the package
before passing it to the weigh function.
4 years ago
Michael Chekin b9be78b689
Additional Util\Bitbucket class test coverage (#8835) 4 years ago
Jordi Boggiano 45ecbae8f5
Merge branch 'master' into 2.0 4 years ago
Ion Bazan a9bace37f6 fix windows build 4 years ago
Ion Bazan 58b34d13e8 fix risky tests (without any assertion) 4 years ago
Ion Bazan a2137d5263 use Symfony PHPUnit Bridge 4 years ago
Jordi Boggiano 1e68555e0a
Sanitize URLs in getRepoName and centralize the Url sanitization process 4 years ago
Jordi Boggiano 30b6a41035
Extract MetadataMinifier util 5 years ago
Jordi Boggiano 4a7d42604f
Fix tests 5 years ago
Jordi Boggiano a5b178084c
Merge branch 'master' into 2.0 5 years ago
Jordi Boggiano c43137db3f
Merge branch '1.9' 5 years ago
Jordi Boggiano 4e667f891b
Fix 5.3 build 5 years ago
Jordi Boggiano 23359f2db6
Merge branch 'master' into 2.0 5 years ago
Jordi Boggiano 3d72b56ed6
Merge branch '1.9' 5 years ago
Jordi Boggiano d3f1c664d4
Avoid formatting output from external processes, fixes #8524 5 years ago
Ondrej Mirtes 7d4d4622ab
ProcessExecutor - do not format output from executed processes 5 years ago
johnstevenson 00da9b125d Tidy and fix tests 5 years ago
johnstevenson 74ba9decdf Rewrite NoProxyPattern to include IPv6
This includes two breaking changes:
- the hostname is not resolved in the case of an IP address.
- a hostname with a trailing period (FQDN) is not matched.

This brings the basic implementation in line with curl behaviour, with
the addition of full IP address and range matching (curl does not
differentiate between IP addresses host names).

The NO_PROXY environment variable can be set to either a comma-separated
list of host names that should not use a proxy, or single asterisk `*`
to match all hosts.

- Port numbers can be included by prefixing the port with a colon `:`.
- IP addresses can be used, but must be enclosed in square brackets
`[...]` if they include a port number.
- IP address ranges can specified in CIDR notation, separating the IP
address and prefix-length with a forward slash `/`.
5 years ago
Jordi Boggiano 88b051c96b
Merge branch 'master' into 2.0
Update deps
5 years ago
Stephan Vock b847115617 Git: fix authentication handling for private GitHub repositories 5 years ago
Jordi Boggiano bc2a1d762a
Merge branch 'master' into 2.0 5 years ago
johnstevenson 8d9b822413 Add messages to junction tests to see failures 5 years ago
Jordi Boggiano 6c4357a7ed
Merge branch 'master' into 2.0 5 years ago
Jordi Boggiano 26a3e12c96
Merge pull request #7994 from aschempp/feature/zip-util
Extract the ZIP utility functions from ArtifactRepository
5 years ago
Gabriel Caruso 6c8ddd4d57
Remove unused private properties 5 years ago
Nils Adermann d2fa1e1319 Merge branch 'master' into 2.0
* master: (48 commits)
  SVN: hide passwords for debug output
  Free $solver asap
  fixes #8179
  [minor] Fixed a typo in the CHANGELOG.md.
  Update deps
  Update changelog
  Revert "Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET" Revert "Add docs for COMPOSER_SELF_UPDATE_TARGET, refs #8151"
  Add docs for COMPOSER_SELF_UPDATE_TARGET, refs #8151
  Fix display of HHVM warning appearing when HHVM is not in use, fixes #8138
  Read classmap-authoritative and apcu-autoloader from project config when installing via create-project, fixes #8155
  Use possessive quantifiers
  Update xdebug-handler to 1.3.3
  fixes #8159
  Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET
  flag should come before script name
  use full command name, not abbreviated/alias
  modify text
  Document the alternatives to disable the default script timeout
  Anchor pattern
  Fix URL resolution for Composer repositories
  ...
5 years ago
Stephan Vock 8da046e4e9 SVN: hide passwords for debug output 5 years ago
Andreas Schempp 0e2215dc6c Added full unit test coverage 5 years ago
Jordi Boggiano 64384f8b15 Fix tests 6 years ago
Jordi Boggiano fd11cf3618 Port/extract most behavior of RemoteFilesystem to CurlDownloader 6 years ago
Jordi Boggiano 1cd9f4f9db Disable request_fulluri by default for HTTPS connections 6 years ago
Jordi Boggiano 713bc4de1d Minor fixes and updated the rest of the code/tests to use HttpDownloader 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 bf125295df Fix escaping of URLs in Perforce and Subversion drivers 6 years ago
Jordi Boggiano ff59bbdab0 CS fixer 6 years ago
Jordi Boggiano 38866ba310 Merge remote-tracking branch 'johnstevenson/external-xdebug' 6 years ago
Jordi Boggiano bfa01285c2 Merge branch '1.6' 6 years ago
Jordi Boggiano 066351c5b9 Remove use of deprecated getMock method 6 years ago
johnstevenson ed97c2116c Use external XdebugHandler library 6 years ago
Jordi Boggiano ea9b7ecbb0
Merge pull request #6982 from carusogabriel/phpstan
Fixes from PHPStan level 0
7 years ago
Martin Hujer bbee0d7c6c Validation warns if script description for nonexistent script is present
Fixes #7010
7 years ago
Gabriel Caruso 3d262bd637 Fixes from PHPStan level 0
More fixes from PHPStan level 0
7 years ago
Tomas Klinkenberg 60106edd32 Added a test to confirm issue #6994.
Added a encapsulated group to the replacement parameter of the `preg_replace` for GitLab in `\Composer\Util\Url::updateDistReference()`. This fixes #6994.
7 years ago
Jordi Boggiano e6114b2ca7 Fix support for replacing dist refs in gitlab URLs and add support for gitlab/github enterprise too 7 years ago
Jordi Boggiano c8aea719b1 CS fixes 7 years ago
Gabriel Caruso 885da4c8ef Refactoring tests 7 years ago
Gabriel Caruso afc9a7643e Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase 7 years ago
Gabriel Caruso a4b220273e Refactoring Tests (#6849) 7 years ago
Jordi Boggiano eab826b00b Merge branch '1.5' 7 years ago
Jordi Boggiano 45cd26b2df Fix test and actually check that we get hasAuthentication called for different domains 7 years ago
Jordi Boggiano 0b3bc4ccb9 Merge branch '1.5' 7 years ago
johnstevenson b0922b95af Report multiple inis in php.ini specific messages
Where systems use multiple ini files it is perhaps more useful to
suggest running `php --ini` to see their locations, rather than showing
the loaded php.ini (if one exists).
7 years ago
croensch 6da92e98ac also support NO_PROXY
since WINDOWS can only have one case and that is usually upperase
7 years ago
Vladimir Reznichenko c8615358cb SCA with PHP Inspections (EA Extended) 7 years ago
Christian Ramelow f178c340e9 Fixed tests. 7 years ago
Christian Ramelow 39d8104897 Introduces a new method `copy()`.
Some packages, e. g. `tm/tooly-composer-script`, are using the composer classes to e. g. create symlinks or perform other file operations. While there's only a `copyThenRemove()` method this commit introduces a new `copy()` method. `copy()` behaves the same as the copy part of `copyThenRemove()` did with one exception: it returns `true` on success and `false` on failure. Copying a directory may lead to a `false`, while the whole directory or some of its files couldn't been copied. To ensure backwards compatibility `copyThenRemove()` calls `copy()` now. This commit also adds the necessary tests.
7 years ago
Martin Hasoň 88ec172bd8 Fix CS 7 years ago
Jordi Boggiano 122e422682 CS fixes 7 years ago
Stefan Grootscholten 512750a20e Add more tests to cover the new functionality. 8 years ago
Stefan Grootscholten a4af559ca8 Store access-token for re-use
Store the Bitbucket access-token (and the expiration time) so it can be re-used within the time it is valid.
The Bitbucket::requestToken and Bitbucket::getToken now only return the access-token and not all other parameters it receives from the Bitbucket API.
8 years ago
Jordi Boggiano e9d04f2b2d Merge branch '1.2' 8 years ago
Dries Vints 2ab7df5566 Do not add newlines to output 8 years ago
johnstevenson 379fb70ad9 Use random name for tmp ini and delete after use
Thanks to Patrick Rose for reporting this issue.
8 years ago
Jordi Boggiano 43903a3979 Merge branch '1.2' 8 years ago
Fabien Potencier 103624d4ed Remove usage of echo when executing Composer script 8 years ago
Jordi Boggiano 183398fe5e Merge pull request #5717 from berlinger-rarents/fix/5584_anon_redirect_bitbucket
prevent (prompt for) bitbucket auth when it redirected
8 years ago
Roel Arents d338a95174 use seldaek's bitbucket repo for unit tests instead of 3rd party 8 years ago
berlinger-rarents 8845ea467a try bitbucket downloads first time without auth
also add tests for #5584
8 years ago
Rob Bast b4fd19aae4
add test exposing the problem 8 years ago
Jordi Boggiano ff7daf0bd4 Fix handling of paths on windows when cwd is root of drive, fixes #5554 8 years ago
Stefan Grootscholten 9b00713a67 Update unit test for Bitbucket util 8 years ago
Jordi Boggiano 39c2c8c30a Add test for password escaping 8 years ago
Stefan Grootscholten 2d52531365 Add unit tests for the Bitbucket class. 8 years ago
Jordi Boggiano 73d9a4717d Update list of ciphers /cc @cs278 8 years ago
Hiraku NAKANO 8501bb71e2 Drop dependency on http://www.example.com 8 years ago
Jordi Boggiano d8c94c2640 Merge remote-tracking branch 'curry684/home-expansion' 8 years ago
Niels Keurentjes c9534d48c1 Made env variable parsing in path replacements generic across platforms and replaced old config.php implementation. 8 years ago
Niels Keurentjes f5422a441d Fixed Windows path separators and updated docs. 8 years ago
Niels Keurentjes 7e71b2bfbc Added support for expanding environment variables in paths, and tilde expansion on Windows. 8 years ago