From 1bd47069600f0b900f8821ff487aa5ea67d2d21f Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Mon, 22 Mar 2021 15:29:40 -0500 Subject: [PATCH] feat: update to allow usage with PHP 8 - Adds `~8.0.0` to PHP constraint - Makes minimum supported PHP version 7.3 - Updates PHPUnit version to 9.3, php-mock-phpunit to 2.0, and vfsStream to 1.6.7 - Updates phpunit.xml.dist to 9.3 schema - Updates unit tests to work with PHPUnit 9.3 - Removes all prophecy usage in favor of phpunit mock objects Signed-off-by: Matthew Weier O'Phinney --- .gitignore | 1 + composer.json | 10 +- composer.lock | 866 ++++++++++++++++++++------- phpunit.xml.dist | 22 +- test/Command/AbstractCommandTest.php | 54 +- test/Command/DisableTest.php | 47 +- test/Command/EnableTest.php | 110 ++-- test/CommandTest.php | 262 ++++---- test/HelpTest.php | 35 +- test/ProjectSetupTrait.php | 26 +- 10 files changed, 909 insertions(+), 524 deletions(-) diff --git a/.gitignore b/.gitignore index d822fd3..0e03123 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.phpunit.result.cache /clover.xml /coveralls-upload.json /phpunit.xml diff --git a/composer.json b/composer.json index a7c0605..85408d3 100644 --- a/composer.json +++ b/composer.json @@ -22,16 +22,16 @@ "extra": { }, "require": { - "php": "^5.6 || ^7.0", + "php": "^7.3 || ~8.0.0", "laminas/laminas-stdlib": "^3.1", "laminas/laminas-zendframework-bridge": "^1.0" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "mikey179/vfsstream": "^1.6.4", - "mockery/mockery": "^1.0", - "php-mock/php-mock-phpunit": "^1.1.2 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.5" + "mikey179/vfsstream": "^1.6.7", + "mockery/mockery": "^1.4.1", + "php-mock/php-mock-phpunit": "^2.0", + "phpunit/phpunit": "^9.3" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 3938a4c..2349d90 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": "6b46c74aba2e226a0b05ad7cdf5a90d6", + "content-hash": "bc7ddddd83450c009d9e52b00dd4b55e", "packages": [ { "name": "laminas/laminas-stdlib", @@ -343,30 +343,33 @@ }, { "name": "mockery/mockery", - "version": "1.3.4", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "31467aeb3ca3188158613322d66df81cedd86626" + "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/31467aeb3ca3188158613322d66df81cedd86626", - "reference": "31467aeb3ca3188158613322d66df81cedd86626", + "url": "https://api.github.com/repos/mockery/mockery/zipball/d1339f64479af1bee0e82a0413813fe5345a54ea", + "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": ">=5.6.0" + "php": "^7.3 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3" + "phpunit/phpunit": "^8.5 || ^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -406,9 +409,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.3.4" + "source": "https://github.com/mockery/mockery/tree/1.4.3" }, - "time": "2021-02-24T09:51:00+00:00" + "time": "2021-02-24T09:51:49+00:00" }, { "name": "myclabs/deep-copy", @@ -468,30 +471,87 @@ ], "time": "2020-11-13T09:40:50+00:00" }, + { + "name": "nikic/php-parser", + "version": "v4.10.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4" + }, + "time": "2020-12-20T10:01:03+00:00" + }, { "name": "phar-io/manifest", - "version": "1.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -525,24 +585,24 @@ "issues": "https://github.com/phar-io/manifest/issues", "source": "https://github.com/phar-io/manifest/tree/master" }, - "time": "2018-07-08T19:23:20+00:00" + "time": "2020-06-27T14:33:11+00:00" }, { "name": "phar-io/version", - "version": "2.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -574,9 +634,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/master" + "source": "https://github.com/phar-io/version/tree/3.1.0" }, - "time": "2018-07-08T19:19:57+00:00" + "time": "2021-02-23T14:00:09+00:00" }, { "name": "php-mock/php-mock", @@ -995,40 +1055,44 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "version": "9.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "nikic/php-parser": "^4.10.2", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-pcov": "*", + "ext-xdebug": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -1056,34 +1120,40 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5" }, - "time": "2018-10-31T16:06:48+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:44:49+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4b49fb70f067272b659ef0174ff9ca40fdaa6357", - "reference": "4b49fb70f067272b659ef0174ff9ca40fdaa6357", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1110,7 +1180,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" }, "funding": [ { @@ -1118,26 +1188,38 @@ "type": "github" } ], - "time": "2020-11-30T08:25:21+00:00" + "time": "2020-09-28T05:57:25+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1154,41 +1236,47 @@ "role": "lead" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "template" + "process" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, - "time": "2015-06-21T13:50:34+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpunit/php-timer", - "version": "2.1.3", + "name": "phpunit/php-text-template", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1207,14 +1295,14 @@ "role": "lead" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "timer" + "template" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, "funding": [ { @@ -1222,33 +1310,32 @@ "type": "github" } ], - "time": "2020-11-30T08:20:02+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "3.1.2", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/472b687829041c24b25f475e14c2f38a09edf1c2", - "reference": "472b687829041c24b25f475e14c2f38a09edf1c2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1263,17 +1350,18 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "tokenizer" + "timer" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.2" + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, "funding": [ { @@ -1281,58 +1369,59 @@ "type": "github" } ], - "abandoned": true, - "time": "2020-11-30T08:38:46+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/phpunit", - "version": "7.5.20", + "version": "9.5.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" + "reference": "27241ac75fc37ecf862b6e002bf713b6566cbe41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/27241ac75fc37ecf862b6e002bf713b6566cbe41", + "reference": "27241ac75fc37ecf862b6e002bf713b6566cbe41", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", + "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3", + "sebastian/version": "^3.0.2" }, "require-dev": { - "ext-pdo": "*" + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "ext-xdebug": "*" }, "bin": [ "phpunit" @@ -1340,12 +1429,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "9.5-dev" } }, "autoload": { "classmap": [ "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1368,34 +1460,156 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/7.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.3" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-03-17T07:30:34+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, - "time": "2020-01-08T08:45:45+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1417,7 +1631,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, "funding": [ { @@ -1425,34 +1639,34 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.3", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", "shasum": "" }, "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1491,7 +1705,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" }, "funding": [ { @@ -1499,33 +1713,90 @@ "type": "github" } ], - "time": "2020-11-30T08:04:30+00:00" + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" }, { "name": "sebastian/diff", - "version": "3.0.3", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1557,7 +1828,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" }, "funding": [ { @@ -1565,27 +1836,27 @@ "type": "github" } ], - "time": "2020-11-30T07:59:04+00:00" + "time": "2020-10-26T13:10:38+00:00" }, { "name": "sebastian/environment", - "version": "4.2.4", + "version": "5.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-posix": "*" @@ -1593,7 +1864,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1620,7 +1891,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" }, "funding": [ { @@ -1628,34 +1899,34 @@ "type": "github" } ], - "time": "2020-11-30T07:53:42+00:00" + "time": "2020-09-28T05:52:38+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.3", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e" + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1697,7 +1968,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" }, "funding": [ { @@ -1705,27 +1976,30 @@ "type": "github" } ], - "time": "2020-11-30T07:47:53+00:00" + "time": "2020-09-28T05:24:23+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -1733,7 +2007,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1758,36 +2032,99 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2" }, - "time": "2017-04-27T15:39:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:55:19+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.4", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1809,7 +2146,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { @@ -1817,32 +2154,32 @@ "type": "github" } ], - "time": "2020-11-30T07:40:27+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1864,7 +2201,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { @@ -1872,32 +2209,32 @@ "type": "github" } ], - "time": "2020-11-30T07:37:18+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.1", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1927,7 +2264,7 @@ "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" }, "funding": [ { @@ -1935,29 +2272,32 @@ "type": "github" } ], - "time": "2020-11-30T07:34:24+00:00" + "time": "2020-10-26T13:17:30+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1979,7 +2319,63 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.1" }, "funding": [ { @@ -1987,29 +2383,29 @@ "type": "github" } ], - "time": "2020-11-30T07:30:19+00:00" + "time": "2020-10-26T13:18:59+00:00" }, { "name": "sebastian/version", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2032,9 +2428,15 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "time": "2016-10-03T07:35:21+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2313,7 +2715,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "platform-dev": [], "plugin-api-version": "2.0.0" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1eef9d0..ef2b811 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,17 @@ - - + + + + src + + + ./test - - - - src - - diff --git a/test/Command/AbstractCommandTest.php b/test/Command/AbstractCommandTest.php index 4a0fb61..62887bd 100644 --- a/test/Command/AbstractCommandTest.php +++ b/test/Command/AbstractCommandTest.php @@ -13,8 +13,8 @@ use LaminasTest\ComposerAutoloading\ProjectSetupTrait; use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStreamDirectory; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use PHPUnit_Framework_MockObject_MockObject; class AbstractCommandTest extends TestCase { @@ -26,10 +26,13 @@ class AbstractCommandTest extends TestCase /** @var vfsStreamDirectory */ private $modulesDir; - /** @var Command\AbstractCommand|PHPUnit_Framework_MockObject_MockObject */ + /** + * @var Command\AbstractCommand|MockObject + * @psalm-var Command\AbstractCommand&MockObject + */ private $command; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -44,7 +47,10 @@ protected function setUp() ->getMockForAbstractClass(); } - public function type() + /** + * @psalm-return array + */ + public function type(): array { return [ 'psr-0' => ['psr-0'], @@ -54,10 +60,8 @@ public function type() /** * @dataProvider type - * - * @param string $type */ - public function testThrowsExceptionWhenComposerJsonDoesNotExist($type) + public function testThrowsExceptionWhenComposerJsonDoesNotExist(string $type) { $this->command->expects($this->never())->method('execute'); $this->setUpModule($this->modulesDir, 'App', $type); @@ -69,10 +73,8 @@ public function testThrowsExceptionWhenComposerJsonDoesNotExist($type) /** * @dataProvider type - * - * @param string $type */ - public function testThrowsExceptionWhenComposerJsonIsNotWritable($type) + public function testThrowsExceptionWhenComposerJsonIsNotWritable(string $type) { $this->command->expects($this->never())->method('execute'); $this->setUpModule($this->modulesDir, 'App', $type); @@ -85,10 +87,8 @@ public function testThrowsExceptionWhenComposerJsonIsNotWritable($type) /** * @dataProvider type - * - * @param string $type */ - public function testThrowsExceptionWhenComposerJsonHasInvalidContent($type) + public function testThrowsExceptionWhenComposerJsonHasInvalidContent(string $type) { $this->command->expects($this->never())->method('execute'); $this->setUpModule($this->modulesDir, 'App', $type); @@ -103,10 +103,8 @@ public function testThrowsExceptionWhenComposerJsonHasInvalidContent($type) /** * @dataProvider type - * - * @param string $type */ - public function testThrowsExceptionWhenComposerJsonHasNoContent($type) + public function testThrowsExceptionWhenComposerJsonHasNoContent(string $type) { $this->command->expects($this->never())->method('execute'); $this->setUpModule($this->modulesDir, 'App', $type); @@ -130,11 +128,10 @@ public function testThrowsExceptionWhenCannotDetermineModuleType() /** * @dataProvider type - * - * @param string $type */ - public function testComposerJsonContentIsNotChangedAndDumpAutoloadIsNotCalledWhenExecuteMethodReturnsFalse($type) - { + public function testComposerJsonContentIsNotChangedAndDumpAutoloadIsNotCalledWhenExecuteMethodReturnsFalse( + string $type + ) { $this->command->expects($this->once())->method('execute')->willReturn(false); $this->setUpModule($this->modulesDir, 'App', $type); $composerJson = $this->setUpComposerJson($this->dir, ['foo' => 'bar']); @@ -146,17 +143,16 @@ public function testComposerJsonContentIsNotChangedAndDumpAutoloadIsNotCalledWhe /** * @dataProvider type - * - * @param string $type */ - public function testComposerJsonContentIsUpdatedAndDumpAutoloadIsCalledWhenExecuteMethodReturnsNewContent($type) - { + public function testComposerJsonContentIsUpdatedAndDumpAutoloadIsCalledWhenExecuteMethodReturnsNewContent( + string $type + ) { $expectedComposerJson = <<< 'EOC' -{ - "new": "content" -} - -EOC; + { + "new": "content" + } + + EOC; $this->command->expects($this->once())->method('execute')->willReturn(['new' => 'content']); $this->setUpModule($this->modulesDir, 'App', $type); diff --git a/test/Command/DisableTest.php b/test/Command/DisableTest.php index b600fca..ac2c6fa 100644 --- a/test/Command/DisableTest.php +++ b/test/Command/DisableTest.php @@ -27,7 +27,7 @@ class DisableTest extends TestCase /** @var Command\Disable */ private $command; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -36,7 +36,10 @@ protected function setUp() $this->command = new Command\Disable($this->dir->url(), 'my-modules', $this->composer); } - public function type() + /** + * @psalm-return array + */ + public function type(): array { return [ 'psr-0' => ['psr-0'], @@ -46,10 +49,8 @@ public function type() /** * @dataProvider type - * - * @param string $type */ - public function testReturnsFalseWithoutChangesBecauseComposerAutoloadingAlreadyDisabled($type) + public function testReturnsFalseWithoutChangesBecauseComposerAutoloadingAlreadyDisabled(string $type) { $this->setUpModule($this->modulesDir, 'App', $type); $composerJson = $this->setUpComposerJson( @@ -66,21 +67,19 @@ public function testReturnsFalseWithoutChangesBecauseComposerAutoloadingAlreadyD /** * @dataProvider type - * - * @param string $type */ - public function testRemovesEntryFromComposerJsonAndComposerDumpAutoloadCalled($type) + public function testRemovesEntryFromComposerJsonAndComposerDumpAutoloadCalled(string $type) { $expectedComposerJson = <<< 'EOC' -{ - "autoload": { - "%s": { - "Other\\": "path/to/other" - } - } -} - -EOC; + { + "autoload": { + "%s": { + "Other\\": "path/to/other" + } + } + } + + EOC; $this->setUpModule($this->modulesDir, 'App', $type); $composerJson = $this->setUpComposerJson( @@ -100,17 +99,15 @@ public function testRemovesEntryFromComposerJsonAndComposerDumpAutoloadCalled($t /** * @dataProvider type - * - * @param string $type */ - public function testAddsCorrectEntryToComposerJsonAndComposerDumpAutoloadCalledAutodiscoveryModuleType($type) + public function testAddsCorrectEntryToComposerJsonAndComposerDumpAutoloadCalledAutodiscoveryModuleType(string $type) { $expectedComposerJson = <<< 'EOC' -{ - "foo": "bar" -} - -EOC; + { + "foo": "bar" + } + + EOC; $this->setUpModule($this->modulesDir, 'MyApp', $type); $composerJson = $this->setUpComposerJson( diff --git a/test/Command/EnableTest.php b/test/Command/EnableTest.php index aa85804..b10e5a4 100644 --- a/test/Command/EnableTest.php +++ b/test/Command/EnableTest.php @@ -27,7 +27,7 @@ class EnableTest extends TestCase /** @var Command\Enable */ private $command; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -36,7 +36,10 @@ protected function setUp() $this->command = new Command\Enable($this->dir->url(), 'my-modules', $this->composer); } - public function type() + /** + * @psalm-return array + */ + public function type(): array { return [ 'psr-0' => ['psr-0'], @@ -46,10 +49,8 @@ public function type() /** * @dataProvider type - * - * @param string $type */ - public function testReturnsFalseWithoutChangesBecauseComposerAutoloadingAlreadyEnabled($type) + public function testReturnsFalseWithoutChangesBecauseComposerAutoloadingAlreadyEnabled(string $type) { $this->setUpModule($this->modulesDir, 'App', $type); $composerJson = $this->setUpComposerJson( @@ -66,22 +67,20 @@ public function testReturnsFalseWithoutChangesBecauseComposerAutoloadingAlreadyE /** * @dataProvider type - * - * @param string $type */ - public function testAddsEntryToComposerJsonAndComposerDumpAutoloadCalled($type) + public function testAddsEntryToComposerJsonAndComposerDumpAutoloadCalled(string $type) { $expectedComposerJson = <<< 'EOC' -{ - "autoload": { - "%s": { - "Other\\": "path/to/other", - "App\\": "my-modules/App/src/" - } - } -} - -EOC; + { + "autoload": { + "%s": { + "Other\\": "path/to/other", + "App\\": "my-modules/App/src/" + } + } + } + + EOC; $this->setUpModule($this->modulesDir, 'App', $type); $composerJson = $this->setUpComposerJson( @@ -103,21 +102,19 @@ public function testAddsEntryToComposerJsonAndComposerDumpAutoloadCalled($type) /** * @dataProvider type - * - * @param string $type */ - public function testAddsCorrectEntryToComposerJsonAndComposerDumpAutoloadCalledAutodiscoveryModuleType($type) + public function testAddsCorrectEntryToComposerJsonAndComposerDumpAutoloadCalledAutodiscoveryModuleType(string $type) { $expectedComposerJson = <<< 'EOC' -{ - "autoload": { - "%s": { - "MyApp\\": "my-modules/MyApp/src/" - } - } -} - -EOC; + { + "autoload": { + "%s": { + "MyApp\\": "my-modules/MyApp/src/" + } + } + } + + EOC; $this->setUpModule($this->modulesDir, 'MyApp', $type); $composerJson = $this->setUpComposerJson($this->dir, []); @@ -135,10 +132,8 @@ public function testAddsCorrectEntryToComposerJsonAndComposerDumpAutoloadCalledA /** * @dataProvider type - * - * @param string $type */ - public function testModuleClassFileDoesNotContainModuleClassSoItIsNotMoved($type) + public function testModuleClassFileDoesNotContainModuleClassSoItIsNotMoved(string $type) { $this->setUpModule($this->modulesDir, 'FooApp', $type); $this->setUpComposerJson($this->dir, []); @@ -149,7 +144,14 @@ public function testModuleClassFileDoesNotContainModuleClassSoItIsNotMoved($type $this->assertNull($this->command->getMovedModuleClass()); } - public function moveModuleClassFile() + /** + * @psalm-return array + * }> + */ + public function moveModuleClassFile(): array { return [ 'psr-0-move' => ['psr-0', true, ['%s/%s/Module.php' => '%s/%s/src/Module.php']], @@ -161,11 +163,8 @@ public function moveModuleClassFile() /** * @dataProvider moveModuleClassFile - * - * @param string $type - * @param bool $move */ - public function testModuleClassFileExistsInBothLocationSoItIsNotMoved($type, $move) + public function testModuleClassFileExistsInBothLocationSoItIsNotMoved(string $type, bool $move) { $this->setUpModule($this->modulesDir, 'BarApp', $type); $this->setUpComposerJson($this->dir, []); @@ -187,27 +186,24 @@ public function testModuleClassFileExistsInBothLocationSoItIsNotMoved($type, $mo /** * @dataProvider moveModuleClassFile - * - * @param string $type - * @param bool $move - * @param null|array $expected + * @psalm-param null|array $expected */ - public function testMovesModuleClassFile($type, $move, $expected) + public function testMovesModuleClassFile(string $type, bool $move, ?array $expected) { $expectedModuleFileContent = <<< 'EOM' -setUpModule($this->modulesDir, 'FooApp', $type); $this->setUpComposerJson($this->dir, []); @@ -223,7 +219,7 @@ public function getConfigDir() $from = sprintf(key($expected), $this->modulesDir->url(), 'FooApp'); $to = sprintf(reset($expected), $this->modulesDir->url(), 'FooApp'); $this->assertEquals([$from => $to], $this->command->getMovedModuleClass()); - $this->assertFileNotExists($moduleFile->url()); + $this->assertFileDoesNotExist($moduleFile->url()); $newModuleFile = vfsStream::url('project/my-modules/FooApp/src/Module.php'); $this->assertFileExists($newModuleFile); $this->assertEquals( diff --git a/test/CommandTest.php b/test/CommandTest.php index d4f24c2..d4634fe 100644 --- a/test/CommandTest.php +++ b/test/CommandTest.php @@ -15,10 +15,10 @@ use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; use org\bovigo\vfs\vfsStream; use org\bovigo\vfs\vfsStreamDirectory; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use Prophecy\Argument; -use Prophecy\Prophecy\ObjectProphecy; use ReflectionObject; +use ReflectionProperty; class CommandTest extends TestCase { @@ -30,25 +30,43 @@ class CommandTest extends TestCase /** @var vfsStreamDirectory */ private $dir; - /** @var ConsoleHelper|ObjectProphecy */ + /** + * @var ConsoleHelper|MockObject + * @psalm-var ConsoleHelper&MockObject + */ private $console; /** @var Command */ private $command; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->dir = vfsStream::setup('project'); - $this->console = $this->prophesize(ConsoleHelper::class); + $this->console = $this->createMock(ConsoleHelper::class); - $this->command = new Command(self::TEST_COMMAND_NAME, $this->console->reveal()); + $this->command = new Command(self::TEST_COMMAND_NAME, $this->console); $this->setProjectDir($this->command, $this->dir->url()); } - public function helpRequest() + /** @param mixed $expected */ + protected function assertAttributeSame( + $expected, + string $property, + object $instance, + string $message = '' + ): void { + $r = new ReflectionProperty($instance, $property); + $r->setAccessible(true); + self::assertSame($expected, $r->getValue($instance), $message); + } + + /** + * @psalm-return array> + */ + public function helpRequest(): array { return [ 'no-args' => [[]], @@ -73,7 +91,16 @@ public function testHelpRequestsEmitHelpToStdout(array $args) $this->assertEquals(0, $this->command->process($args)); } - public function argument() + /** + * @psalm-return array + */ + public function argument(): array { return [ // $action, $argument, $value, $propertyName, $expectedValue @@ -98,15 +125,14 @@ public function argument() /** * @dataProvider argument - * - * @param string $action - * @param string $argument - * @param string $value - * @param string $propertyName - * @param string $expectedValue */ - public function testArgumentIsSetAndHasExpectedValue($action, $argument, $value, $propertyName, $expectedValue) - { + public function testArgumentIsSetAndHasExpectedValue( + string $action, + string $argument, + string $value, + string $propertyName, + string $expectedValue + ) { $this->command->process([$action, $argument, $value, 'module-name']); $this->assertAttributeSame($expectedValue, $propertyName, $this->command); @@ -122,14 +148,16 @@ public function testDefaultArgumentsValues() public function testUnknownCommandEmitsHelpToStderrWithErrorMessage() { $this->console - ->writeErrorMessage(Argument::containingString('Unknown command')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Unknown command')); $this->assertHelpOutput(STDERR); $this->assertEquals(1, $this->command->process(['foo', 'bar'])); } - public function action() + /** @psalm-return array */ + public function action(): array { return [ 'disable' => ['disable'], @@ -139,14 +167,13 @@ public function action() /** * @dataProvider action - * - * @param string $action */ - public function testCommandErrorIfNoModuleNameProvided($action) + public function testCommandErrorIfNoModuleNameProvided(string $action) { $this->console - ->writeErrorMessage(Argument::containingString('Invalid module name')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Invalid module name')); $this->assertHelpOutput(STDERR); $this->assertEquals(1, $this->command->process([$action])); @@ -154,14 +181,13 @@ public function testCommandErrorIfNoModuleNameProvided($action) /** * @dataProvider action - * - * @param string $action */ - public function testCommandErrorIfInvalidNumberOfArgumentsProvided($action) + public function testCommandErrorIfInvalidNumberOfArgumentsProvided(string $action) { $this->console - ->writeErrorMessage(Argument::containingString('Invalid arguments')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Invalid arguments')); $this->assertHelpOutput(STDERR); $this->assertEquals(1, $this->command->process([$action, 'invalid', 'module-name'])); @@ -169,14 +195,13 @@ public function testCommandErrorIfInvalidNumberOfArgumentsProvided($action) /** * @dataProvider action - * - * @param string $action */ - public function testCommandErrorIfUnknownArgumentProvided($action) + public function testCommandErrorIfUnknownArgumentProvided(string $action) { $this->console - ->writeErrorMessage(Argument::containingString('Unknown argument "--invalid" provided')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Unknown argument "--invalid" provided')); $this->assertHelpOutput(STDERR); $this->assertEquals(1, $this->command->process([$action, '--invalid', 'value', 'module-name'])); @@ -187,14 +212,13 @@ public function testCommandErrorIfUnknownArgumentProvided($action) * @preserveGlobalState disabled * * @dataProvider action - * - * @param string $action */ - public function testCommandErrorIfModulesDirectoryDoesNotExist($action) + public function testCommandErrorIfModulesDirectoryDoesNotExist(string $action) { $this->console - ->writeErrorMessage(Argument::containingString('Unable to determine modules directory')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Unable to determine modules directory')); $this->assertHelpOutput(STDERR); $this->assertComposerBinaryExecutable(); @@ -206,16 +230,15 @@ public function testCommandErrorIfModulesDirectoryDoesNotExist($action) * @preserveGlobalState disabled * * @dataProvider action - * - * @param string $action */ - public function testCommandErrorIfModuleDoesNotExist($action) + public function testCommandErrorIfModuleDoesNotExist(string $action) { vfsStream::newDirectory('module')->at($this->dir); $this->console - ->writeErrorMessage(Argument::containingString('Could not locate module "module-name"')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Could not locate module "module-name"')); $this->assertHelpOutput(STDERR); $this->assertComposerBinaryExecutable(); @@ -227,25 +250,25 @@ public function testCommandErrorIfModuleDoesNotExist($action) * @preserveGlobalState disabled * * @dataProvider action - * - * @param string $action */ - public function testCommandErrorIfComposerIsNotExecutable($action) + public function testCommandErrorIfComposerIsNotExecutable(string $action) { $modulesDir = vfsStream::newDirectory('module')->at($this->dir); $this->setUpModule($modulesDir, 'module-name', 'psr4'); $this->setUpComposerJson($this->dir, []); $this->console - ->writeErrorMessage(Argument::containingString('Unable to determine composer binary')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Unable to determine composer binary')); $this->assertHelpOutput(STDERR); $this->assertComposerBinaryNotExecutable(); $this->assertEquals(1, $this->command->process([$action, 'module-name'])); } - public function invalidType() + /** @psalm-return array */ + public function invalidType(): array { return [ 'enable-invalid-psr-0' => ['enable', 'psr-0'], @@ -257,26 +280,25 @@ public function invalidType() /** * @dataProvider invalidType - * - * @param string $action - * @param string $type */ - public function testCommandErrorIfInvalidTypeProvided($action, $type) + public function testCommandErrorIfInvalidTypeProvided(string $action, string $type) { $modulesDir = vfsStream::newDirectory('module')->at($this->dir); $this->setUpModule($modulesDir, 'module-name', 'psr4'); $this->setUpComposerJson($this->dir, []); $this->console - ->writeErrorMessage(Argument::containingString('Invalid type provided; must be one of psr0 or psr4')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Invalid type provided; must be one of psr0 or psr4')); $this->assertHelpOutput(STDERR); $result = $this->command->process([$action, '--type', $type, 'module-name']); $this->assertEquals(1, $result); } - public function type() + /** @psalm-return array */ + public function type(): array { return [ 'psr-0' => ['psr0'], @@ -288,10 +310,8 @@ public function type() * @runInSeparateProcess * * @dataProvider type - * - * @param string $type */ - public function testErrorMessageWhenActionProcessThrowsException($type) + public function testErrorMessageWhenActionProcessThrowsException(string $type) { Mockery::mock('overload:' . MyTestingCommand::class) ->shouldReceive('process') @@ -303,8 +323,9 @@ public function testErrorMessageWhenActionProcessThrowsException($type) $this->setUpModule($modulesDir, 'App', $type); $this->console - ->writeErrorMessage(Argument::containingString('Testing Exception Message')) - ->shouldBeCalled(); + ->expects($this->atLeastOnce()) + ->method('writeErrorMessage') + ->with($this->stringContains('Testing Exception Message')); $this->assertNotHelpOutput(STDERR); $this->assertComposerBinaryExecutable(); @@ -317,10 +338,8 @@ public function testErrorMessageWhenActionProcessThrowsException($type) * @preserveGlobalState disabled * * @dataProvider type - * - * @param string $type */ - public function testMessageOnEnableWhenModuleIsAlreadyEnabled($type) + public function testMessageOnEnableWhenModuleIsAlreadyEnabled(string $type) { Mockery::mock('overload:' . Command\Enable::class) ->shouldReceive('process') @@ -332,9 +351,9 @@ public function testMessageOnEnableWhenModuleIsAlreadyEnabled($type) $this->setUpModule($modulesDir, 'App', $type); $this->console - ->writeLine(Argument::containingString('Autoloading rules already exist for the module "App"')) - ->shouldBeCalled(); - $this->assertNotHelpOutput(STDERR); + ->expects($this->once()) + ->method('writeLine') + ->with('Autoloading rules already exist for the module "App"'); $this->assertComposerBinaryExecutable(); $this->assertEquals(0, $this->command->process(['enable', 'App'])); @@ -345,10 +364,8 @@ public function testMessageOnEnableWhenModuleIsAlreadyEnabled($type) * @preserveGlobalState disabled * * @dataProvider type - * - * @param string $type */ - public function testSuccessMessageOnEnable($type) + public function testSuccessMessageOnEnable(string $type) { $mock = Mockery::mock('overload:' . Command\Enable::class); $mock @@ -366,14 +383,12 @@ public function testSuccessMessageOnEnable($type) $this->setUpModule($modulesDir, 'App', $type); $this->console - ->writeLine(Argument::containingString('Successfully added composer autoloading for the module "App"')) - ->shouldBeCalled(); - $this->console - ->writeLine(Argument::containingString( - 'You can now safely remove the App\Module::getAutoloaderConfig() implementation' - )) - ->shouldBeCalled(); - $this->assertNotHelpOutput(STDERR); + ->expects($this->exactly(2)) + ->method('writeLine') + ->withConsecutive( + ['Successfully added composer autoloading for the module "App"'], + ['You can now safely remove the App\Module::getAutoloaderConfig() implementation.'], + ); $this->assertComposerBinaryExecutable(); $this->assertEquals(0, $this->command->process(['enable', 'App'])); @@ -384,10 +399,8 @@ public function testSuccessMessageOnEnable($type) * @preserveGlobalState disabled * * @dataProvider type - * - * @param string $type */ - public function testSuccessMessageOnEnableAndModuleClassFileMoved($type) + public function testSuccessMessageOnEnableAndModuleClassFileMoved(string $type) { $mock = Mockery::mock('overload:' . Command\Enable::class); $mock @@ -405,17 +418,13 @@ public function testSuccessMessageOnEnableAndModuleClassFileMoved($type) $this->setUpModule($modulesDir, 'App', $type); $this->console - ->writeLine(Argument::containingString('Successfully added composer autoloading for the module "App"')) - ->shouldBeCalled(); - $this->console - ->writeLine(Argument::containingString( - 'You can now safely remove the App\Module::getAutoloaderConfig() implementation' - )) - ->shouldBeCalled(); - $this->console - ->writeLine(Argument::containingString('Renaming from-foo to too-bar')) - ->shouldBeCalled(); - $this->assertNotHelpOutput(STDERR); + ->expects($this->exactly(3)) + ->method('writeLine') + ->withConsecutive( + ['Renaming from-foo to too-bar'], + ['Successfully added composer autoloading for the module "App"'], + ['You can now safely remove the App\Module::getAutoloaderConfig() implementation.'], + ); $this->assertComposerBinaryExecutable(); $this->assertEquals(0, $this->command->process(['enable', 'App'])); @@ -426,10 +435,8 @@ public function testSuccessMessageOnEnableAndModuleClassFileMoved($type) * @preserveGlobalState disabled * * @dataProvider type - * - * @param string $type */ - public function testMessageOnDisableWhenModulesIsAlreadyDisabled($type) + public function testMessageOnDisableWhenModuleIsAlreadyDisabled(string $type) { Mockery::mock('overload:' . Command\Disable::class) ->shouldReceive('process') @@ -441,9 +448,9 @@ public function testMessageOnDisableWhenModulesIsAlreadyDisabled($type) $this->setUpModule($modulesDir, 'App', $type); $this->console - ->writeLine(Argument::containingString('Autoloading rules already do not exist for the module "App"')) - ->shouldBeCalled(); - $this->assertNotHelpOutput(STDERR); + ->expects($this->once()) + ->method('writeLine') + ->with('Autoloading rules already do not exist for the module "App"'); $this->assertComposerBinaryExecutable(); $this->assertEquals(0, $this->command->process(['disable', 'App'])); @@ -454,10 +461,8 @@ public function testMessageOnDisableWhenModulesIsAlreadyDisabled($type) * @preserveGlobalState disabled * * @dataProvider type - * - * @param string $type */ - public function testSuccessMessageOnDisable($type) + public function testSuccessMessageOnDisable(string $type) { Mockery::mock('overload:' . Command\Disable::class) ->shouldReceive('process') @@ -469,23 +474,15 @@ public function testSuccessMessageOnDisable($type) $this->setUpModule($modulesDir, 'App', $type); $this->console - ->writeLine( - Argument::containingString('Successfully removed composer autoloading for the module "App"') - ) - ->shouldBeCalled(); - $this->assertNotHelpOutput(STDERR); + ->expects($this->atLeastOnce()) + ->method('writeLine') + ->with('Successfully removed composer autoloading for the module "App"'); $this->assertComposerBinaryExecutable(); $this->assertEquals(0, $this->command->process(['disable', 'App'])); } - /** - * @param Command $command - * @param string $cmd - * @param string $class - * @return void - */ - private function injectCommand(Command $command, $cmd, $class) + private function injectCommand(Command $command, string $cmd, string $class): void { $rCommand = new ReflectionObject($command); $rp = $rCommand->getProperty('commands'); @@ -497,12 +494,7 @@ private function injectCommand(Command $command, $cmd, $class) $rp->setValue($command, $commands); } - /** - * @param Command $command - * @param string $dir - * @return void - */ - private function setProjectDir(Command $command, $dir) + private function setProjectDir(Command $command, string $dir): void { $rc = new ReflectionObject($command); $rp = $rc->getProperty('projectDir'); @@ -510,38 +502,42 @@ private function setProjectDir(Command $command, $dir) $rp->setValue($command, $dir); } - private function assertHelpOutput($resource = STDOUT, $command = self::TEST_COMMAND_NAME) + /** @param resource $resource */ + private function assertHelpOutput($resource = STDOUT, string $command = self::TEST_COMMAND_NAME): void { $this->console - ->writeLine( - Argument::containingString($command . ' [command] [options] modulename'), + ->expects($this->atLeastOnce()) + ->method('writeLine') + ->with( + $this->stringContains($command . ' [command] [options] modulename'), true, $resource - ) - ->shouldBeCalled(); + ); } - private function assertNotHelpOutput($resource = STDOUT, $command = self::TEST_COMMAND_NAME) + /** @param resource $resource */ + private function assertNotHelpOutput($resource = STDOUT, string $command = self::TEST_COMMAND_NAME): void { $this->console - ->writeLine( - Argument::containingString($command . ' [command] [options] modulename'), + ->expects($this->never()) + ->method('writeLine') + ->with( + $this->stringContains($command . ' [command] [options] modulename'), true, $resource - ) - ->shouldNotBeCalled(); + ); } - private function assertComposerBinaryNotExecutable() + private function assertComposerBinaryNotExecutable(): void { - $exec = $this->getFunctionMock('Laminas\ComposerAutoloading', 'exec'); + $exec = $this->getFunctionMock('Laminas\ComposerAutoloading', 'exec'); $exec->expects($this->once())->willReturnCallback(function ($command, &$output, &$retValue) { $this->assertEquals('composer 2>&1', $command); $retValue = 1; }); } - private function assertComposerBinaryExecutable() + private function assertComposerBinaryExecutable(): void { $exec = $this->getFunctionMock('Laminas\ComposerAutoloading', 'exec'); $exec->expects($this->once())->willReturnCallback(function ($command, &$output, &$retValue) { diff --git a/test/HelpTest.php b/test/HelpTest.php index c55cd76..6d3b558 100644 --- a/test/HelpTest.php +++ b/test/HelpTest.php @@ -11,7 +11,6 @@ use Laminas\ComposerAutoloading\Help; use Laminas\Stdlib\ConsoleHelper; use PHPUnit\Framework\TestCase; -use Prophecy\Argument; class HelpTest extends TestCase { @@ -19,21 +18,20 @@ public function testWritesHelpMessageToConsoleUsingCommandProvidedAtInstantiatio { $resource = fopen('php://temp', 'wb+'); - $console = $this->prophesize(ConsoleHelper::class); + /** @psalm-var ConsoleHelper&\PHPUnit\Framework\MockObject\MockObject $console */ + $console = $this->createMock(ConsoleHelper::class); $console - ->writeLine( - Argument::that(function ($message) { + ->expects($this->atLeastOnce()) + ->method('writeLine') + ->with( + $this->callback(function (string $message): bool { return false !== strpos($message, 'laminas-composer-autoloading'); }), true, $resource - ) - ->shouldBeCalled(); + ); - $command = new Help( - 'laminas-composer-autoloading', - $console->reveal() - ); + $command = new Help('laminas-composer-autoloading', $console); $this->assertNull($command($resource)); } @@ -42,21 +40,20 @@ public function testTruncatesCommandToBasenameIfItIsARealpath() { $resource = fopen('php://temp', 'wb+'); - $console = $this->prophesize(ConsoleHelper::class); + /** @psalm-var ConsoleHelper&\PHPUnit\Framework\MockObject\MockObject $console */ + $console = $this->createMock(ConsoleHelper::class); $console - ->writeLine( - Argument::that(function ($message) { + ->expects($this->atLeastOnce()) + ->method('writeLine') + ->with( + $this->callback(function (string $message): bool { return false !== strpos($message, basename(__FILE__)); }), true, $resource - ) - ->shouldBeCalled(); + ); - $command = new Help( - realpath(__FILE__), - $console->reveal() - ); + $command = new Help(realpath(__FILE__), $console); $this->assertNull($command($resource)); } diff --git a/test/ProjectSetupTrait.php b/test/ProjectSetupTrait.php index e774c91..3acda83 100644 --- a/test/ProjectSetupTrait.php +++ b/test/ProjectSetupTrait.php @@ -20,19 +20,19 @@ trait ProjectSetupTrait /** @var string */ private $moduleFileContent = <<< 'EOM' -