diff --git a/.travis.yml b/.travis.yml index 49822707f..6c5993f0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,18 +25,17 @@ matrix: - php: 7.1 - php: 7.2 - php: 7.3 + - php: 7.4 env: - deps=high - - PHPSTAN=1 - - php: 7.3 + - SYMFONY_PHPUNIT_VERSION=7.5 + - php: 7.4 env: - deps=high - - php: nightly - - php: 7.4snapshot + - PHPSTAN=1 fast_finish: true allow_failures: - php: nightly - - php: 7.4snapshot before_install: # disable Xdebug if available @@ -62,8 +61,7 @@ before_script: - git config --global user.email travis@example.com script: - # run test suite directories in parallel using GNU parallel - - ls -d tests/Composer/Test/* | grep -v TestCase.php | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/complete.phpunit.xml --colors=always {} || (echo -e "\e[41mFAILED\e[0m {}" && exit 1);' + - ./vendor/bin/simple-phpunit # Run PHPStan - if [[ $PHPSTAN == "1" ]]; then bin/composer require --dev phpstan/phpstan:^0.12 && @@ -81,4 +79,4 @@ deploy: on: tags: true repo: composer/composer - php: '7.2' + php: '7.3' diff --git a/CHANGELOG.md b/CHANGELOG.md index 07ee13703..6002b5a79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,14 @@ * Added debug info about HTTP authentications * Added Symfony 5 compatibility * Added --fixed flag to require command to make it use a fixed constraint instead of a ^x.y constraint when adding the requirement - * Fixed GitHub deprecation of access_token query parameter, now using Authorization header * Fixed archive command to persist file permissions inside the zip files * Fixed init/require command to avoid suggesting packages which are already selected in the search results * Fixed create-project UX issues +### [1.9.3] 2020-02-04 + + * Fixed GitHub deprecation of access_token query parameter, now using Authorization header + ### [1.9.2] 2020-01-14 * Fixed minor git driver bugs @@ -801,7 +804,8 @@ * Initial release -[1.10.0]: https://github.com/composer/composer/compare/1.9.2...1.10.0 +[1.10.0]: https://github.com/composer/composer/compare/1.9.3...1.10.0 +[1.9.3]: https://github.com/composer/composer/compare/1.9.2...1.9.3 [1.9.2]: https://github.com/composer/composer/compare/1.9.1...1.9.2 [1.9.1]: https://github.com/composer/composer/compare/1.9.0...1.9.1 [1.9.0]: https://github.com/composer/composer/compare/1.8.6...1.9.0 diff --git a/appveyor.yml b/appveyor.yml index cb0f3d33c..922a20e75 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -30,4 +30,4 @@ install: test_script: - cd %APPVEYOR_BUILD_FOLDER% - - vendor\bin\phpunit --colors=always + - vendor\bin\simple-phpunit --colors=always diff --git a/composer.json b/composer.json index 435aa5c01..ba26cf7ec 100644 --- a/composer.json +++ b/composer.json @@ -41,8 +41,8 @@ "symfony/console": "2.8.38" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7", - "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" + "symfony/phpunit-bridge": "^3.4", + "phpspec/prophecy": "^1.10" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -79,7 +79,7 @@ ], "scripts": { "compile": "@php -dphar.readonly=0 bin/compile", - "test": "phpunit" + "test": "simple-phpunit" }, "scripts-descriptions": { "compile": "Compile composer.phar", diff --git a/composer.lock b/composer.lock index be13e4253..c06a99519 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7fb7edae7611d2e07d946d75b9cf2c63", + "content-hash": "7bfefa6f7d4d8c18836028dae680bd4f", "packages": [ { "name": "composer/ca-bundle", @@ -45,6 +45,13 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", "keywords": [ "cabundle", @@ -90,6 +97,23 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ "semantic", @@ -134,7 +158,29 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], "time": "2019-07-29T10:31:59+00:00" }, { @@ -341,6 +387,12 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], "description": "A lightweight implementation of CommonJS Promises/A for PHP", "time": "2016-03-07T13:46:50+00:00" }, @@ -429,6 +481,12 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], "description": "PHAR file format utilities, for when PHP phars you up", "keywords": [ "phra" @@ -750,6 +808,16 @@ "license": [ "MIT" ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ @@ -918,33 +986,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -956,344 +1024,28 @@ "license": [ "MIT" ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "time": "2019-10-03T11:07:50+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2" - }, - "time": "2015-10-06T15:47:00+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.12", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "time": "2017-12-04T08:55:13+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.36", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36" - }, - "time": "2017-06-21T08:07:12+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2020-01-20T15:57:02+00:00" }, { "name": "sebastian/comparator", @@ -1332,8 +1084,31 @@ "license": [ "BSD-3-Clause" ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], "description": "Provides the functionality to compare PHP values for equality", "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], "time": "2017-01-29T09:50:25+00:00" }, { @@ -1371,81 +1146,40 @@ "license": [ "BSD-3-Clause" ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "diff" ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/1.3" - }, - "time": "2016-08-18T05:49:44+00:00" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", @@ -1454,7 +1188,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1466,64 +1200,48 @@ "license": [ "BSD-3-Clause" ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], "description": "Provides the functionality to export PHP variables for visualization", "homepage": "http://www.github.com/sebastianbergmann/exporter", - "time": "2016-06-17T09:04:28+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" + "keywords": [ + "export", + "exporter" ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "time": "2015-10-12T03:26:01+00:00" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.5", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { @@ -1535,7 +1253,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1547,65 +1265,66 @@ "license": [ "BSD-3-Clause" ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2016-11-19T07:33:16+00:00" }, { - "name": "sebastian/version", - "version": "1.0.6", + "name": "symfony/phpunit-bridge", + "version": "v3.4.37", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "url": "https://github.com/symfony/phpunit-bridge.git", + "reference": "ebfd1b428ffc14306e843092763f228bfba168d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/ebfd1b428ffc14306e843092763f228bfba168d0", + "reference": "ebfd1b428ffc14306e843092763f228bfba168d0", "shasum": "" }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" - }, - { - "name": "symfony/yaml", - "version": "v2.8.52", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" + "require": { + "php": ">=5.3.3" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", - "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", - "shasum": "" + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, - "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "~1.8" + "suggest": { + "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, - "type": "library", + "bin": [ + "bin/simple-phpunit" + ], + "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.4-dev" + }, + "thanks": { + "name": "phpunit/phpunit", + "url": "https://github.com/sebastianbergmann/phpunit" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Bridge\\PhpUnit\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1617,20 +1336,17 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Yaml Component", + "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v2.8.52" - }, - "time": "2018-11-11T11:18:13+00:00" + "time": "2020-01-14T14:27:59+00:00" } ], "aliases": [], diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bb3b94774..e26271845 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,10 +8,14 @@ convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" + strict="false" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" > + + + ./tests/Composer/ diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index d9a1f87bd..9d67e7d83 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -247,13 +247,13 @@ class Installer return $res; } } catch (\Exception $e) { - if ($this->executeOperations) { + if ($this->executeOperations && $this->config->get('notify-on-install')) { $this->installationManager->notifyInstalls($this->io); } throw $e; } - if ($this->executeOperations) { + if ($this->executeOperations && $this->config->get('notify-on-install')) { $this->installationManager->notifyInstalls($this->io); } diff --git a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index ba89ccea9..200817fb0 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -351,10 +351,10 @@ class AutoloadGeneratorTest extends TestCase file_put_contents($this->workingDir.'/bar.php', 'generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, 'TargetDir'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_target_dir.php', $this->vendorDir.'/autoload.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_real_target_dir.php', $this->vendorDir.'/composer/autoload_real.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_static_target_dir.php', $this->vendorDir.'/composer/autoload_static.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_files_target_dir.php', $this->vendorDir.'/composer/autoload_files.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_target_dir.php', $this->vendorDir.'/autoload.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_real_target_dir.php', $this->vendorDir.'/composer/autoload_real.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_static_target_dir.php', $this->vendorDir.'/composer/autoload_static.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_files_target_dir.php', $this->vendorDir.'/composer/autoload_files.php'); $this->assertAutoloadFiles('classmap6', $this->vendorDir.'/composer', 'classmap'); } @@ -793,10 +793,10 @@ EOF; file_put_contents($this->workingDir.'/root.php', 'generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, 'FilesAutoload'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_real_functions.php', $this->vendorDir.'/composer/autoload_real.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_static_functions.php', $this->vendorDir.'/composer/autoload_static.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_files_functions.php', $this->vendorDir.'/composer/autoload_files.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_real_functions.php', $this->vendorDir.'/composer/autoload_real.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_static_functions.php', $this->vendorDir.'/composer/autoload_static.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_files_functions.php', $this->vendorDir.'/composer/autoload_files.php'); include $this->vendorDir . '/autoload.php'; $this->assertTrue(function_exists('testFilesAutoloadGeneration1')); @@ -861,22 +861,22 @@ EOF; file_put_contents($this->workingDir.'/root.php', 'generator->dump($this->config, $this->repository, $autoloadPackage, $this->im, 'composer', false, 'FilesAutoload'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_real_functions_with_include_paths.php', $this->vendorDir.'/composer/autoload_real.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_static_functions_with_include_paths.php', $this->vendorDir.'/composer/autoload_static.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_files_functions.php', $this->vendorDir.'/composer/autoload_files.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/include_paths_functions.php', $this->vendorDir.'/composer/include_paths.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_real_functions_with_include_paths.php', $this->vendorDir.'/composer/autoload_real.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_static_functions_with_include_paths.php', $this->vendorDir.'/composer/autoload_static.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_files_functions.php', $this->vendorDir.'/composer/autoload_files.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/include_paths_functions.php', $this->vendorDir.'/composer/include_paths.php'); $this->generator->dump($this->config, $this->repository, $autoloadPackage, $this->im, 'composer', false, 'FilesAutoload'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_real_functions_with_include_paths.php', $this->vendorDir.'/composer/autoload_real.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_files_functions_with_removed_extra.php', $this->vendorDir.'/composer/autoload_files.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/include_paths_functions_with_removed_extra.php', $this->vendorDir.'/composer/include_paths.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_real_functions_with_include_paths.php', $this->vendorDir.'/composer/autoload_real.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_files_functions_with_removed_extra.php', $this->vendorDir.'/composer/autoload_files.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/include_paths_functions_with_removed_extra.php', $this->vendorDir.'/composer/include_paths.php'); $this->generator->dump($this->config, $this->repository, $notAutoloadPackage, $this->im, 'composer', false, 'FilesAutoload'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_real_functions_with_removed_include_paths_and_autolad_files.php', $this->vendorDir.'/composer/autoload_real.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_static_functions_with_removed_include_paths_and_autolad_files.php', $this->vendorDir.'/composer/autoload_static.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_real_functions_with_removed_include_paths_and_autolad_files.php', $this->vendorDir.'/composer/autoload_real.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_static_functions_with_removed_include_paths_and_autolad_files.php', $this->vendorDir.'/composer/autoload_static.php'); $this->assertFileNotExists($this->vendorDir.'/composer/autoload_files.php'); $this->assertFileNotExists($this->vendorDir.'/composer/include_paths.php'); } @@ -930,9 +930,9 @@ EOF; file_put_contents($this->workingDir . '/root2.php', 'generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, 'FilesAutoloadOrder'); - $this->assertFileEquals(__DIR__ . '/Fixtures/autoload_functions_by_dependency.php', $this->vendorDir . '/autoload.php'); - $this->assertFileEquals(__DIR__ . '/Fixtures/autoload_real_files_by_dependency.php', $this->vendorDir . '/composer/autoload_real.php'); - $this->assertFileEquals(__DIR__ . '/Fixtures/autoload_static_files_by_dependency.php', $this->vendorDir . '/composer/autoload_static.php'); + $this->assertFileContentEquals(__DIR__ . '/Fixtures/autoload_functions_by_dependency.php', $this->vendorDir . '/autoload.php'); + $this->assertFileContentEquals(__DIR__ . '/Fixtures/autoload_real_files_by_dependency.php', $this->vendorDir . '/composer/autoload_real.php'); + $this->assertFileContentEquals(__DIR__ . '/Fixtures/autoload_static_files_by_dependency.php', $this->vendorDir . '/composer/autoload_static.php'); require $this->vendorDir . '/autoload.php'; @@ -1070,7 +1070,7 @@ EOF; $this->generator->dump($this->config, $this->repository, $package, $this->im, "composer", false, '_10'); - $this->assertFileEquals(__DIR__.'/Fixtures/include_paths.php', $this->vendorDir.'/composer/include_paths.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/include_paths.php', $this->vendorDir.'/composer/include_paths.php'); $this->assertEquals( array( $this->vendorDir."/a/a/lib", @@ -1198,8 +1198,8 @@ EOF; $this->fs->ensureDirectoryExists($this->vendorDir.'/a'); $this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, 'IncludePath'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_real_include_path.php', $this->vendorDir.'/composer/autoload_real.php'); - $this->assertFileEquals(__DIR__.'/Fixtures/autoload_static_include_path.php', $this->vendorDir.'/composer/autoload_static.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_real_include_path.php', $this->vendorDir.'/composer/autoload_real.php'); + $this->assertFileContentEquals(__DIR__.'/Fixtures/autoload_static_include_path.php', $this->vendorDir.'/composer/autoload_static.php'); } public function testVendorDirExcludedFromWorkingDir() @@ -1577,12 +1577,12 @@ EOF; { $a = __DIR__.'/Fixtures/autoload_'.$name.'.php'; $b = $dir.'/autoload_'.$type.'.php'; - $this->assertFileEquals($a, $b); + $this->assertFileContentEquals($a, $b); } - public static function assertFileEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false) + public static function assertFileContentEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false) { - return self::assertEquals( + self::assertEqualsNormalized( file_get_contents($expected), file_get_contents($actual), $message ?: $expected.' equals '.$actual, @@ -1593,8 +1593,8 @@ EOF; ); } - public static function assertEquals($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) + public static function assertEqualsNormalized($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) { - return parent::assertEquals(str_replace("\r", '', $expected), str_replace("\r", '', $actual), $message, $delta, $maxDepth, $canonicalize, $ignoreCase); + parent::assertEquals(str_replace("\r", '', $expected), str_replace("\r", '', $actual), $message, $delta, $maxDepth, $canonicalize, $ignoreCase); } } diff --git a/tests/Composer/Test/Autoload/ClassLoaderTest.php b/tests/Composer/Test/Autoload/ClassLoaderTest.php index 14d10e16d..bb597890d 100644 --- a/tests/Composer/Test/Autoload/ClassLoaderTest.php +++ b/tests/Composer/Test/Autoload/ClassLoaderTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Autoload; use Composer\Autoload\ClassLoader; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * Tests the Composer\Autoload\ClassLoader class. diff --git a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php index ae7b597b7..c095baa0c 100644 --- a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php +++ b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php @@ -240,7 +240,7 @@ class ClassMapGeneratorTest extends TestCase $fs->removeDirectory($tempDir); } - protected function assertEqualsNormalized($expected, $actual, $message = null) + protected function assertEqualsNormalized($expected, $actual, $message = '') { foreach ($expected as $ns => $path) { $expected[$ns] = strtr($path, '\\', '/'); diff --git a/tests/Composer/Test/CacheTest.php b/tests/Composer/Test/CacheTest.php index 1c4c67c98..dffa8390a 100644 --- a/tests/Composer/Test/CacheTest.php +++ b/tests/Composer/Test/CacheTest.php @@ -108,14 +108,8 @@ class CacheTest extends TestCase public function testClearCache() { - $this->filesystem - ->method('removeDirectory') - ->with($this->root.'/') - ->willReturn(true); - $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $this->cache = new Cache($io, $this->root, 'a-z0-9.', $this->filesystem); - $this->assertTrue($this->cache->clear()); } } diff --git a/tests/Composer/Test/ConfigTest.php b/tests/Composer/Test/ConfigTest.php index 57c368988..750dd627d 100644 --- a/tests/Composer/Test/ConfigTest.php +++ b/tests/Composer/Test/ConfigTest.php @@ -222,6 +222,7 @@ class ConfigTest extends TestCase /** * @dataProvider allowedUrlProvider + * @doesNotPerformAssertions * * @param string $url */ diff --git a/tests/Composer/Test/Console/HtmlOutputFormatterTest.php b/tests/Composer/Test/Console/HtmlOutputFormatterTest.php index 7587743f7..d23bcddb2 100644 --- a/tests/Composer/Test/Console/HtmlOutputFormatterTest.php +++ b/tests/Composer/Test/Console/HtmlOutputFormatterTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Console; use Composer\Console\HtmlOutputFormatter; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; use Symfony\Component\Console\Formatter\OutputFormatterStyle; class HtmlOutputFormatterTest extends TestCase diff --git a/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php b/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php index a80c5aea2..4ebf37bf3 100644 --- a/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php +++ b/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php @@ -18,7 +18,7 @@ use Composer\DependencyResolver\RuleSet; use Composer\DependencyResolver\RuleSetIterator; use Composer\DependencyResolver\Pool; use Composer\Package\BasePackage; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class RuleSetIteratorTest extends TestCase { diff --git a/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php b/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php index d887ba103..360539859 100644 --- a/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ArchiveDownloaderTest.php @@ -12,7 +12,7 @@ namespace Composer\Test\Downloader; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class ArchiveDownloaderTest extends TestCase { diff --git a/tests/Composer/Test/Downloader/DownloadManagerTest.php b/tests/Composer/Test/Downloader/DownloadManagerTest.php index 307b2294f..4253882b6 100644 --- a/tests/Composer/Test/Downloader/DownloadManagerTest.php +++ b/tests/Composer/Test/Downloader/DownloadManagerTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Downloader; use Composer\Downloader\DownloadManager; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class DownloadManagerTest extends TestCase { diff --git a/tests/Composer/Test/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index 7c4259ca3..2366df770 100644 --- a/tests/Composer/Test/Downloader/FileDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FileDownloaderTest.php @@ -224,7 +224,7 @@ class FileDownloaderTest extends TestCase public function testDowngradeShowsAppropriateMessage() { $oldPackage = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); - $oldPackage->expects($this->any()) + $oldPackage->expects($this->once()) ->method('getFullPrettyVersion') ->will($this->returnValue('1.2.0')); $oldPackage->expects($this->once()) diff --git a/tests/Composer/Test/Downloader/FossilDownloaderTest.php b/tests/Composer/Test/Downloader/FossilDownloaderTest.php index 4ec8fed45..40ab561db 100644 --- a/tests/Composer/Test/Downloader/FossilDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FossilDownloaderTest.php @@ -157,7 +157,7 @@ class FossilDownloaderTest extends TestCase ->method('execute') ->with($this->equalTo($expectedResetCommand)); $filesystem = $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); - $filesystem->expects($this->any()) + $filesystem->expects($this->once()) ->method('removeDirectory') ->with($this->equalTo('composerPath')) ->will($this->returnValue(true)); diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index 1b3f1ebe2..ea8defea4 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -712,7 +712,7 @@ composer https://github.com/old/url (push) ->with($this->equalTo($expectedGitResetCommand)) ->will($this->returnValue(0)); $filesystem = $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); - $filesystem->expects($this->any()) + $filesystem->expects($this->once()) ->method('removeDirectory') ->with($this->equalTo('composerPath')) ->will($this->returnValue(true)); diff --git a/tests/Composer/Test/Downloader/HgDownloaderTest.php b/tests/Composer/Test/Downloader/HgDownloaderTest.php index c69d497ce..0b00bd7d2 100644 --- a/tests/Composer/Test/Downloader/HgDownloaderTest.php +++ b/tests/Composer/Test/Downloader/HgDownloaderTest.php @@ -146,7 +146,7 @@ class HgDownloaderTest extends TestCase ->method('execute') ->with($this->equalTo($expectedResetCommand)); $filesystem = $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); - $filesystem->expects($this->any()) + $filesystem->expects($this->once()) ->method('removeDirectory') ->with($this->equalTo('composerPath')) ->will($this->returnValue(true)); diff --git a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php index b6347789b..ca9386332 100644 --- a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php +++ b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php @@ -104,6 +104,9 @@ class PerforceDownloaderTest extends TestCase return $repository; } + /** + * @doesNotPerformAssertions + */ public function testInitPerforceInstantiatesANewPerforceObject() { $this->downloader->initPerforce($this->package, $this->testPath, 'SOURCE_REF'); diff --git a/tests/Composer/Test/Installer/InstallationManagerTest.php b/tests/Composer/Test/Installer/InstallationManagerTest.php index 9e12ec215..9f9bf5572 100644 --- a/tests/Composer/Test/Installer/InstallationManagerTest.php +++ b/tests/Composer/Test/Installer/InstallationManagerTest.php @@ -17,7 +17,7 @@ use Composer\Installer\NoopInstaller; use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\UpdateOperation; use Composer\DependencyResolver\Operation\UninstallOperation; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class InstallationManagerTest extends TestCase { diff --git a/tests/Composer/Test/Installer/InstallerEventTest.php b/tests/Composer/Test/Installer/InstallerEventTest.php index 0ac71bd55..9be6c8121 100644 --- a/tests/Composer/Test/Installer/InstallerEventTest.php +++ b/tests/Composer/Test/Installer/InstallerEventTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Installer; use Composer\Installer\InstallerEvent; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class InstallerEventTest extends TestCase { diff --git a/tests/Composer/Test/Installer/LibraryInstallerTest.php b/tests/Composer/Test/Installer/LibraryInstallerTest.php index 672f8eb0a..f2f2e89e6 100644 --- a/tests/Composer/Test/Installer/LibraryInstallerTest.php +++ b/tests/Composer/Test/Installer/LibraryInstallerTest.php @@ -35,7 +35,7 @@ class LibraryInstallerTest extends TestCase $this->fs = new Filesystem; $this->composer = new Composer(); - $this->config = new Config(); + $this->config = new Config(false); $this->composer->setConfig($this->config); $this->rootDir = $this->getUniqueTmpDirectory(); diff --git a/tests/Composer/Test/Installer/MetapackageInstallerTest.php b/tests/Composer/Test/Installer/MetapackageInstallerTest.php index 171773579..481de79da 100644 --- a/tests/Composer/Test/Installer/MetapackageInstallerTest.php +++ b/tests/Composer/Test/Installer/MetapackageInstallerTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Installer; use Composer\Installer\MetapackageInstaller; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class MetapackageInstallerTest extends TestCase { diff --git a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php index 6aef0fa7d..03bb0b5fb 100644 --- a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php +++ b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Installer; use Composer\Installer\SuggestedPackagesReporter; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * @coversDefaultClass Composer\Installer\SuggestedPackagesReporter diff --git a/tests/Composer/Test/Json/ComposerSchemaTest.php b/tests/Composer/Test/Json/ComposerSchemaTest.php index 42774331c..13ead0ad2 100644 --- a/tests/Composer/Test/Json/ComposerSchemaTest.php +++ b/tests/Composer/Test/Json/ComposerSchemaTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Json; use JsonSchema\Validator; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * @author Rob Bast diff --git a/tests/Composer/Test/Json/JsonFileTest.php b/tests/Composer/Test/Json/JsonFileTest.php index c34a321f0..7ac7d0277 100644 --- a/tests/Composer/Test/Json/JsonFileTest.php +++ b/tests/Composer/Test/Json/JsonFileTest.php @@ -14,7 +14,7 @@ namespace Composer\Test\Json; use Seld\JsonLint\ParsingException; use Composer\Json\JsonFile; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class JsonFileTest extends TestCase { diff --git a/tests/Composer/Test/Json/JsonFormatterTest.php b/tests/Composer/Test/Json/JsonFormatterTest.php index 417f267e3..94f95871b 100644 --- a/tests/Composer/Test/Json/JsonFormatterTest.php +++ b/tests/Composer/Test/Json/JsonFormatterTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Json; use Composer\Json\JsonFormatter; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class JsonFormatterTest extends TestCase { diff --git a/tests/Composer/Test/Json/JsonManipulatorTest.php b/tests/Composer/Test/Json/JsonManipulatorTest.php index 063fcbc5e..9a0274740 100644 --- a/tests/Composer/Test/Json/JsonManipulatorTest.php +++ b/tests/Composer/Test/Json/JsonManipulatorTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Json; use Composer\Json\JsonManipulator; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class JsonManipulatorTest extends TestCase { diff --git a/tests/Composer/Test/Json/JsonValidationExceptionTest.php b/tests/Composer/Test/Json/JsonValidationExceptionTest.php index 99c0ad2ee..3846b8d28 100644 --- a/tests/Composer/Test/Json/JsonValidationExceptionTest.php +++ b/tests/Composer/Test/Json/JsonValidationExceptionTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Json; use Composer\Json\JsonValidationException; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class JsonValidationExceptionTest extends TestCase { diff --git a/tests/Composer/Test/Package/Archiver/GitExcludeFilterTest.php b/tests/Composer/Test/Package/Archiver/GitExcludeFilterTest.php index d951ea191..650dac6ee 100644 --- a/tests/Composer/Test/Package/Archiver/GitExcludeFilterTest.php +++ b/tests/Composer/Test/Package/Archiver/GitExcludeFilterTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Package\Archiver; use Composer\Package\Archiver\GitExcludeFilter; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class GitExcludeFilterTest extends TestCase { diff --git a/tests/Composer/Test/Package/Archiver/HgExcludeFilterTest.php b/tests/Composer/Test/Package/Archiver/HgExcludeFilterTest.php index cb050873f..ffcd71b1d 100644 --- a/tests/Composer/Test/Package/Archiver/HgExcludeFilterTest.php +++ b/tests/Composer/Test/Package/Archiver/HgExcludeFilterTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Package\Archiver; use Composer\Package\Archiver\HgExcludeFilter; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class HgExcludeFilterTest extends TestCase { diff --git a/tests/Composer/Test/Package/BasePackageTest.php b/tests/Composer/Test/Package/BasePackageTest.php index 32a8cd844..33d384d69 100644 --- a/tests/Composer/Test/Package/BasePackageTest.php +++ b/tests/Composer/Test/Package/BasePackageTest.php @@ -13,10 +13,13 @@ namespace Composer\Test\Package; use Composer\Package\BasePackage; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class BasePackageTest extends TestCase { + /** + * @doesNotPerformAssertions + */ public function testSetSameRepository() { $package = $this->getMockForAbstractClass('Composer\Package\BasePackage', array('foo')); diff --git a/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php b/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php index bd1c29c13..81d94bdc1 100644 --- a/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php +++ b/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php @@ -15,7 +15,7 @@ namespace Composer\Test\Package\Dumper; use Composer\Package\Dumper\ArrayDumper; use Composer\Package\Link; use Composer\Semver\Constraint\Constraint; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class ArrayDumperTest extends TestCase { diff --git a/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php b/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php index ca1cec0db..5ccaa038a 100644 --- a/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php @@ -14,7 +14,7 @@ namespace Composer\Test\Package\Loader; use Composer\Package\Loader\ArrayLoader; use Composer\Package\Dumper\ArrayDumper; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class ArrayLoaderTest extends TestCase { @@ -83,7 +83,7 @@ class ArrayLoaderTest extends TestCase $this->assertEquals('1.2.3.4', $package->getVersion()); } - public function testParseDumpProvider() + public function parseDumpProvider() { $validConfig = array( 'name' => 'A/B', @@ -142,7 +142,7 @@ class ArrayLoaderTest extends TestCase * The default parser should default to loading the config as this * allows require-dev libraries to have transport options included. * - * @dataProvider testParseDumpProvider + * @dataProvider parseDumpProvider */ public function testParseDumpDefaultLoadConfig($config) { @@ -153,7 +153,7 @@ class ArrayLoaderTest extends TestCase } /** - * @dataProvider testParseDumpProvider + * @dataProvider parseDumpProvider */ public function testParseDumpTrueLoadConfig($config) { @@ -165,7 +165,7 @@ class ArrayLoaderTest extends TestCase } /** - * @dataProvider testParseDumpProvider + * @dataProvider parseDumpProvider */ public function testParseDumpFalseLoadConfig($config) { diff --git a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php index d0084e267..a94539279 100644 --- a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php @@ -17,7 +17,7 @@ use Composer\Package\Loader\RootPackageLoader; use Composer\Package\BasePackage; use Composer\Package\Version\VersionGuesser; use Composer\Semver\VersionParser; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; use Prophecy\Argument; class RootPackageLoaderTest extends TestCase diff --git a/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php b/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php index 2fc059f3c..69936f4bf 100644 --- a/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php @@ -14,7 +14,7 @@ namespace Composer\Test\Package\Loader; use Composer\Package\Loader\ValidatingArrayLoader; use Composer\Package\Loader\InvalidPackageException; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class ValidatingArrayLoaderTest extends TestCase { diff --git a/tests/Composer/Test/Package/LockerTest.php b/tests/Composer/Test/Package/LockerTest.php index bb8eaabde..05aa006f0 100644 --- a/tests/Composer/Test/Package/LockerTest.php +++ b/tests/Composer/Test/Package/LockerTest.php @@ -14,7 +14,7 @@ namespace Composer\Test\Package; use Composer\Package\Locker; use Composer\IO\NullIO; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class LockerTest extends TestCase { diff --git a/tests/Composer/Test/Package/Version/VersionGuesserTest.php b/tests/Composer/Test/Package/Version/VersionGuesserTest.php index 6eeafd122..31c47d72b 100644 --- a/tests/Composer/Test/Package/Version/VersionGuesserTest.php +++ b/tests/Composer/Test/Package/Version/VersionGuesserTest.php @@ -15,7 +15,7 @@ namespace Composer\Test\Package\Version; use Composer\Config; use Composer\Package\Version\VersionGuesser; use Composer\Semver\VersionParser; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class VersionGuesserTest extends TestCase { diff --git a/tests/Composer/Test/Package/Version/VersionParserTest.php b/tests/Composer/Test/Package/Version/VersionParserTest.php index 80dceb822..63177bdcd 100644 --- a/tests/Composer/Test/Package/Version/VersionParserTest.php +++ b/tests/Composer/Test/Package/Version/VersionParserTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Package\Version; use Composer\Package\Version\VersionParser; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class VersionParserTest extends TestCase { diff --git a/tests/Composer/Test/Package/Version/VersionSelectorTest.php b/tests/Composer/Test/Package/Version/VersionSelectorTest.php index 2617eecf2..66d07d267 100644 --- a/tests/Composer/Test/Package/Version/VersionSelectorTest.php +++ b/tests/Composer/Test/Package/Version/VersionSelectorTest.php @@ -16,7 +16,7 @@ use Composer\Package\Version\VersionSelector; use Composer\Package\Package; use Composer\Package\Link; use Composer\Semver\VersionParser; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class VersionSelectorTest extends TestCase { diff --git a/tests/Composer/Test/Plugin/PluginInstallerTest.php b/tests/Composer/Test/Plugin/PluginInstallerTest.php index bd83ce16f..c08991ca7 100644 --- a/tests/Composer/Test/Plugin/PluginInstallerTest.php +++ b/tests/Composer/Test/Plugin/PluginInstallerTest.php @@ -105,7 +105,7 @@ class PluginInstallerTest extends TestCase $this->autoloadGenerator = new AutoloadGenerator($dispatcher); $this->composer = new Composer(); - $config = new Config(); + $config = new Config(false); $this->composer->setConfig($config); $this->composer->setDownloadManager($dm); $this->composer->setRepositoryManager($rm); diff --git a/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php b/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php index 1f0dad72b..cdd8f3e1d 100644 --- a/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php +++ b/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Question; use Composer\Question\StrictConfirmationQuestion; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\ArrayInput; diff --git a/tests/Composer/Test/Repository/Pear/ChannelReaderTest.php b/tests/Composer/Test/Repository/Pear/ChannelReaderTest.php index 95e59e906..2e2fe6933 100644 --- a/tests/Composer/Test/Repository/Pear/ChannelReaderTest.php +++ b/tests/Composer/Test/Repository/Pear/ChannelReaderTest.php @@ -66,8 +66,10 @@ class ChannelReaderTest extends TestCase $reader = new \Composer\Repository\Pear\ChannelReader($httpDownloader); - $reader->read('http://pear.1.0.net/'); - $reader->read('http://pear.1.1.net/'); + $pear10 = $reader->read('http://pear.1.0.net/'); + $this->assertCount(2, $pear10->getPackages()); + $pear11 = $reader->read('http://pear.1.1.net/'); + $this->assertCount(3, $pear11->getPackages()); } public function testShouldCreatePackages() diff --git a/tests/Composer/Test/Repository/RepositoryManagerTest.php b/tests/Composer/Test/Repository/RepositoryManagerTest.php index 35afd91e2..dad0bd346 100644 --- a/tests/Composer/Test/Repository/RepositoryManagerTest.php +++ b/tests/Composer/Test/Repository/RepositoryManagerTest.php @@ -86,7 +86,7 @@ class RepositoryManagerTest extends TestCase $rm->setRepositoryClass('artifact', 'Composer\Repository\ArtifactRepository'); $rm->createRepository('composer', array('url' => 'http://example.org')); - $rm->createRepository($type, $options); + $this->assertInstanceOf('Composer\Repository\RepositoryInterface', $rm->createRepository($type, $options)); } public function creationCases() diff --git a/tests/Composer/Test/TestCase.php b/tests/Composer/Test/TestCase.php index 656a477e6..d43d3d911 100644 --- a/tests/Composer/Test/TestCase.php +++ b/tests/Composer/Test/TestCase.php @@ -105,4 +105,24 @@ abstract class TestCase extends BaseTestCase $this->markTestSkipped($executableName . ' is not found or not executable.'); } } + + /** + * @param string $exception + * @param string|null $message + * @param int|null $code + */ + public function setExpectedException($exception, $message = null, $code = null) + { + if (!class_exists('PHPUnit\Framework\Error\Notice')) { + $exception = str_replace('PHPUnit\\Framework\\Error\\', 'PHPUnit_Framework_Error_', $exception); + } + if (method_exists($this, 'expectException')) { + $this->expectException($exception); + if (null !== $message) { + $this->expectExceptionMessage($message); + } + } else { + parent::setExpectedException($exception, $message, $code); + } + } } diff --git a/tests/Composer/Test/Util/BitbucketTest.php b/tests/Composer/Test/Util/BitbucketTest.php index f50bdd818..5837d1996 100644 --- a/tests/Composer/Test/Util/BitbucketTest.php +++ b/tests/Composer/Test/Util/BitbucketTest.php @@ -14,7 +14,7 @@ namespace Composer\Test\Util; use Composer\Util\Bitbucket; use Composer\Util\Http\Response; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * @author Paul Wenke diff --git a/tests/Composer/Test/Util/ErrorHandlerTest.php b/tests/Composer/Test/Util/ErrorHandlerTest.php index 52de96af4..89cc8b4dc 100644 --- a/tests/Composer/Test/Util/ErrorHandlerTest.php +++ b/tests/Composer/Test/Util/ErrorHandlerTest.php @@ -20,6 +20,16 @@ use Composer\Test\TestCase; */ class ErrorHandlerTest extends TestCase { + public function setUp() + { + ErrorHandler::register(); + } + + public function tearDown() + { + restore_error_handler(); + } + /** * Test ErrorHandler handles notices */ @@ -27,8 +37,6 @@ class ErrorHandlerTest extends TestCase { $this->setExpectedException('\ErrorException', 'Undefined index: baz'); - ErrorHandler::register(); - $array = array('foo' => 'bar'); $array['baz']; } @@ -40,18 +48,15 @@ class ErrorHandlerTest extends TestCase { $this->setExpectedException('\ErrorException', 'array_merge'); - ErrorHandler::register(); - array_merge(array(), 'string'); } /** * Test ErrorHandler handles warnings + * @doesNotPerformAssertions */ public function testErrorHandlerRespectsAtOperator() { - ErrorHandler::register(); - @trigger_error('test', E_USER_NOTICE); } } diff --git a/tests/Composer/Test/Util/GitHubTest.php b/tests/Composer/Test/Util/GitHubTest.php index 4e21d5f77..37683395f 100644 --- a/tests/Composer/Test/Util/GitHubTest.php +++ b/tests/Composer/Test/Util/GitHubTest.php @@ -15,7 +15,7 @@ namespace Composer\Test\Util; use Composer\Downloader\TransportException; use Composer\Util\GitHub; use Composer\Util\Http\Response; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; use RecursiveArrayIterator; use RecursiveIteratorIterator; diff --git a/tests/Composer/Test/Util/GitLabTest.php b/tests/Composer/Test/Util/GitLabTest.php index 6037e7a0b..c9ac9dbf6 100644 --- a/tests/Composer/Test/Util/GitLabTest.php +++ b/tests/Composer/Test/Util/GitLabTest.php @@ -15,7 +15,7 @@ namespace Composer\Test\Util; use Composer\Downloader\TransportException; use Composer\Util\GitLab; use Composer\Util\Http\Response; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * @author Jérôme Tamarelle diff --git a/tests/Composer/Test/Util/GitTest.php b/tests/Composer/Test/Util/GitTest.php index 7aa66be12..d534573d6 100644 --- a/tests/Composer/Test/Util/GitTest.php +++ b/tests/Composer/Test/Util/GitTest.php @@ -7,7 +7,7 @@ use Composer\IO\IOInterface; use Composer\Util\Filesystem; use Composer\Util\Git; use Composer\Util\ProcessExecutor; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class GitTest extends TestCase { @@ -102,6 +102,7 @@ class GitTest extends TestCase $this->mockConfig($protocol); $this->process + ->expects($this->atLeast(2)) ->method('execute') ->willReturnMap(array( array('git command failing', null, null, 1), @@ -113,11 +114,13 @@ class GitTest extends TestCase ->willReturn(false); $this->io + ->expects($this->atLeastOnce()) ->method('hasAuthentication') ->with($this->equalTo('github.com')) ->willReturn(true); $this->io + ->expects($this->atLeastOnce()) ->method('getAuthentication') ->with($this->equalTo('github.com')) ->willReturn(array('username' => 'token', 'password' => $gitHubToken)); diff --git a/tests/Composer/Test/Util/IniHelperTest.php b/tests/Composer/Test/Util/IniHelperTest.php index aead5fea9..a77c117ea 100644 --- a/tests/Composer/Test/Util/IniHelperTest.php +++ b/tests/Composer/Test/Util/IniHelperTest.php @@ -14,7 +14,7 @@ namespace Composer\Test\Util; use Composer\Util\IniHelper; use Composer\XdebugHandler\XdebugHandler; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * @author John Stevenson diff --git a/tests/Composer/Test/Util/NoProxyPatternTest.php b/tests/Composer/Test/Util/NoProxyPatternTest.php index a3c01546c..5295dc6b0 100644 --- a/tests/Composer/Test/Util/NoProxyPatternTest.php +++ b/tests/Composer/Test/Util/NoProxyPatternTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\NoProxyPattern; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class NoProxyPatternTest extends TestCase { diff --git a/tests/Composer/Test/Util/PerforceTest.php b/tests/Composer/Test/Util/PerforceTest.php index 777dbb3aa..2c862270e 100644 --- a/tests/Composer/Test/Util/PerforceTest.php +++ b/tests/Composer/Test/Util/PerforceTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\Perforce; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; use Composer\Util\ProcessExecutor; /** diff --git a/tests/Composer/Test/Util/PlatformTest.php b/tests/Composer/Test/Util/PlatformTest.php index c9ae8e97f..70777d69a 100644 --- a/tests/Composer/Test/Util/PlatformTest.php +++ b/tests/Composer/Test/Util/PlatformTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\Platform; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * PlatformTest diff --git a/tests/Composer/Test/Util/ProcessExecutorTest.php b/tests/Composer/Test/Util/ProcessExecutorTest.php index 42fea21f6..87c2d07cc 100644 --- a/tests/Composer/Test/Util/ProcessExecutorTest.php +++ b/tests/Composer/Test/Util/ProcessExecutorTest.php @@ -110,7 +110,7 @@ class ProcessExecutorTest extends TestCase $output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true); $process = new ProcessExecutor(new ConsoleIO(new ArrayInput(array()), $output, new HelperSet(array()))); - $process->execute('echo \'foo\''); + $process->execute('php -r "echo \'foo\'.PHP_EOL;"'); $this->assertSame('foo'.PHP_EOL, $output->fetch()); } } diff --git a/tests/Composer/Test/Util/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index 2c7f3112a..fe4f213c6 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\RemoteFilesystem; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class RemoteFilesystemTest extends TestCase { @@ -78,6 +78,12 @@ class RemoteFilesystemTest extends TestCase ->will($this->returnValue(true)) ; + $io + ->expects($this->once()) + ->method('getAuthentication') + ->will($this->returnValue(array('username' => null, 'password' => null))) + ; + $streamOptions = array('ssl' => array( 'allow_self_signed' => true, )); @@ -95,6 +101,12 @@ class RemoteFilesystemTest extends TestCase ->will($this->returnValue(true)) ; + $io + ->expects($this->once()) + ->method('getAuthentication') + ->will($this->returnValue(array('username' => null, 'password' => null))) + ; + $streamOptions = array('http' => array( 'header' => 'Foo: bar', )); diff --git a/tests/Composer/Test/Util/SilencerTest.php b/tests/Composer/Test/Util/SilencerTest.php index af1d5918f..6e93c3c22 100644 --- a/tests/Composer/Test/Util/SilencerTest.php +++ b/tests/Composer/Test/Util/SilencerTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\Silencer; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * SilencerTest diff --git a/tests/Composer/Test/Util/StreamContextFactoryTest.php b/tests/Composer/Test/Util/StreamContextFactoryTest.php index 3d60a9a38..bd4935cf2 100644 --- a/tests/Composer/Test/Util/StreamContextFactoryTest.php +++ b/tests/Composer/Test/Util/StreamContextFactoryTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\StreamContextFactory; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class StreamContextFactoryTest extends TestCase { diff --git a/tests/Composer/Test/Util/SvnTest.php b/tests/Composer/Test/Util/SvnTest.php index 80f620f28..03a183583 100644 --- a/tests/Composer/Test/Util/SvnTest.php +++ b/tests/Composer/Test/Util/SvnTest.php @@ -16,7 +16,7 @@ use Composer\Config; use Composer\IO\NullIO; use Composer\Util\Platform; use Composer\Util\Svn; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class SvnTest extends TestCase { diff --git a/tests/Composer/Test/Util/TlsHelperTest.php b/tests/Composer/Test/Util/TlsHelperTest.php index 8733b1d76..df0cdd3bf 100644 --- a/tests/Composer/Test/Util/TlsHelperTest.php +++ b/tests/Composer/Test/Util/TlsHelperTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\TlsHelper; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; class TlsHelperTest extends TestCase { diff --git a/tests/Composer/Test/Util/UrlTest.php b/tests/Composer/Test/Util/UrlTest.php index 322bc0241..8eb33f851 100644 --- a/tests/Composer/Test/Util/UrlTest.php +++ b/tests/Composer/Test/Util/UrlTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\Url; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; use Composer\Config; class UrlTest extends TestCase diff --git a/tests/Composer/Test/Util/ZipTest.php b/tests/Composer/Test/Util/ZipTest.php index c47373274..19dc54fa1 100644 --- a/tests/Composer/Test/Util/ZipTest.php +++ b/tests/Composer/Test/Util/ZipTest.php @@ -13,7 +13,7 @@ namespace Composer\Test\Util; use Composer\Util\Zip; -use PHPUnit\Framework\TestCase; +use Composer\Test\TestCase; /** * @author Andreas Schempp