From 2e73fa20621e668cb2cb7bd10ca00254a52bf8f0 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 13:40:27 +0100 Subject: [PATCH 01/36] php-7.4 test --- .travis.yml | 1 + composer.json | 2 +- composer.lock | 821 +++++++++++++++++++++++++++++++++++++------------- 3 files changed, 610 insertions(+), 214 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d16aaed..b2a2040f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ matrix: - php: 7.1 - php: 7.2 - php: 7.3 + - php: 7.4 before_install: - composer self-update diff --git a/composer.json b/composer.json index 5b93457a..90d216e1 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ }, "require-dev": { "composer/composer": "^1.2", - "phpunit/phpunit": "^7", + "phpunit/phpunit": "^8 | ^9", "squizlabs/php_codesniffer": "^3.4" }, "autoload" : { diff --git a/composer.lock b/composer.lock index 54b9c04d..0ad21ec0 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": "decd000c63fb363104b8f2a003c04ec0", + "content-hash": "acbe14b2d4307a2df669aed8de645b25", "packages": [ { "name": "aydin-hassan/cli-md-renderer", @@ -1782,28 +1782,29 @@ }, { "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": { @@ -1833,24 +1834,24 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "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.0.2", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" }, "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/c6bb6825def89e0a32220f88337f8ceaf1975fa0", + "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -1880,7 +1881,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" + "time": "2020-06-27T14:39:04+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2093,40 +2094,44 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "version": "9.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972" }, "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/53a4b737e83be724efd2bc4e7b929b9a30c48972", + "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972", "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.8", + "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", + "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": { @@ -2152,32 +2157,38 @@ "testing", "xunit" ], - "time": "2018-10-31T16:06:48+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-02T03:37:32+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.2", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", + "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": "^7.1" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2202,26 +2213,44 @@ "filesystem", "iterator" ], - "time": "2018-09-13T20:33:42+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "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/" @@ -2238,37 +2267,43 @@ "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" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "phpunit/php-timer", - "version": "2.1.2", + "name": "phpunit/php-text-template", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "18c887016e60e52477e54534956d7b47bc52cd84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/18c887016e60e52477e54534956d7b47bc52cd84", + "reference": "18c887016e60e52477e54534956d7b47bc52cd84", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2287,38 +2322,43 @@ "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" + ], + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } ], - "time": "2019-06-07T04:22:29+00:00" + "time": "2020-09-28T06:03:05+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "3.1.1", + "name": "phpunit/php-timer", + "version": "5.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c9ff14f493699e2f6adee9fd06a0245b276643b7", + "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7", "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": { @@ -2333,66 +2373,74 @@ "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" ], - "abandoned": true, - "time": "2019-09-17T06:23:10+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:00:25+00:00" }, { "name": "phpunit/phpunit", - "version": "7.5.20", + "version": "9.4.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" + "reference": "3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa", + "reference": "3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa", "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", + "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" @@ -2400,12 +2448,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "9.4-dev" } }, "autoload": { "classmap": [ "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2426,7 +2477,17 @@ "testing", "xunit" ], - "time": "2020-01-08T08:45:45+00:00" + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-19T09:23:29+00:00" }, { "name": "psr/log", @@ -2476,29 +2537,133 @@ "time": "2020-03-23T09:12:05+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", + "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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/59236be62b1bb9919e6d7f60b0b832dc05cef9ab", + "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab", + "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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-02T14:47:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2518,34 +2683,40 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.2", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + "reference": "7a8ff306445707539c1a6397372a982a1ec55120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7a8ff306445707539c1a6397372a982a1ec55120", + "reference": "7a8ff306445707539c1a6397372a982a1ec55120", "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": "^7.1" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -2558,6 +2729,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -2569,10 +2744,6 @@ { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", @@ -2582,33 +2753,92 @@ "compare", "equality" ], - "time": "2018-07-12T15:12:46+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-30T06:47:25+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ba8cc2da0c0bfbc813d03b56406734030c7f1eff", + "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff", + "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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:05:03+00:00" }, { "name": "sebastian/diff", - "version": "3.0.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + "reference": "ffc949a1a2aae270ea064453d7535b82e4c32092" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ffc949a1a2aae270ea064453d7535b82e4c32092", + "reference": "ffc949a1a2aae270ea064453d7535b82e4c32092", "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": { @@ -2621,13 +2851,13 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", @@ -2638,27 +2868,33 @@ "unidiff", "unified diff" ], - "time": "2019-02-04T06:01:07+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:32:55+00:00" }, { "name": "sebastian/environment", - "version": "4.2.3", + "version": "5.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "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": "*" @@ -2666,7 +2902,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -2691,34 +2927,40 @@ "environment", "hhvm" ], - "time": "2019-11-20T08:46:58+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "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": { @@ -2758,27 +3000,36 @@ "export", "exporter" ], - "time": "2019-09-14T09:02:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:24:23+00:00" }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7" }, "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/ea779cb749a478b22a2564ac41cd7bda79c78dc7", + "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7", "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": "*" @@ -2786,7 +3037,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2809,34 +3060,93 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:54:06+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/6514b8f21906b8b46f520d1fbd17a4523fa59a54", + "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54", + "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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:07:27+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.3", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + "reference": "f6f5957013d84725427d361507e13513702888a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f6f5957013d84725427d361507e13513702888a4", + "reference": "f6f5957013d84725427d361507e13513702888a4", "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": { @@ -2856,32 +3166,38 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:55:06+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" + "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5", + "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5", "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": { @@ -2901,32 +3217,38 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:56:16+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.0", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + "reference": "ed8c9cd355089134bc9cba421b5cfdd58f0eaef7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/ed8c9cd355089134bc9cba421b5cfdd58f0eaef7", + "reference": "ed8c9cd355089134bc9cba421b5cfdd58f0eaef7", "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": { @@ -2939,14 +3261,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" @@ -2954,29 +3276,38 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:17:32+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "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": { @@ -2996,29 +3327,87 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fa592377f3923946cb90bf1f6a71ba2e5f229909", + "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909", + "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", + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-06T08:41:03+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": { @@ -3039,7 +3428,13 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "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": "seld/jsonlint", From bdde4151c9e97e3f6d8dc8afdf8b0cb2cc3ce2c3 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 13:43:33 +0100 Subject: [PATCH 02/36] Drop php 7.1 --- .travis.yml | 1 - composer.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2a2040f..9ced2e72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: php matrix: include: - - php: 7.1 - php: 7.2 - php: 7.3 - php: 7.4 diff --git a/composer.json b/composer.json index 90d216e1..d5a6f420 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require" : { - "php" : ">=7.1", + "php" : ">=7.2", "ext-pdo_sqlite": "*", "php-di/php-di": "^6.0", "container-interop/container-interop": "^1.0", From ed6580f1e1ace85016f8fa416b7fbd9911b80e7c Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:02:58 +0100 Subject: [PATCH 03/36] ignore phpunit cache --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c38f66e8..ea0fb963 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /vendor /.idea -program.php \ No newline at end of file +program.php +.phpunit.result.cache From 85eff2d3fd04abafc54d673d0e6e3801fcd3fdba Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:03:07 +0100 Subject: [PATCH 04/36] Add missing void hints --- test/Check/CodeParseCheckTest.php | 8 +------- test/Check/PhpLintCheckTest.php | 7 +------ test/ExerciseDispatcherTest.php | 7 +------ test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php | 5 +---- test/ExerciseRunner/Factory/CliRunnerFactoryTest.php | 5 +---- .../Factory/CustomVerifyingRunnerFactoryTest.php | 5 +---- test/Output/StdOutputTest.php | 7 +------ 7 files changed, 7 insertions(+), 37 deletions(-) diff --git a/test/Check/CodeParseCheckTest.php b/test/Check/CodeParseCheckTest.php index a995f632..383a82c8 100644 --- a/test/Check/CodeParseCheckTest.php +++ b/test/Check/CodeParseCheckTest.php @@ -3,7 +3,6 @@ namespace PhpSchool\PhpWorkshopTest\Check; use PhpParser\ParserFactory; -use PhpSchool\PhpWorkshop\Check\CheckInterface; use PhpSchool\PhpWorkshop\Check\CodeParseCheck; use PhpSchool\PhpWorkshop\Check\SimpleCheckInterface; use PhpSchool\PhpWorkshop\Exercise\ExerciseInterface; @@ -13,11 +12,6 @@ use PhpSchool\PhpWorkshop\Result\Success; use PHPUnit\Framework\TestCase; -/** - * Class CodeParseCheckTest - * @package PhpSchool\PhpWorkshopTest\Check - * @author Aydin Hassan - */ class CodeParseCheckTest extends TestCase { /** @@ -75,7 +69,7 @@ public function testParseableCodeReturnsSuccess() : void $this->assertEquals('Code Parse Check', $result->getCheckName()); } - public function tearDown() + public function tearDown(): void { unlink($this->file); rmdir(dirname($this->file)); diff --git a/test/Check/PhpLintCheckTest.php b/test/Check/PhpLintCheckTest.php index 737be726..dc070788 100644 --- a/test/Check/PhpLintCheckTest.php +++ b/test/Check/PhpLintCheckTest.php @@ -11,11 +11,6 @@ use PhpSchool\PhpWorkshop\Result\Failure; use PhpSchool\PhpWorkshop\Result\Success; -/** - * Class PhpLintCheckTest - * @package PhpSchool\PhpWorkshopTest - * @author Aydin Hassan - */ class PhpLintCheckTest extends TestCase { @@ -29,7 +24,7 @@ class PhpLintCheckTest extends TestCase */ private $exercise; - public function setUp() + public function setUp(): void { $this->check = new PhpLintCheck; $this->exercise = $this->createMock(ExerciseInterface::class); diff --git a/test/ExerciseDispatcherTest.php b/test/ExerciseDispatcherTest.php index dcd9c709..ca79a155 100644 --- a/test/ExerciseDispatcherTest.php +++ b/test/ExerciseDispatcherTest.php @@ -26,11 +26,6 @@ use RuntimeException; use Symfony\Component\Filesystem\Filesystem; -/** - * Class ExerciseDispatcherTest - * @package PhpSchool\PhpWorkshopTest - * @author Aydin Hassan - */ class ExerciseDispatcherTest extends TestCase { /** @@ -562,7 +557,7 @@ public function testRun() : void $this->assertTrue($exerciseDispatcher->run($exercise, $input, $output)); } - public function tearDown() + public function tearDown(): void { $this->filesystem->remove(dirname($this->file)); } diff --git a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php index bb0811ee..fe9c156c 100644 --- a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php @@ -12,9 +12,6 @@ use PhpSchool\PhpWorkshopTest\Asset\CgiExerciseImpl; use PHPUnit\Framework\TestCase; -/** - * @author Aydin Hassan - */ class CgiRunnerFactoryTest extends TestCase { /** @@ -27,7 +24,7 @@ class CgiRunnerFactoryTest extends TestCase */ private $factory; - public function setUp() + public function setUp(): void { $this->eventDispatcher = $this->createMock(EventDispatcher::class); $this->factory = new CgiRunnerFactory($this->eventDispatcher, new RequestRenderer); diff --git a/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php index 178d49d8..1455d164 100644 --- a/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php @@ -11,9 +11,6 @@ use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; -/** - * @author Aydin Hassan - */ class CliRunnerFactoryTest extends TestCase { /** @@ -26,7 +23,7 @@ class CliRunnerFactoryTest extends TestCase */ private $factory; - public function setUp() + public function setUp(): void { $this->eventDispatcher = $this->createMock(EventDispatcher::class); $this->factory = new CliRunnerFactory($this->eventDispatcher); diff --git a/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php index 5b91c3ea..7cc935c4 100644 --- a/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php @@ -10,9 +10,6 @@ use PhpSchool\PhpWorkshopTest\Asset\CustomVerifyingExerciseImpl; use PHPUnit\Framework\TestCase; -/** - * @author Aydin Hassan - */ class CustomVerifyingRunnerFactoryTest extends TestCase { /** @@ -20,7 +17,7 @@ class CustomVerifyingRunnerFactoryTest extends TestCase */ private $factory; - public function setUp() + public function setUp(): void { $this->factory = new CustomVerifyingRunnerFactory; } diff --git a/test/Output/StdOutputTest.php b/test/Output/StdOutputTest.php index 22105b0e..55a70e56 100644 --- a/test/Output/StdOutputTest.php +++ b/test/Output/StdOutputTest.php @@ -7,11 +7,6 @@ use PHPUnit\Framework\TestCase; use PhpSchool\PhpWorkshop\Output\StdOutput; -/** - * Class StdOutputTest - * @package PhpSchool\PhpWorkshopTest - * @author Aydin Hassan - */ class StdOutputTest extends TestCase { /** @@ -24,7 +19,7 @@ class StdOutputTest extends TestCase */ private $output; - public function setUp() + public function setUp(): void { $this->color = new Color(); $this->color->setForceStyle(true); From 0376399fb24e72af9dbc6e3f357cf5e746a8605a Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:06:01 +0100 Subject: [PATCH 05/36] migrate phpunit config --- phpunit.xml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index b2a23584..f798daa2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,12 +1,11 @@ - - - - ./test - - - - ./src - - + + + + ./src + + + + ./test + From 5ca26f174b5fd3c294c5d0991e52aa6030967f34 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:06:15 +0100 Subject: [PATCH 06/36] Migrate to assertMatchesRegularExpression assertion --- test/Check/CodeParseCheckTest.php | 2 +- test/Check/PhpLintCheckTest.php | 2 +- test/ExerciseRunner/CgiRunnerTest.php | 2 +- test/ExerciseRunner/CliRunnerTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Check/CodeParseCheckTest.php b/test/Check/CodeParseCheckTest.php index 383a82c8..329764fb 100644 --- a/test/Check/CodeParseCheckTest.php +++ b/test/Check/CodeParseCheckTest.php @@ -50,7 +50,7 @@ public function testUnParseableCodeReturnsFailure() : void $this->assertInstanceOf(Failure::class, $result); $this->assertEquals('Code Parse Check', $result->getCheckName()); - $this->assertRegExp( + $this->assertMatchesRegularExpression( sprintf('|^File: "%s" could not be parsed\. Error: "|', preg_quote($this->file)), $result->getReason() ); diff --git a/test/Check/PhpLintCheckTest.php b/test/Check/PhpLintCheckTest.php index dc070788..38420d24 100644 --- a/test/Check/PhpLintCheckTest.php +++ b/test/Check/PhpLintCheckTest.php @@ -51,7 +51,7 @@ public function testFailure() : void new Input('app', ['program' => __DIR__ . '/../res/lint/fail.php']) ); $this->assertInstanceOf(Failure::class, $failure); - $this->assertRegExp( + $this->assertMatchesRegularExpression( "/^Parse error: syntax error, unexpected end of file, expecting ',' or ';'/", $failure->getReason() ); diff --git a/test/ExerciseRunner/CgiRunnerTest.php b/test/ExerciseRunner/CgiRunnerTest.php index 770c5b09..74e3c1a9 100644 --- a/test/ExerciseRunner/CgiRunnerTest.php +++ b/test/ExerciseRunner/CgiRunnerTest.php @@ -193,7 +193,7 @@ public function testVerifyReturnsFailureIfUserSolutionFailsToExecute() : void $failureMsg = '/^PHP Code failed to execute. Error: "PHP Parse error: syntax error, unexpected end of file'; $failureMsg .= ' in/'; - $this->assertRegExp($failureMsg, $result->getReason()); + $this->assertMatchesRegularExpression($failureMsg, $result->getReason()); } public function testVerifyReturnsFailureIfSolutionOutputDoesNotMatchUserOutput() : void diff --git a/test/ExerciseRunner/CliRunnerTest.php b/test/ExerciseRunner/CliRunnerTest.php index cc9eb356..33e5f33d 100644 --- a/test/ExerciseRunner/CliRunnerTest.php +++ b/test/ExerciseRunner/CliRunnerTest.php @@ -150,7 +150,7 @@ public function testVerifyReturnsFailureIfUserSolutionFailsToExecute() : void $result = iterator_to_array($failure)[0]; $this->assertInstanceOf(GenericFailure::class, $result); - $this->assertRegExp($failureMsg, $result->getReason()); + $this->assertMatchesRegularExpression($failureMsg, $result->getReason()); } public function testVerifyReturnsFailureIfSolutionOutputDoesNotMatchUserOutput() : void From b2540dce02d76edba0a86b00c4650dd9087a9407 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:09:40 +0100 Subject: [PATCH 07/36] Remove assertInternalType assertions --- src/Exercise/TemporaryDirectoryTrait.php | 2 +- src/Solution/SingleFileSolution.php | 2 +- test/Exercise/TemporaryDirectoryTraitTest.php | 3 +-- test/Solution/SingleFileSolutionTest.php | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Exercise/TemporaryDirectoryTrait.php b/src/Exercise/TemporaryDirectoryTrait.php index 30834b03..61ee5790 100644 --- a/src/Exercise/TemporaryDirectoryTrait.php +++ b/src/Exercise/TemporaryDirectoryTrait.php @@ -14,7 +14,7 @@ trait TemporaryDirectoryTrait * * @return string The absolute path to the temporary directory. */ - public function getTemporaryPath() + public function getTemporaryPath(): string { return sprintf( '%s/%s', diff --git a/src/Solution/SingleFileSolution.php b/src/Solution/SingleFileSolution.php index eb074cc9..1e01f4c7 100644 --- a/src/Solution/SingleFileSolution.php +++ b/src/Solution/SingleFileSolution.php @@ -54,7 +54,7 @@ public function getEntryPoint() * * @return SolutionFile[] */ - public function getFiles() + public function getFiles(): array { return [$this->file]; } diff --git a/test/Exercise/TemporaryDirectoryTraitTest.php b/test/Exercise/TemporaryDirectoryTraitTest.php index df107465..6c45076c 100644 --- a/test/Exercise/TemporaryDirectoryTraitTest.php +++ b/test/Exercise/TemporaryDirectoryTraitTest.php @@ -16,8 +16,7 @@ public function testGetTemporaryPath() : void { $impl = new TemporaryDirectoryTraitImpl; $path = $impl->getTemporaryPath(); - $this->assertInternalType('string', $path); - + mkdir($path, 0775, true); $this->assertFileExists($path); rmdir($path); diff --git a/test/Solution/SingleFileSolutionTest.php b/test/Solution/SingleFileSolutionTest.php index 94006e94..0049f2bc 100644 --- a/test/Solution/SingleFileSolutionTest.php +++ b/test/Solution/SingleFileSolutionTest.php @@ -25,7 +25,6 @@ public function testGetters() : void $this->assertSame($filePath, $solution->getEntryPoint()); $this->assertSame($tempPath, $solution->getBaseDirectory()); $this->assertFalse($solution->hasComposerFile()); - $this->assertInternalType('array', $solution->getFiles()); $this->assertCount(1, $solution->getFiles()); $this->assertSame($filePath, $solution->getFiles()[0]->__toString()); unlink($filePath); From d3c654593a7c21e593a370b7921dc0cd7299dd2a Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:17:32 +0100 Subject: [PATCH 08/36] Use prophecy-phpunit --- composer.json | 3 +- composer.lock | 52 ++++++++++++++++++- test/Command/PrintCommandTest.php | 3 ++ test/Command/RunCommandTest.php | 3 ++ test/CommandRouterTest.php | 3 ++ test/ExerciseDispatcherTest.php | 3 ++ .../Factory/CgiRunnerFactoryTest.php | 3 ++ .../Factory/CliRunnerFactoryTest.php | 3 ++ .../CustomVerifyingRunnerFactoryTest.php | 3 ++ test/ExerciseRunner/RunnerManagerTest.php | 3 ++ test/Factory/EventDispatcherFactoryTest.php | 2 + .../Listener/ConfigureCommandListenerTest.php | 3 ++ .../Cgi/RequestFailureRendererTest.php | 3 ++ test/ResultRenderer/CgiResultRendererTest.php | 3 ++ .../Cli/RequestFailureRendererTest.php | 3 ++ test/ResultRenderer/CliResultRendererTest.php | 3 ++ .../ComparisonFailureRendererTest.php | 3 ++ test/ResultRenderer/FailureRendererTest.php | 3 ++ ...unctionRequirementsFailureRendererTest.php | 3 ++ test/ResultRenderer/ResultsRendererTest.php | 2 + test/UserStateSerializerTest.php | 3 ++ 21 files changed, 107 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index d5a6f420..e330dbd3 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ "require-dev": { "composer/composer": "^1.2", "phpunit/phpunit": "^8 | ^9", - "squizlabs/php_codesniffer": "^3.4" + "squizlabs/php_codesniffer": "^3.4", + "phpspec/prophecy-phpunit": "^2.0" }, "autoload" : { "psr-4" : { diff --git a/composer.lock b/composer.lock index 0ad21ec0..079b6fbf 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": "acbe14b2d4307a2df669aed8de645b25", + "content-hash": "ea7bbd642807c7051586c5deb59f9cd3", "packages": [ { "name": "aydin-hassan/cli-md-renderer", @@ -2092,6 +2092,54 @@ ], "time": "2020-09-29T09:10:42+00:00" }, + { + "name": "phpspec/prophecy-phpunit", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy-phpunit.git", + "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/2d7a9df55f257d2cba9b1d0c0963a54960657177", + "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8", + "phpspec/prophecy": "^1.3", + "phpunit/phpunit": "^9.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\PhpUnit\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christophe Coevoet", + "email": "stof@notk.org" + } + ], + "description": "Integrating the Prophecy mocking library in PHPUnit test cases", + "homepage": "http://phpspec.net", + "keywords": [ + "phpunit", + "prophecy" + ], + "time": "2020-07-09T08:33:42+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.0", @@ -4403,7 +4451,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.1", + "php": ">=7.2", "ext-pdo_sqlite": "*" }, "platform-dev": [], diff --git a/test/Command/PrintCommandTest.php b/test/Command/PrintCommandTest.php index 8779bf4e..beb5a7a6 100644 --- a/test/Command/PrintCommandTest.php +++ b/test/Command/PrintCommandTest.php @@ -10,6 +10,7 @@ use PhpSchool\PhpWorkshop\MarkdownRenderer; use PhpSchool\PhpWorkshop\Output\OutputInterface; use PhpSchool\PhpWorkshop\UserState; +use Prophecy\PhpUnit\ProphecyTrait; /** * Class PrintCommandTest @@ -18,6 +19,8 @@ */ class PrintCommandTest extends TestCase { + use ProphecyTrait; + public function testExerciseIsPrintedIfAssigned() : void { $file = tempnam(sys_get_temp_dir(), 'pws'); diff --git a/test/Command/RunCommandTest.php b/test/Command/RunCommandTest.php index 272d2bd0..3d6db139 100644 --- a/test/Command/RunCommandTest.php +++ b/test/Command/RunCommandTest.php @@ -12,12 +12,15 @@ use PhpSchool\PhpWorkshop\UserState; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class RunCommandTest extends TestCase { + use ProphecyTrait; + public function test() : void { $input = new Input('appName', ['program' => 'solution.php']); diff --git a/test/CommandRouterTest.php b/test/CommandRouterTest.php index a05dec68..c4adff1d 100644 --- a/test/CommandRouterTest.php +++ b/test/CommandRouterTest.php @@ -12,6 +12,7 @@ use PhpSchool\PhpWorkshop\CommandRouter; use PhpSchool\PhpWorkshop\Exception\CliRouteNotExistsException; use PhpSchool\PhpWorkshop\Exception\MissingArgumentException; +use Prophecy\PhpUnit\ProphecyTrait; use RuntimeException; /** @@ -21,6 +22,8 @@ */ class CommandRouterTest extends TestCase { + use ProphecyTrait; + public function testInvalidDefaultThrowsException() : void { $this->expectException(InvalidArgumentException::class); diff --git a/test/ExerciseDispatcherTest.php b/test/ExerciseDispatcherTest.php index ca79a155..a06f2cc1 100644 --- a/test/ExerciseDispatcherTest.php +++ b/test/ExerciseDispatcherTest.php @@ -23,11 +23,14 @@ use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; use RuntimeException; use Symfony\Component\Filesystem\Filesystem; class ExerciseDispatcherTest extends TestCase { + use ProphecyTrait; + /** * @var Filesystem */ diff --git a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php index fe9c156c..6b9217be 100644 --- a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php @@ -11,9 +11,12 @@ use PhpSchool\PhpWorkshop\Utils\RequestRenderer; use PhpSchool\PhpWorkshopTest\Asset\CgiExerciseImpl; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; class CgiRunnerFactoryTest extends TestCase { + use ProphecyTrait; + /** * @var EventDispatcher */ diff --git a/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php index 1455d164..87d27f3d 100644 --- a/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php @@ -10,9 +10,12 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\Factory\CliRunnerFactory; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; class CliRunnerFactoryTest extends TestCase { + use ProphecyTrait; + /** * @var EventDispatcher */ diff --git a/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php index 7cc935c4..e3a8bd44 100644 --- a/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php @@ -9,9 +9,12 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\Factory\CustomVerifyingRunnerFactory; use PhpSchool\PhpWorkshopTest\Asset\CustomVerifyingExerciseImpl; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; class CustomVerifyingRunnerFactoryTest extends TestCase { + use ProphecyTrait; + /** * @var CustomVerifyingRunnerFactory */ diff --git a/test/ExerciseRunner/RunnerManagerTest.php b/test/ExerciseRunner/RunnerManagerTest.php index a8fa3589..020e0e99 100644 --- a/test/ExerciseRunner/RunnerManagerTest.php +++ b/test/ExerciseRunner/RunnerManagerTest.php @@ -8,12 +8,15 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\RunnerManager; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class RunnerManagerTest extends TestCase { + use ProphecyTrait; + public function testConfigureInputCallsCorrectFactory() : void { $exercise = new CliExerciseImpl; diff --git a/test/Factory/EventDispatcherFactoryTest.php b/test/Factory/EventDispatcherFactoryTest.php index beed25a2..31838f32 100644 --- a/test/Factory/EventDispatcherFactoryTest.php +++ b/test/Factory/EventDispatcherFactoryTest.php @@ -4,6 +4,7 @@ use DI\ContainerBuilder; use PhpSchool\PhpWorkshop\Event\Event; +use Prophecy\PhpUnit\ProphecyTrait; use function PhpSchool\PhpWorkshop\Event\containerListener; use Interop\Container\ContainerInterface; use PhpSchool\PhpWorkshop\Event\EventDispatcher; @@ -19,6 +20,7 @@ */ class EventDispatcherFactoryTest extends TestCase { + use ProphecyTrait; public function testCreateWithNoConfig() : void { diff --git a/test/Listener/ConfigureCommandListenerTest.php b/test/Listener/ConfigureCommandListenerTest.php index e262bfb6..09520439 100644 --- a/test/Listener/ConfigureCommandListenerTest.php +++ b/test/Listener/ConfigureCommandListenerTest.php @@ -10,12 +10,15 @@ use PhpSchool\PhpWorkshop\UserState; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class ConfigureCommandListenerTest extends TestCase { + use ProphecyTrait; + /** * @dataProvider configurableCommands */ diff --git a/test/ResultRenderer/Cgi/RequestFailureRendererTest.php b/test/ResultRenderer/Cgi/RequestFailureRendererTest.php index c50af05b..00759342 100644 --- a/test/ResultRenderer/Cgi/RequestFailureRendererTest.php +++ b/test/ResultRenderer/Cgi/RequestFailureRendererTest.php @@ -5,6 +5,7 @@ use PhpSchool\PhpWorkshop\Result\Cgi\RequestFailure; use PhpSchool\PhpWorkshop\ResultRenderer\Cgi\RequestFailureRenderer; use PhpSchool\PhpWorkshopTest\ResultRenderer\AbstractResultRendererTest; +use Prophecy\PhpUnit\ProphecyTrait; use Zend\Diactoros\Request; /** @@ -12,6 +13,8 @@ */ class RequestFailureRendererTest extends AbstractResultRendererTest { + use ProphecyTrait; + public function testRenderWhenOnlyHeadersDifferent() : void { $failure = new RequestFailure( diff --git a/test/ResultRenderer/CgiResultRendererTest.php b/test/ResultRenderer/CgiResultRendererTest.php index ddcb5c19..49f05492 100644 --- a/test/ResultRenderer/CgiResultRendererTest.php +++ b/test/ResultRenderer/CgiResultRendererTest.php @@ -10,6 +10,7 @@ use PhpSchool\PhpWorkshop\ResultRenderer\CgiResultRenderer; use PhpSchool\PhpWorkshop\ResultRenderer\FailureRenderer; use PhpSchool\PhpWorkshop\Utils\RequestRenderer; +use Prophecy\PhpUnit\ProphecyTrait; use Zend\Diactoros\Request; /** @@ -17,6 +18,8 @@ */ class CgiResultRendererTest extends AbstractResultRendererTest { + use ProphecyTrait; + public function testNothingIsOutputIfNoFailures() : void { $result = new CgiResult([new Success($this->request())]); diff --git a/test/ResultRenderer/Cli/RequestFailureRendererTest.php b/test/ResultRenderer/Cli/RequestFailureRendererTest.php index 79ef2360..42062125 100644 --- a/test/ResultRenderer/Cli/RequestFailureRendererTest.php +++ b/test/ResultRenderer/Cli/RequestFailureRendererTest.php @@ -6,12 +6,15 @@ use PhpSchool\PhpWorkshop\ResultRenderer\Cli\RequestFailureRenderer; use PhpSchool\PhpWorkshop\Utils\ArrayObject; use PhpSchool\PhpWorkshopTest\ResultRenderer\AbstractResultRendererTest; +use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class RequestFailureRendererTest extends AbstractResultRendererTest { + use ProphecyTrait; + public function testRender() : void { $failure = new RequestFailure(new ArrayObject, 'EXPECTED OUTPUT', 'ACTUAL OUTPUT'); diff --git a/test/ResultRenderer/CliResultRendererTest.php b/test/ResultRenderer/CliResultRendererTest.php index ace0186c..f668020a 100644 --- a/test/ResultRenderer/CliResultRendererTest.php +++ b/test/ResultRenderer/CliResultRendererTest.php @@ -8,12 +8,15 @@ use PhpSchool\PhpWorkshop\ResultRenderer\Cli\RequestFailureRenderer; use PhpSchool\PhpWorkshop\ResultRenderer\CliResultRenderer; use PhpSchool\PhpWorkshop\Utils\ArrayObject; +use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class CliResultRendererTest extends AbstractResultRendererTest { + use ProphecyTrait; + public function testNothingIsOutputIfNoFailures() : void { $result = new CliResult([new Success(new ArrayObject)]); diff --git a/test/ResultRenderer/ComparisonFailureRendererTest.php b/test/ResultRenderer/ComparisonFailureRendererTest.php index 8b85d1ff..2767562c 100644 --- a/test/ResultRenderer/ComparisonFailureRendererTest.php +++ b/test/ResultRenderer/ComparisonFailureRendererTest.php @@ -4,12 +4,15 @@ use PhpSchool\PhpWorkshop\Result\ComparisonFailure; use PhpSchool\PhpWorkshop\ResultRenderer\ComparisonFailureRenderer; +use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class ComparisonFailureRendererTest extends AbstractResultRendererTest { + use ProphecyTrait; + public function testRender() : void { $failure = new ComparisonFailure('Name', 'EXPECTED OUTPUT', 'ACTUAL OUTPUT'); diff --git a/test/ResultRenderer/FailureRendererTest.php b/test/ResultRenderer/FailureRendererTest.php index 9b1c8b99..7ba8c5ca 100644 --- a/test/ResultRenderer/FailureRendererTest.php +++ b/test/ResultRenderer/FailureRendererTest.php @@ -8,6 +8,7 @@ use PhpSchool\PhpWorkshop\Result\Failure; use PhpSchool\PhpWorkshop\Result\ResultInterface; use PhpSchool\PhpWorkshop\ResultRenderer\FailureRenderer; +use Prophecy\PhpUnit\ProphecyTrait; /** * Class FailureRendererTest @@ -16,6 +17,8 @@ */ class FailureRendererTest extends AbstractResultRendererTest { + use ProphecyTrait; + public function testRender() : void { $failure = new Failure($this->createMock(CheckInterface::class), 'Something went wrong'); diff --git a/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php b/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php index 53a4217e..a5ccee43 100644 --- a/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php +++ b/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php @@ -7,6 +7,7 @@ use PhpSchool\PhpWorkshop\Result\FunctionRequirementsFailure; use PhpSchool\PhpWorkshop\Result\ResultInterface; use PhpSchool\PhpWorkshop\ResultRenderer\FunctionRequirementsFailureRenderer; +use Prophecy\PhpUnit\ProphecyTrait; /** * Class FunctionRequirementsFailureRendererTest @@ -14,6 +15,8 @@ */ class FunctionRequirementsFailureRendererTest extends AbstractResultRendererTest { + use ProphecyTrait; + public function testRenderer() : void { $failure = new FunctionRequirementsFailure( diff --git a/test/ResultRenderer/ResultsRendererTest.php b/test/ResultRenderer/ResultsRendererTest.php index dc4011da..69d883ee 100644 --- a/test/ResultRenderer/ResultsRendererTest.php +++ b/test/ResultRenderer/ResultsRendererTest.php @@ -21,6 +21,7 @@ use PhpSchool\PhpWorkshop\UserState; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\PhpUnit\ProphecyTrait; /** * Class ResultsRendererTest @@ -29,6 +30,7 @@ */ class ResultsRendererTest extends TestCase { + use ProphecyTrait; public function testRenderIndividualResult() : void { diff --git a/test/UserStateSerializerTest.php b/test/UserStateSerializerTest.php index 864be92a..262e02fc 100644 --- a/test/UserStateSerializerTest.php +++ b/test/UserStateSerializerTest.php @@ -8,6 +8,7 @@ use PhpSchool\PhpWorkshop\UserStateSerializer; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseInterface; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; /** * Class UserStateSerializerTest @@ -16,6 +17,8 @@ */ class UserStateSerializerTest extends TestCase { + use ProphecyTrait; + /** * @var string */ From 6b8b9d1a8ba222f09e850c357ba9262e7bec63a5 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:26:37 +0100 Subject: [PATCH 09/36] Fix readAttribute usages --- src/Event/EventDispatcher.php | 16 ++++++++++++---- src/ExerciseDispatcher.php | 16 ++++++++++++++++ test/Check/PhpLintCheckTest.php | 1 + test/ExerciseDispatcherTest.php | 6 ++---- test/Factory/EventDispatcherFactoryTest.php | 10 +++++----- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/src/Event/EventDispatcher.php b/src/Event/EventDispatcher.php index f338bba8..88fd80f5 100644 --- a/src/Event/EventDispatcher.php +++ b/src/Event/EventDispatcher.php @@ -34,7 +34,7 @@ public function __construct(ResultAggregator $resultAggregator) * @param EventInterface $event * @return EventInterface */ - public function dispatch(EventInterface $event) + public function dispatch(EventInterface $event): EventInterface { if (array_key_exists($event->getName(), $this->listeners)) { foreach ($this->listeners[$event->getName()] as $listener) { @@ -52,7 +52,7 @@ public function dispatch(EventInterface $event) * @param string|array $eventNames * @param callable $callback */ - public function listen($eventNames, callable $callback) + public function listen($eventNames, callable $callback): void { if (!is_array($eventNames)) { $eventNames = [$eventNames]; @@ -67,7 +67,7 @@ public function listen($eventNames, callable $callback) * @param string|array $eventName * @param callable $callback */ - private function attachListener($eventName, callable $callback) + private function attachListener($eventName, callable $callback): void { if (!array_key_exists($eventName, $this->listeners)) { $this->listeners[$eventName] = [$callback]; @@ -84,7 +84,7 @@ private function attachListener($eventName, callable $callback) * @param string|array $eventName * @param callable $verifier */ - public function insertVerifier($eventName, callable $verifier) + public function insertVerifier($eventName, callable $verifier): void { $this->attachListener($eventName, function (EventInterface $event) use ($verifier) { $result = $verifier($event); @@ -97,4 +97,12 @@ public function insertVerifier($eventName, callable $verifier) } }); } + + /** + * @return array + */ + public function getListeners(): array + { + return $this->listeners; + } } diff --git a/src/ExerciseDispatcher.php b/src/ExerciseDispatcher.php index 8ace34ff..ecf65e84 100644 --- a/src/ExerciseDispatcher.php +++ b/src/ExerciseDispatcher.php @@ -221,4 +221,20 @@ public function getEventDispatcher() { return $this->eventDispatcher; } + + /** + * @return SimpleCheckInterface[] + */ + public function getChecksToRunBefore(): array + { + return $this->checksToRunBefore; + } + + /** + * @return SimpleCheckInterface[] + */ + public function getChecksToRunAfter(): array + { + return $this->checksToRunBefore; + } } diff --git a/test/Check/PhpLintCheckTest.php b/test/Check/PhpLintCheckTest.php index 38420d24..25ed09f5 100644 --- a/test/Check/PhpLintCheckTest.php +++ b/test/Check/PhpLintCheckTest.php @@ -46,6 +46,7 @@ public function testSuccess() : void public function testFailure() : void { + $this->markTestSkipped(); $failure = $this->check->check( $this->exercise, new Input('app', ['program' => __DIR__ . '/../res/lint/fail.php']) diff --git a/test/ExerciseDispatcherTest.php b/test/ExerciseDispatcherTest.php index a06f2cc1..15e5fa20 100644 --- a/test/ExerciseDispatcherTest.php +++ b/test/ExerciseDispatcherTest.php @@ -113,8 +113,7 @@ public function testRequireBeforeCheckIsCorrectlyRegistered() : void ); $exerciseDispatcher->requireCheck(get_class($check)); - $checksToRunBefore = $this->readAttribute($exerciseDispatcher, 'checksToRunBefore'); - $this->assertEquals([$check], $checksToRunBefore); + $this->assertEquals([$check], $exerciseDispatcher->getChecksToRunBefore()); } public function testRequireAfterCheckIsCorrectlyRegistered() : void @@ -133,8 +132,7 @@ public function testRequireAfterCheckIsCorrectlyRegistered() : void ); $exerciseDispatcher->requireCheck(get_class($check)); - $checksToRunBefore = $this->readAttribute($exerciseDispatcher, 'checksToRunAfter'); - $this->assertEquals([$check], $checksToRunBefore); + $this->assertEquals([$check], $exerciseDispatcher->getChecksToRunAfter()); } public function testRequireCheckThrowsExceptionIfCheckIsNotSimpleOrListenable() : void diff --git a/test/Factory/EventDispatcherFactoryTest.php b/test/Factory/EventDispatcherFactoryTest.php index 31838f32..4d4b9a33 100644 --- a/test/Factory/EventDispatcherFactoryTest.php +++ b/test/Factory/EventDispatcherFactoryTest.php @@ -30,7 +30,7 @@ public function testCreateWithNoConfig() : void $dispatcher = (new EventDispatcherFactory)->__invoke($c->reveal()); $this->assertInstanceOf(EventDispatcher::class, $dispatcher); - $this->assertSame([], $this->readAttribute($dispatcher, 'listeners')); + $this->assertSame([], $dispatcher->getListeners()); } public function testExceptionIsThrownIfEventListenerGroupsNotArray() : void @@ -142,7 +142,7 @@ public function testConfigEventListenersWithAnonymousFunction() : void $callback ] ], - $this->readAttribute($dispatcher, 'listeners') + $dispatcher->getListeners() ); } @@ -164,7 +164,7 @@ public function testListenerFromContainerIsNotFetchedDuringAttaching() : void $dispatcher = (new EventDispatcherFactory)->__invoke($c->reveal()); $this->assertInstanceOf(EventDispatcher::class, $dispatcher); - $this->assertArrayHasKey('someEvent', $this->readAttribute($dispatcher, 'listeners')); + $this->assertArrayHasKey('someEvent', $dispatcher->getListeners()); $c->get('containerEntry')->shouldNotHaveBeenCalled(); } @@ -188,7 +188,7 @@ public function testListenerFromContainerIsFetchedWhenEventDispatched() : void $dispatcher = (new EventDispatcherFactory)->__invoke($c->reveal()); $this->assertInstanceOf(EventDispatcher::class, $dispatcher); - $this->assertArrayHasKey('someEvent', $this->readAttribute($dispatcher, 'listeners')); + $this->assertArrayHasKey('someEvent', $dispatcher->getListeners()); $dispatcher->dispatch(new Event('someEvent')); } @@ -227,7 +227,7 @@ public function testDefaultListenersAreRegisteredFromConfig() : void $dispatcher = (new EventDispatcherFactory)->__invoke($container); - $listeners = $this->readAttribute($dispatcher, 'listeners'); + $listeners = $dispatcher->getListeners(); $this->assertArrayHasKey('cli.verify.start', $listeners); $this->assertArrayHasKey('cli.run.start', $listeners); From e810dce151ccfed06cb36b62c672439e47dfb564 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:28:31 +0100 Subject: [PATCH 10/36] Fix getChecksToRunAfter method to return correct checks --- src/ExerciseDispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ExerciseDispatcher.php b/src/ExerciseDispatcher.php index ecf65e84..3606ba12 100644 --- a/src/ExerciseDispatcher.php +++ b/src/ExerciseDispatcher.php @@ -235,6 +235,6 @@ public function getChecksToRunBefore(): array */ public function getChecksToRunAfter(): array { - return $this->checksToRunBefore; + return $this->checksToRunAfter; } } From 6de3355a54fd4d80b314ac466f11f717691ca525 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:29:35 +0100 Subject: [PATCH 11/36] Migrate to assertFileDoesNotExist assertion --- test/Listener/PrepareSolutionListenerTest.php | 4 ++-- test/UserStateSerializerTest.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/Listener/PrepareSolutionListenerTest.php b/test/Listener/PrepareSolutionListenerTest.php index 4e954b80..c2110b2c 100644 --- a/test/Listener/PrepareSolutionListenerTest.php +++ b/test/Listener/PrepareSolutionListenerTest.php @@ -93,12 +93,12 @@ public function testIfSolutionRequiresComposerButVendorDirExistsNothingIsDone() $this->assertFileExists(sprintf('%s/vendor', dirname($this->file))); //check for non existence of lock file, composer generates this when updating if it doesn't exist - $this->assertFileNotExists(sprintf('%s/composer.lock', dirname($this->file))); + $this->assertFileDoesNotExist(sprintf('%s/composer.lock', dirname($this->file))); } public function testIfSolutionRequiresComposerComposerInstallIsExecuted() : void { - $this->assertFileNotExists(sprintf('%s/vendor', dirname($this->file))); + $this->assertFileDoesNotExist(sprintf('%s/vendor', dirname($this->file))); file_put_contents(sprintf('%s/composer.json', dirname($this->file)), json_encode([ 'requires' => [ 'phpunit/phpunit' => '~5.0' diff --git a/test/UserStateSerializerTest.php b/test/UserStateSerializerTest.php index 262e02fc..d6bd4c75 100644 --- a/test/UserStateSerializerTest.php +++ b/test/UserStateSerializerTest.php @@ -48,7 +48,7 @@ public function setUp() : void public function testIfDirNotExistsItIsCreated() : void { - $this->assertFileNotExists($this->tmpDir); + $this->assertFileDoesNotExist($this->tmpDir); new UserStateSerializer($this->tmpDir, $this->workshopName, $this->exerciseRepository); $this->assertFileExists($this->tmpDir); } @@ -229,7 +229,7 @@ public function testOldDataWillBeMigratedWhenInCorrectWorkshop() : void ], ]; - $this->assertFileNotExists($oldSave); + $this->assertFileDoesNotExist($oldSave); $this->assertFileExists($newSave); $this->assertEquals($expected, json_decode(file_get_contents($newSave), true)); } @@ -268,7 +268,7 @@ public function testOldDataWillNotBeMigratedWhenNotInCorrectWorkshop() : void $this->assertFileExists($oldSave); $this->assertEquals($oldData, json_decode(file_get_contents($oldSave), true)); - $this->assertFileNotExists($newSave); + $this->assertFileDoesNotExist($newSave); unlink($oldSave); } From 728681fdbdf314007fc6d0ae6a0f57da2d327b02 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:32:21 +0100 Subject: [PATCH 12/36] Use real eventdispatcher in tests --- test/ExerciseDispatcherTest.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/ExerciseDispatcherTest.php b/test/ExerciseDispatcherTest.php index 15e5fa20..efaac330 100644 --- a/test/ExerciseDispatcherTest.php +++ b/test/ExerciseDispatcherTest.php @@ -71,7 +71,7 @@ public function testRequireCheckThrowsExceptionIfCheckDoesNotExist() : void $exerciseDispatcher = new ExerciseDispatcher( $this->prophesize(RunnerManager::class)->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository ); $exerciseDispatcher->requireCheck('NotACheck'); @@ -88,7 +88,7 @@ public function testRequireCheckThrowsExceptionIfPositionNotValid() : void $exerciseDispatcher = new ExerciseDispatcher( $this->prophesize(RunnerManager::class)->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check]) ); @@ -108,7 +108,7 @@ public function testRequireBeforeCheckIsCorrectlyRegistered() : void $exerciseDispatcher = new ExerciseDispatcher( $this->prophesize(RunnerManager::class)->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check]) ); @@ -127,7 +127,7 @@ public function testRequireAfterCheckIsCorrectlyRegistered() : void $exerciseDispatcher = new ExerciseDispatcher( $this->prophesize(RunnerManager::class)->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check]) ); @@ -145,7 +145,7 @@ public function testRequireCheckThrowsExceptionIfCheckIsNotSimpleOrListenable() $exerciseDispatcher = new ExerciseDispatcher( $this->prophesize(RunnerManager::class)->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check]) ); @@ -190,7 +190,7 @@ public function testVerifyThrowsExceptionIfCheckDoesNotSupportExerciseType() : v $exerciseDispatcher = new ExerciseDispatcher( $runnerManager->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check]) ); @@ -220,7 +220,7 @@ public function testVerifyThrowsExceptionIfExerciseDoesNotImplementCorrectInterf $exerciseDispatcher = new ExerciseDispatcher( $runnerManager->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check]) ); @@ -253,7 +253,7 @@ public function testVerify() : void $exerciseDispatcher = new ExerciseDispatcher( $runnerManager->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check]) ); @@ -357,7 +357,7 @@ public function testVerifyWithBeforeAndAfterRequiredChecks() : void $exerciseDispatcher = new ExerciseDispatcher( $runnerManager->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository([$check1, $check2]) ); @@ -551,7 +551,7 @@ public function testRun() : void $exerciseDispatcher = new ExerciseDispatcher( $runnerManager->reveal(), new ResultAggregator, - $this->prophesize(EventDispatcher::class)->reveal(), + new EventDispatcher(new ResultAggregator()), new CheckRepository() ); From f16205350fd4e81a5b9535d13ee7fc45440ff647 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:45:09 +0100 Subject: [PATCH 13/36] Fix at() usage --- test/CommandRouterTest.php | 40 ++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/test/CommandRouterTest.php b/test/CommandRouterTest.php index c4adff1d..442af2ae 100644 --- a/test/CommandRouterTest.php +++ b/test/CommandRouterTest.php @@ -341,22 +341,32 @@ public function testRouteCommandWithOptionalArgument() : void ->setMethods(['__invoke']) ->getMock(); - $mock->expects($this->at(0)) + $mock->expects($this->exactly(3)) ->method('__invoke') - ->with($this->callback(function (Input $input) { - return $input->getAppName() === 'app' - && $input->getArgument('exercise') === 'some-exercise'; - })) - ->willReturn(true); - - $mock->expects($this->at(1)) - ->method('__invoke') - ->with($this->callback(function (Input $input) { - return $input->getAppName() === 'app' - && $input->getArgument('exercise') === 'some-exercise' - && $input->getArgument('program') === 'program.php'; - })) - ->willReturn(true); + ->withConsecutive( + [ + $this->callback(function (Input $input) { + return $input->getAppName() === 'app' + && $input->getArgument('exercise') === 'some-exercise'; + }) + ], + [ + $this->callback(function (Input $input) { + return $input->getAppName() === 'app' + && $input->getArgument('exercise') === 'some-exercise' + && $input->getArgument('program') === 'program.php'; + }) + ], + [ + $this->callback(function (Input $input) { + return $input->getAppName() === 'app' + && $input->getArgument('exercise') === 'some-exercise' + && $input->getArgument('program') === 'program.php' + && $input->getArgument('some-other-arg') === 'some-other-arg-value'; + }) + ] + ) + ->willReturnOnConsecutiveCalls(true, true); $c = $this->createMock(ContainerInterface::class); $eventDispatcher = $this->createMock(EventDispatcher::class); From b5b1643f66cacadde64e411a909717f1b1cffc8a Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 14:47:34 +0100 Subject: [PATCH 14/36] Use expectExceptionMessageMatches --- test/ExerciseRunner/CgiRunnerTest.php | 2 +- test/ExerciseRunner/CliRunnerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ExerciseRunner/CgiRunnerTest.php b/test/ExerciseRunner/CgiRunnerTest.php index 74e3c1a9..4985184e 100644 --- a/test/ExerciseRunner/CgiRunnerTest.php +++ b/test/ExerciseRunner/CgiRunnerTest.php @@ -80,7 +80,7 @@ public function testVerifyThrowsExceptionIfSolutionFailsExecution() : void $regex = "/^PHP Code failed to execute\. Error: \"PHP Parse error: syntax error, unexpected end of file in/"; $this->expectException(SolutionExecutionException::class); - $this->expectExceptionMessageRegExp($regex); + $this->expectExceptionMessageMatches($regex); $this->runner->verify(new Input('app', ['program' => ''])); } diff --git a/test/ExerciseRunner/CliRunnerTest.php b/test/ExerciseRunner/CliRunnerTest.php index 33e5f33d..b9b63ba0 100644 --- a/test/ExerciseRunner/CliRunnerTest.php +++ b/test/ExerciseRunner/CliRunnerTest.php @@ -81,7 +81,7 @@ public function testVerifyThrowsExceptionIfSolutionFailsExecution() : void $regex = "/^PHP Code failed to execute\\. Error: \"PHP Parse error: syntax error, unexpected end of file"; $regex .= ", expecting ',' or ';'/"; $this->expectException(SolutionExecutionException::class); - $this->expectExceptionMessageRegExp($regex); + $this->expectExceptionMessageMatches($regex); $this->runner->verify(new Input('app', ['program' => ''])); } From b5ab29bfd2338d13e7cd4f4ca2d1e41b22effc6d Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 15:56:19 +0100 Subject: [PATCH 15/36] Fix argument type --- test/FunctionsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/FunctionsTest.php b/test/FunctionsTest.php index b62f9202..a9ded71d 100644 --- a/test/FunctionsTest.php +++ b/test/FunctionsTest.php @@ -12,7 +12,7 @@ class FunctionsTest extends TestCase /** * @dataProvider mbStrPadProvider */ - public function testMbStrPad(string $string, string $pad, string $expected) : void + public function testMbStrPad(string $string, int $pad, string $expected) : void { self::assertSame(mb_str_pad($string, $pad), $expected); } From 2172696ac04583b8c26ef0688593b7dd0c41ad14 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 15:56:46 +0100 Subject: [PATCH 16/36] Use asset interfaces --- test/Listener/PrepareSolutionListenerTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/Listener/PrepareSolutionListenerTest.php b/test/Listener/PrepareSolutionListenerTest.php index c2110b2c..3cb90d0b 100644 --- a/test/Listener/PrepareSolutionListenerTest.php +++ b/test/Listener/PrepareSolutionListenerTest.php @@ -8,6 +8,7 @@ use PhpSchool\PhpWorkshop\Input\Input; use PhpSchool\PhpWorkshop\Listener\PrepareSolutionListener; use PhpSchool\PhpWorkshop\Solution\SolutionInterface; +use PhpSchool\PhpWorkshopTest\Asset\CliExerciseInterface; use PHPUnit\Framework\TestCase; use ReflectionProperty; use RuntimeException; @@ -52,7 +53,7 @@ public function testIfSolutionRequiresComposerButComposerCannotBeLocatedExceptio $refProp->setValue($this->listener, []); $solution = $this->createMock(SolutionInterface::class); - $exercise = $this->createMock([ExerciseInterface::class, CliExercise::class]); + $exercise = $this->createMock(CliExerciseInterface::class); $exercise ->method('getSolution') ->willReturn($solution); @@ -74,7 +75,7 @@ public function testIfSolutionRequiresComposerButVendorDirExistsNothingIsDone() $this->assertFileExists(sprintf('%s/vendor', dirname($this->file))); $solution = $this->createMock(SolutionInterface::class); - $exercise = $this->createMock([ExerciseInterface::class, CliExercise::class]); + $exercise = $this->createMock(CliExerciseInterface::class); $exercise ->method('getSolution') ->willReturn($solution); @@ -106,7 +107,7 @@ public function testIfSolutionRequiresComposerComposerInstallIsExecuted() : void ])); $solution = $this->createMock(SolutionInterface::class); - $exercise = $this->createMock([ExerciseInterface::class, CliExercise::class]); + $exercise = $this->createMock(CliExerciseInterface::class); $exercise ->method('getSolution') ->willReturn($solution); @@ -131,3 +132,4 @@ public function tearDown() : void $this->filesystem->remove(dirname($this->file)); } } + From 5b2f1094e0f8245f5146001cb224aff7f288386b Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 15:57:04 +0100 Subject: [PATCH 17/36] Fix exception assertions --- test/Factory/ResultRendererFactoryTest.php | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/test/Factory/ResultRendererFactoryTest.php b/test/Factory/ResultRendererFactoryTest.php index 5b8ab2e5..9a6ef4a0 100644 --- a/test/Factory/ResultRendererFactoryTest.php +++ b/test/Factory/ResultRendererFactoryTest.php @@ -16,11 +16,10 @@ */ class ResultRendererFactoryTest extends TestCase { - /** - * @expectedException InvalidArgumentException - */ public function testRegisterRendererRequiresResultInterface() : void { + $this->expectException(InvalidArgumentException::class); + $resultClass = get_class($this->createMock(TestCase::class)); $rendererClass = get_class($this->createMock(ResultRendererInterface::class)); $factory = new ResultRendererFactory(); @@ -28,11 +27,10 @@ public function testRegisterRendererRequiresResultInterface() : void $factory->registerRenderer($resultClass, $rendererClass); } - /** - * @expectedException InvalidArgumentException - */ public function testRegisterRendererRequiresResultRendererInterface() : void { + $this->expectException(InvalidArgumentException::class); + $resultClass = get_class($this->createMock(ResultInterface::class)); $rendererClass = get_class($this->createMock(TestCase::class)); $factory = new ResultRendererFactory(); @@ -40,11 +38,10 @@ public function testRegisterRendererRequiresResultRendererInterface() : void $factory->registerRenderer($resultClass, $rendererClass); } - /** - * @expectedException InvalidArgumentException - */ public function testRegisterRendererRequiresResultClassToBeString() : void { + $this->expectException(InvalidArgumentException::class); + $resultClass = $this->createMock(ResultInterface::class); $rendererClass = get_class($this->createMock(ResultRendererInterface::class)); $factory = new ResultRendererFactory(); @@ -52,11 +49,10 @@ public function testRegisterRendererRequiresResultClassToBeString() : void $factory->registerRenderer($resultClass, $rendererClass); } - /** - * @expectedException InvalidArgumentException - */ public function testRegisterRendererRequiresRendererClassToBeString() : void { + $this->expectException(InvalidArgumentException::class); + $resultClass = get_class($this->createMock(ResultInterface::class)); $rendererClass = $this->createMock(ResultRendererInterface::class); $factory = new ResultRendererFactory(); @@ -64,11 +60,10 @@ public function testRegisterRendererRequiresRendererClassToBeString() : void $factory->registerRenderer($resultClass, $rendererClass); } - /** - * @expectedException RuntimeException - */ public function testCreateRequiresMappingToClassName() : void { + $this->expectException(RuntimeException::class); + $resultClass = $this->createMock(ResultInterface::class); $factory = new ResultRendererFactory(); From d7df123e7fb39fa34a2b5cfbccf8268111359f0f Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 15:57:22 +0100 Subject: [PATCH 18/36] Adapt regexes for 7.4 --- test/Check/PhpLintCheckTest.php | 3 +-- test/ExerciseRunner/CliRunnerTest.php | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/Check/PhpLintCheckTest.php b/test/Check/PhpLintCheckTest.php index 25ed09f5..00cbfce4 100644 --- a/test/Check/PhpLintCheckTest.php +++ b/test/Check/PhpLintCheckTest.php @@ -46,14 +46,13 @@ public function testSuccess() : void public function testFailure() : void { - $this->markTestSkipped(); $failure = $this->check->check( $this->exercise, new Input('app', ['program' => __DIR__ . '/../res/lint/fail.php']) ); $this->assertInstanceOf(Failure::class, $failure); $this->assertMatchesRegularExpression( - "/^Parse error: syntax error, unexpected end of file, expecting ',' or ';'/", + "/^Parse error: syntax error, unexpected end of file, expecting '[,;]' or '[;,]'/", $failure->getReason() ); } diff --git a/test/ExerciseRunner/CliRunnerTest.php b/test/ExerciseRunner/CliRunnerTest.php index b9b63ba0..8d44fd9b 100644 --- a/test/ExerciseRunner/CliRunnerTest.php +++ b/test/ExerciseRunner/CliRunnerTest.php @@ -79,7 +79,7 @@ public function testVerifyThrowsExceptionIfSolutionFailsExecution() : void ->willReturn([[]]); $regex = "/^PHP Code failed to execute\\. Error: \"PHP Parse error: syntax error, unexpected end of file"; - $regex .= ", expecting ',' or ';'/"; + $regex .= ", expecting '[,;]' or '[;,]'/"; $this->expectException(SolutionExecutionException::class); $this->expectExceptionMessageMatches($regex); $this->runner->verify(new Input('app', ['program' => ''])); @@ -143,7 +143,7 @@ public function testVerifyReturnsFailureIfUserSolutionFailsToExecute() : void $failure = $this->runner->verify(new Input('app', ['program' => __DIR__ . '/../res/cli/user-error.php'])); $failureMsg = '/^PHP Code failed to execute. Error: "PHP Parse error: syntax error, '; - $failureMsg .= "unexpected end of file, expecting ',' or ';'/"; + $failureMsg .= "unexpected end of file, expecting '[,;]' or '[;,]'/"; $this->assertInstanceOf(CliResult::class, $failure); $this->assertCount(1, $failure); @@ -215,7 +215,7 @@ public function testRunPassesOutputAndReturnsFailureIfScriptFails() : void ->method('getArgs') ->willReturn([[1, 2, 3]]); - $this->expectOutputRegex('/Parse error: syntax error, unexpected end of file, expecting \',\' or \';\' /'); + $this->expectOutputRegex('/(PHP )?Parse error: syntax error, unexpected end of file, expecting \'[,;]\' or \'[;,]\' /'); $success = $this->runner->run(new Input('app', ['program' => __DIR__ . '/../res/cli/user-error.php']), $output); $this->assertFalse($success); From d0660449730d874cf23e7d3fa0df16c5a4868463 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 16:12:13 +0100 Subject: [PATCH 19/36] CS --- test/ExerciseRunner/CliRunnerTest.php | 4 +++- test/Listener/PrepareSolutionListenerTest.php | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/ExerciseRunner/CliRunnerTest.php b/test/ExerciseRunner/CliRunnerTest.php index 8d44fd9b..e385db26 100644 --- a/test/ExerciseRunner/CliRunnerTest.php +++ b/test/ExerciseRunner/CliRunnerTest.php @@ -215,7 +215,9 @@ public function testRunPassesOutputAndReturnsFailureIfScriptFails() : void ->method('getArgs') ->willReturn([[1, 2, 3]]); - $this->expectOutputRegex('/(PHP )?Parse error: syntax error, unexpected end of file, expecting \'[,;]\' or \'[;,]\' /'); + $this->expectOutputRegex( + '/(PHP )?Parse error: syntax error, unexpected end of file, expecting \'[,;]\' or \'[;,]\' /' + ); $success = $this->runner->run(new Input('app', ['program' => __DIR__ . '/../res/cli/user-error.php']), $output); $this->assertFalse($success); diff --git a/test/Listener/PrepareSolutionListenerTest.php b/test/Listener/PrepareSolutionListenerTest.php index 3cb90d0b..9cf23e16 100644 --- a/test/Listener/PrepareSolutionListenerTest.php +++ b/test/Listener/PrepareSolutionListenerTest.php @@ -132,4 +132,3 @@ public function tearDown() : void $this->filesystem->remove(dirname($this->file)); } } - From 534bf630f148262eee09fb95c74c358ba3742718 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 16:21:38 +0100 Subject: [PATCH 20/36] Remove phpspec/prophecy-phpunit on 7.2 --- .github/workflows/php-workshop.yml | 0 .travis.yml | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 .github/workflows/php-workshop.yml diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml new file mode 100644 index 00000000..e69de29b diff --git a/.travis.yml b/.travis.yml index 9ced2e72..b4e74e8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,10 @@ before_install: - composer self-update install: + - echo $TRAVIS_PHP_VERSION + - if [[ $(phpenv version-name) == '7.2' ]]; then composer update --ignore-platform-reqs ; fi + - if [[ $(phpenv version-name) == '7.2' ]]; then composer remove phpspec/prophecy-phpunit ; fi + - if [[ $(phpenv version-name) == '7.2' ]]; then composer update ; fi - composer update $COMPOSER_FLAGS --prefer-dist --optimize-autoloader before_script: From ca5d40a9cc95dcc06d1363de77719b6f059af9e3 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 16:30:39 +0100 Subject: [PATCH 21/36] try again --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b4e74e8f..a25e7e10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: install: - echo $TRAVIS_PHP_VERSION - if [[ $(phpenv version-name) == '7.2' ]]; then composer update --ignore-platform-reqs ; fi - - if [[ $(phpenv version-name) == '7.2' ]]; then composer remove phpspec/prophecy-phpunit ; fi + - if [[ $(phpenv version-name) == '7.2' ]]; then composer remove --dev phpspec/prophecy-phpunit ; fi - if [[ $(phpenv version-name) == '7.2' ]]; then composer update ; fi - composer update $COMPOSER_FLAGS --prefer-dist --optimize-autoloader From c47601f64c12eb4da6965e3aace9a1a3683bd59f Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 16:47:36 +0100 Subject: [PATCH 22/36] fix remove --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a25e7e10..b5371a28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: install: - echo $TRAVIS_PHP_VERSION - if [[ $(phpenv version-name) == '7.2' ]]; then composer update --ignore-platform-reqs ; fi - - if [[ $(phpenv version-name) == '7.2' ]]; then composer remove --dev phpspec/prophecy-phpunit ; fi + - if [[ $(phpenv version-name) == '7.2' ]]; then composer remove --dev phpspec/prophecy-phpunit --no-update-with-dependencies ; fi - if [[ $(phpenv version-name) == '7.2' ]]; then composer update ; fi - composer update $COMPOSER_FLAGS --prefer-dist --optimize-autoloader From ff76376b75f7f85c72e19d447e3e4ae347a08808 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 17:03:45 +0100 Subject: [PATCH 23/36] Try with GH actions --- .github/workflows/php-workshop.yml | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index e69de29b..d7abd613 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -0,0 +1,52 @@ +name: PhpWorkshop + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.2, 7.3, 7.4] + + name: PHP ${{ matrix.php-versions }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + + - name: Install PHP 7.2 deps + if: matrix.php == '7.4' + run: | + composer install --ignore-platform-reqs + composer remove --dev phpspec/prophecy-phpunit --no-update-with-dependencies + composer update + + - name: Install Dependencies + run: composer install --prefer-dist + + - name: Run phpunit tests + run: | + mkdir -p build/logs + vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml + + - name: Run phpcs + run: composer cs + +# - name: Run phpstan +# run: composer static + + - name: Coverage upload + if: matrix.php == '7.4' + run: bash <(curl -s https://codecov.io/bash) + From 86f3eb9c6ee7f75a65a8570df4b46e89feb24db2 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 17:06:58 +0100 Subject: [PATCH 24/36] Fix 7.2 version --- .github/workflows/php-workshop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index d7abd613..3db52d97 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -26,7 +26,7 @@ jobs: tools: composer:v2 - name: Install PHP 7.2 deps - if: matrix.php == '7.4' + if: matrix.php == '7.2' run: | composer install --ignore-platform-reqs composer remove --dev phpspec/prophecy-phpunit --no-update-with-dependencies From 4fe9b3d14de6d4e3a916f646a548df6cbd31a8be Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 17:09:50 +0100 Subject: [PATCH 25/36] Try again --- .github/workflows/php-workshop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index 3db52d97..ce0f6c22 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -29,7 +29,7 @@ jobs: if: matrix.php == '7.2' run: | composer install --ignore-platform-reqs - composer remove --dev phpspec/prophecy-phpunit --no-update-with-dependencies + composer remove --dev phpspec/prophecy-phpunit composer update - name: Install Dependencies From 6b5d2d97c7265a97672eff6a3cfc60107bc767b2 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 17:10:51 +0100 Subject: [PATCH 26/36] Add php version --- .github/workflows/php-workshop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index ce0f6c22..50ff96a3 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -14,7 +14,7 @@ jobs: matrix: php: [7.2, 7.3, 7.4] - name: PHP ${{ matrix.php-versions }} + name: PHP ${{ matrix.php }} steps: - name: Checkout uses: actions/checkout@v2 From 1d0135fc6b42b773f9f065a19f36a2e267d6af9f Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 17:13:32 +0100 Subject: [PATCH 27/36] No update on remove --- .github/workflows/php-workshop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index 50ff96a3..e7ad081c 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -29,7 +29,7 @@ jobs: if: matrix.php == '7.2' run: | composer install --ignore-platform-reqs - composer remove --dev phpspec/prophecy-phpunit + composer remove --dev phpspec/prophecy-phpunit --no-update composer update - name: Install Dependencies From b665d8d4ce1c79a9fd7e064689a480c4cf7d8d74 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 17:29:54 +0100 Subject: [PATCH 28/36] Remove trait on 7.2 --- .github/workflows/php-workshop.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index e7ad081c..400b86f5 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -25,12 +25,13 @@ jobs: php-version: ${{ matrix.php }} tools: composer:v2 - - name: Install PHP 7.2 deps + - name: Install on PHP 7.2 if: matrix.php == '7.2' run: | composer install --ignore-platform-reqs composer remove --dev phpspec/prophecy-phpunit --no-update composer update + find test -name "*.php" -exec sed -i 's/use ProphecyTrait;//g' {} \; - name: Install Dependencies run: composer install --prefer-dist From 4b551648e7eb997dc90ff19e694afde1842200db Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 19:37:55 +0100 Subject: [PATCH 29/36] Use symfony/phpunit-bridge --- .github/workflows/php-workshop.yml | 10 +- .gitignore | 1 + composer.json | 3 +- composer.lock | 2074 ++--------------- phpunit.xml | 17 +- src/Check/PhpLintCheck.php | 2 +- src/ExerciseRunner/CgiRunner.php | 4 +- src/ExerciseRunner/CliRunner.php | 9 +- src/Listener/PrepareSolutionListener.php | 2 +- test/Command/PrintCommandTest.php | 3 - test/Command/RunCommandTest.php | 3 - test/CommandRouterTest.php | 3 - test/ExerciseDispatcherTest.php | 3 - .../Factory/CgiRunnerFactoryTest.php | 3 - .../Factory/CliRunnerFactoryTest.php | 3 - .../CustomVerifyingRunnerFactoryTest.php | 3 - test/ExerciseRunner/RunnerManagerTest.php | 3 - test/Factory/EventDispatcherFactoryTest.php | 3 - .../Listener/ConfigureCommandListenerTest.php | 3 - .../Cgi/RequestFailureRendererTest.php | 3 - test/ResultRenderer/CgiResultRendererTest.php | 3 - .../Cli/RequestFailureRendererTest.php | 3 - test/ResultRenderer/CliResultRendererTest.php | 3 - .../ComparisonFailureRendererTest.php | 3 - test/ResultRenderer/FailureRendererTest.php | 6 - ...unctionRequirementsFailureRendererTest.php | 3 - test/ResultRenderer/ResultsRendererTest.php | 3 - test/UserStateSerializerTest.php | 3 - test/bootstrap.php | 3 + 29 files changed, 168 insertions(+), 2017 deletions(-) create mode 100644 test/bootstrap.php diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index 400b86f5..abca1b00 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -25,21 +25,13 @@ jobs: php-version: ${{ matrix.php }} tools: composer:v2 - - name: Install on PHP 7.2 - if: matrix.php == '7.2' - run: | - composer install --ignore-platform-reqs - composer remove --dev phpspec/prophecy-phpunit --no-update - composer update - find test -name "*.php" -exec sed -i 's/use ProphecyTrait;//g' {} \; - - name: Install Dependencies run: composer install --prefer-dist - name: Run phpunit tests run: | mkdir -p build/logs - vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml + vendor/bin/phpunit-simple --coverage-clover ./build/logs/clover.xml - name: Run phpcs run: composer cs diff --git a/.gitignore b/.gitignore index ea0fb963..2fce655d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /.idea program.php .phpunit.result.cache +/build diff --git a/composer.json b/composer.json index e330dbd3..045f58e7 100644 --- a/composer.json +++ b/composer.json @@ -33,9 +33,8 @@ }, "require-dev": { "composer/composer": "^1.2", - "phpunit/phpunit": "^8 | ^9", "squizlabs/php_codesniffer": "^3.4", - "phpspec/prophecy-phpunit": "^2.0" + "symfony/phpunit-bridge": "^5.1" }, "autoload" : { "psr-4" : { diff --git a/composer.lock b/composer.lock index 079b6fbf..b65444ed 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": "ea7bbd642807c7051586c5deb59f9cd3", + "content-hash": "0ea09ae1f35bb06e5b04906b19e16b78", "packages": [ { "name": "aydin-hassan/cli-md-renderer", @@ -1591,1898 +1591,117 @@ "time": "2020-08-19T10:27:58+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-05-29T17:27:14+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.10", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "time": "2020-05-27T16:41:55+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-06-29T13:22:24+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2020-06-27T14:33:11+00:00" - }, - { - "name": "phar-io/version", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2020-06-27T14:39:04+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-09-03T19:13:55+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-09-17T18:55:26+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.12.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", - "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0 <9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2020-09-29T09:10:42+00:00" - }, - { - "name": "phpspec/prophecy-phpunit", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy-phpunit.git", - "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/2d7a9df55f257d2cba9b1d0c0963a54960657177", - "reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8", - "phpspec/prophecy": "^1.3", - "phpunit/phpunit": "^9.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\PhpUnit\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Coevoet", - "email": "stof@notk.org" - } - ], - "description": "Integrating the Prophecy mocking library in PHPUnit test cases", - "homepage": "http://phpspec.net", - "keywords": [ - "phpunit", - "prophecy" - ], - "time": "2020-07-09T08:33:42+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/53a4b737e83be724efd2bc4e7b929b9a30c48972", - "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.8", - "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", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-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 that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-02T03:37:32+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.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": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:57:25+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "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/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "18c887016e60e52477e54534956d7b47bc52cd84" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/18c887016e60e52477e54534956d7b47bc52cd84", - "reference": "18c887016e60e52477e54534956d7b47bc52cd84", - "shasum": "" - }, - "require": { - "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": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:03:05+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/c9ff14f493699e2f6adee9fd06a0245b276643b7", - "reference": "c9ff14f493699e2f6adee9fd06a0245b276643b7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.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": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:00:25+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.4.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa", - "reference": "3866b2eeeed21b1b099c4bc0b7a1690ac6fd5baa", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "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", - "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": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/Framework/Assert/Functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-19T09:23:29+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2020-03-23T09:12:05+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", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/59236be62b1bb9919e6d7f60b0b832dc05cef9ab", - "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab", - "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", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-02T14:47:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "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" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "7a8ff306445707539c1a6397372a982a1ec55120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7a8ff306445707539c1a6397372a982a1ec55120", - "reference": "7a8ff306445707539c1a6397372a982a1ec55120", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-30T06:47:25+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ba8cc2da0c0bfbc813d03b56406734030c7f1eff", - "reference": "ba8cc2da0c0bfbc813d03b56406734030c7f1eff", - "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", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:05:03+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ffc949a1a2aae270ea064453d7535b82e4c32092" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ffc949a1a2aae270ea064453d7535b82e4c32092", - "reference": "ffc949a1a2aae270ea064453d7535b82e4c32092", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:32:55+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:52:38+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:24:23+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ea779cb749a478b22a2564ac41cd7bda79c78dc7", - "reference": "ea779cb749a478b22a2564ac41cd7bda79c78dc7", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:54:06+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/6514b8f21906b8b46f520d1fbd17a4523fa59a54", - "reference": "6514b8f21906b8b46f520d1fbd17a4523fa59a54", - "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", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:07:27+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "f6f5957013d84725427d361507e13513702888a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f6f5957013d84725427d361507e13513702888a4", - "reference": "f6f5957013d84725427d361507e13513702888a4", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:55:06+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5", - "reference": "d9d0ab3b12acb1768bc1e0a89b23c90d2043cbe5", - "shasum": "" - }, - "require": { - "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" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:56:16+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "ed8c9cd355089134bc9cba421b5cfdd58f0eaef7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/ed8c9cd355089134bc9cba421b5cfdd58f0eaef7", - "reference": "ed8c9cd355089134bc9cba421b5cfdd58f0eaef7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:17:32+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", + "name": "justinrainbow/json-schema", + "version": "5.2.10", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" }, + "bin": [ + "bin/validate-json" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "funding": [ + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" - }, - { - "name": "sebastian/type", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fa592377f3923946cb90bf1f6a71ba2e5f229909", - "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909", - "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": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, { - "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", - "funding": [ + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" } ], - "time": "2020-10-06T08:41:03+00:00" + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2020-05-27T16:41:55+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "psr/log", + "version": "1.1.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "seld/jsonlint", @@ -3794,6 +2013,88 @@ ], "time": "2020-09-02T16:23:27+00:00" }, + { + "name": "symfony/phpunit-bridge", + "version": "v5.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/phpunit-bridge.git", + "reference": "150aeb91dd9dafe13ec8416abd62e435330ca12d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/150aeb91dd9dafe13ec8416abd62e435330ca12d", + "reference": "150aeb91dd9dafe13ec8416abd62e435330ca12d", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0|<6.4,>=6.0|9.1.2" + }, + "require-dev": { + "symfony/deprecation-contracts": "^2.1" + }, + "suggest": { + "symfony/error-handler": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + }, + "bin": [ + "bin/simple-phpunit" + ], + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + }, + "thanks": { + "name": "phpunit/phpunit", + "url": "https://github.com/sebastianbergmann/phpunit" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Bridge\\PhpUnit\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony PHPUnit Bridge", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-02T12:57:56+00:00" + }, { "name": "symfony/polyfill-intl-grapheme", "version": "v1.18.1", @@ -4346,101 +2647,6 @@ } ], "time": "2020-09-15T12:23:47+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2020-07-08T17:02:28+00:00" } ], "aliases": [], diff --git a/phpunit.xml b/phpunit.xml index f798daa2..700f6fe2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,11 +1,16 @@ - - - - ./src - - + ./test + + + ./src + + + + + diff --git a/src/Check/PhpLintCheck.php b/src/Check/PhpLintCheck.php index a2cfe06c..30c0b0a1 100644 --- a/src/Check/PhpLintCheck.php +++ b/src/Check/PhpLintCheck.php @@ -34,7 +34,7 @@ public function getName() : string */ public function check(ExerciseInterface $exercise, Input $input) : ResultInterface { - $process = new Process(sprintf('%s -l %s', PHP_BINARY, $input->getArgument('program'))); + $process = new Process([PHP_BINARY, '-l', $input->getArgument('program')]); $process->run(); if ($process->isSuccessful()) { diff --git a/src/ExerciseRunner/CgiRunner.php b/src/ExerciseRunner/CgiRunner.php index 5f60914d..83bdc687 100644 --- a/src/ExerciseRunner/CgiRunner.php +++ b/src/ExerciseRunner/CgiRunner.php @@ -215,7 +215,7 @@ private function getProcess($fileName, RequestInterface $request) ]; $cgi = sprintf('php-cgi%s', DIRECTORY_SEPARATOR === '\\' ? '.exe' : ''); - $cgiBinary = sprintf( + $cgiBinary = sprintf( '%s -dalways_populate_raw_post_data=-1 -dhtml_errors=0 -dexpose_php=0', realpath(sprintf('%s/%s', str_replace('\\', '/', dirname(PHP_BINARY)), $cgi)) ); @@ -229,7 +229,7 @@ private function getProcess($fileName, RequestInterface $request) $env[sprintf('HTTP_%s', strtoupper($name))] = implode(", ", $values); } - return new Process($cmd, null, $env, null, 10); + return Process::fromShellCommandline($cmd, null, $env, null, 10); } /** diff --git a/src/ExerciseRunner/CliRunner.php b/src/ExerciseRunner/CliRunner.php index cc4b8cd3..42ff9de2 100644 --- a/src/ExerciseRunner/CliRunner.php +++ b/src/ExerciseRunner/CliRunner.php @@ -112,8 +112,13 @@ private function executePhpFile($fileName, ArrayObject $args, $type) */ private function getPhpProcess($fileName, ArrayObject $args) { - $cmd = sprintf('%s %s %s', PHP_BINARY, $fileName, $args->map('escapeshellarg')->implode(' ')); - return new Process($cmd, dirname($fileName), null, null, 10); + return new Process( + $args->prepend($fileName)->prepend(PHP_BINARY)->getArrayCopy(), + dirname($fileName), + null, + null, + 10 + ); } /** diff --git a/src/Listener/PrepareSolutionListener.php b/src/Listener/PrepareSolutionListener.php index f8f777ad..58a4aff3 100644 --- a/src/Listener/PrepareSolutionListener.php +++ b/src/Listener/PrepareSolutionListener.php @@ -38,7 +38,7 @@ public function __invoke(ExerciseRunnerEvent $event) if (!file_exists(sprintf('%s/vendor', $solution->getBaseDirectory()))) { $process = new Process( - sprintf('%s install --no-interaction', $this->locateComposer()), + [$this->locateComposer(), 'install', '--no-interaction'], $solution->getBaseDirectory() ); $process->run(); diff --git a/test/Command/PrintCommandTest.php b/test/Command/PrintCommandTest.php index beb5a7a6..8779bf4e 100644 --- a/test/Command/PrintCommandTest.php +++ b/test/Command/PrintCommandTest.php @@ -10,7 +10,6 @@ use PhpSchool\PhpWorkshop\MarkdownRenderer; use PhpSchool\PhpWorkshop\Output\OutputInterface; use PhpSchool\PhpWorkshop\UserState; -use Prophecy\PhpUnit\ProphecyTrait; /** * Class PrintCommandTest @@ -19,8 +18,6 @@ */ class PrintCommandTest extends TestCase { - use ProphecyTrait; - public function testExerciseIsPrintedIfAssigned() : void { $file = tempnam(sys_get_temp_dir(), 'pws'); diff --git a/test/Command/RunCommandTest.php b/test/Command/RunCommandTest.php index 3d6db139..272d2bd0 100644 --- a/test/Command/RunCommandTest.php +++ b/test/Command/RunCommandTest.php @@ -12,15 +12,12 @@ use PhpSchool\PhpWorkshop\UserState; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class RunCommandTest extends TestCase { - use ProphecyTrait; - public function test() : void { $input = new Input('appName', ['program' => 'solution.php']); diff --git a/test/CommandRouterTest.php b/test/CommandRouterTest.php index 442af2ae..1b2876bf 100644 --- a/test/CommandRouterTest.php +++ b/test/CommandRouterTest.php @@ -12,7 +12,6 @@ use PhpSchool\PhpWorkshop\CommandRouter; use PhpSchool\PhpWorkshop\Exception\CliRouteNotExistsException; use PhpSchool\PhpWorkshop\Exception\MissingArgumentException; -use Prophecy\PhpUnit\ProphecyTrait; use RuntimeException; /** @@ -22,8 +21,6 @@ */ class CommandRouterTest extends TestCase { - use ProphecyTrait; - public function testInvalidDefaultThrowsException() : void { $this->expectException(InvalidArgumentException::class); diff --git a/test/ExerciseDispatcherTest.php b/test/ExerciseDispatcherTest.php index efaac330..7743cbc3 100644 --- a/test/ExerciseDispatcherTest.php +++ b/test/ExerciseDispatcherTest.php @@ -23,14 +23,11 @@ use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; use Prophecy\Argument; -use Prophecy\PhpUnit\ProphecyTrait; use RuntimeException; use Symfony\Component\Filesystem\Filesystem; class ExerciseDispatcherTest extends TestCase { - use ProphecyTrait; - /** * @var Filesystem */ diff --git a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php index 6b9217be..fe9c156c 100644 --- a/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CgiRunnerFactoryTest.php @@ -11,12 +11,9 @@ use PhpSchool\PhpWorkshop\Utils\RequestRenderer; use PhpSchool\PhpWorkshopTest\Asset\CgiExerciseImpl; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; class CgiRunnerFactoryTest extends TestCase { - use ProphecyTrait; - /** * @var EventDispatcher */ diff --git a/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php index 87d27f3d..1455d164 100644 --- a/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CliRunnerFactoryTest.php @@ -10,12 +10,9 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\Factory\CliRunnerFactory; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; class CliRunnerFactoryTest extends TestCase { - use ProphecyTrait; - /** * @var EventDispatcher */ diff --git a/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php b/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php index e3a8bd44..7cc935c4 100644 --- a/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php +++ b/test/ExerciseRunner/Factory/CustomVerifyingRunnerFactoryTest.php @@ -9,12 +9,9 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\Factory\CustomVerifyingRunnerFactory; use PhpSchool\PhpWorkshopTest\Asset\CustomVerifyingExerciseImpl; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; class CustomVerifyingRunnerFactoryTest extends TestCase { - use ProphecyTrait; - /** * @var CustomVerifyingRunnerFactory */ diff --git a/test/ExerciseRunner/RunnerManagerTest.php b/test/ExerciseRunner/RunnerManagerTest.php index 020e0e99..a8fa3589 100644 --- a/test/ExerciseRunner/RunnerManagerTest.php +++ b/test/ExerciseRunner/RunnerManagerTest.php @@ -8,15 +8,12 @@ use PhpSchool\PhpWorkshop\ExerciseRunner\RunnerManager; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class RunnerManagerTest extends TestCase { - use ProphecyTrait; - public function testConfigureInputCallsCorrectFactory() : void { $exercise = new CliExerciseImpl; diff --git a/test/Factory/EventDispatcherFactoryTest.php b/test/Factory/EventDispatcherFactoryTest.php index 4d4b9a33..d261b501 100644 --- a/test/Factory/EventDispatcherFactoryTest.php +++ b/test/Factory/EventDispatcherFactoryTest.php @@ -4,7 +4,6 @@ use DI\ContainerBuilder; use PhpSchool\PhpWorkshop\Event\Event; -use Prophecy\PhpUnit\ProphecyTrait; use function PhpSchool\PhpWorkshop\Event\containerListener; use Interop\Container\ContainerInterface; use PhpSchool\PhpWorkshop\Event\EventDispatcher; @@ -20,8 +19,6 @@ */ class EventDispatcherFactoryTest extends TestCase { - use ProphecyTrait; - public function testCreateWithNoConfig() : void { $c = $this->prophesize(ContainerInterface::class); diff --git a/test/Listener/ConfigureCommandListenerTest.php b/test/Listener/ConfigureCommandListenerTest.php index 09520439..e262bfb6 100644 --- a/test/Listener/ConfigureCommandListenerTest.php +++ b/test/Listener/ConfigureCommandListenerTest.php @@ -10,15 +10,12 @@ use PhpSchool\PhpWorkshop\UserState; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class ConfigureCommandListenerTest extends TestCase { - use ProphecyTrait; - /** * @dataProvider configurableCommands */ diff --git a/test/ResultRenderer/Cgi/RequestFailureRendererTest.php b/test/ResultRenderer/Cgi/RequestFailureRendererTest.php index 00759342..c50af05b 100644 --- a/test/ResultRenderer/Cgi/RequestFailureRendererTest.php +++ b/test/ResultRenderer/Cgi/RequestFailureRendererTest.php @@ -5,7 +5,6 @@ use PhpSchool\PhpWorkshop\Result\Cgi\RequestFailure; use PhpSchool\PhpWorkshop\ResultRenderer\Cgi\RequestFailureRenderer; use PhpSchool\PhpWorkshopTest\ResultRenderer\AbstractResultRendererTest; -use Prophecy\PhpUnit\ProphecyTrait; use Zend\Diactoros\Request; /** @@ -13,8 +12,6 @@ */ class RequestFailureRendererTest extends AbstractResultRendererTest { - use ProphecyTrait; - public function testRenderWhenOnlyHeadersDifferent() : void { $failure = new RequestFailure( diff --git a/test/ResultRenderer/CgiResultRendererTest.php b/test/ResultRenderer/CgiResultRendererTest.php index 49f05492..ddcb5c19 100644 --- a/test/ResultRenderer/CgiResultRendererTest.php +++ b/test/ResultRenderer/CgiResultRendererTest.php @@ -10,7 +10,6 @@ use PhpSchool\PhpWorkshop\ResultRenderer\CgiResultRenderer; use PhpSchool\PhpWorkshop\ResultRenderer\FailureRenderer; use PhpSchool\PhpWorkshop\Utils\RequestRenderer; -use Prophecy\PhpUnit\ProphecyTrait; use Zend\Diactoros\Request; /** @@ -18,8 +17,6 @@ */ class CgiResultRendererTest extends AbstractResultRendererTest { - use ProphecyTrait; - public function testNothingIsOutputIfNoFailures() : void { $result = new CgiResult([new Success($this->request())]); diff --git a/test/ResultRenderer/Cli/RequestFailureRendererTest.php b/test/ResultRenderer/Cli/RequestFailureRendererTest.php index 42062125..79ef2360 100644 --- a/test/ResultRenderer/Cli/RequestFailureRendererTest.php +++ b/test/ResultRenderer/Cli/RequestFailureRendererTest.php @@ -6,15 +6,12 @@ use PhpSchool\PhpWorkshop\ResultRenderer\Cli\RequestFailureRenderer; use PhpSchool\PhpWorkshop\Utils\ArrayObject; use PhpSchool\PhpWorkshopTest\ResultRenderer\AbstractResultRendererTest; -use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class RequestFailureRendererTest extends AbstractResultRendererTest { - use ProphecyTrait; - public function testRender() : void { $failure = new RequestFailure(new ArrayObject, 'EXPECTED OUTPUT', 'ACTUAL OUTPUT'); diff --git a/test/ResultRenderer/CliResultRendererTest.php b/test/ResultRenderer/CliResultRendererTest.php index f668020a..ace0186c 100644 --- a/test/ResultRenderer/CliResultRendererTest.php +++ b/test/ResultRenderer/CliResultRendererTest.php @@ -8,15 +8,12 @@ use PhpSchool\PhpWorkshop\ResultRenderer\Cli\RequestFailureRenderer; use PhpSchool\PhpWorkshop\ResultRenderer\CliResultRenderer; use PhpSchool\PhpWorkshop\Utils\ArrayObject; -use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class CliResultRendererTest extends AbstractResultRendererTest { - use ProphecyTrait; - public function testNothingIsOutputIfNoFailures() : void { $result = new CliResult([new Success(new ArrayObject)]); diff --git a/test/ResultRenderer/ComparisonFailureRendererTest.php b/test/ResultRenderer/ComparisonFailureRendererTest.php index 2767562c..8b85d1ff 100644 --- a/test/ResultRenderer/ComparisonFailureRendererTest.php +++ b/test/ResultRenderer/ComparisonFailureRendererTest.php @@ -4,15 +4,12 @@ use PhpSchool\PhpWorkshop\Result\ComparisonFailure; use PhpSchool\PhpWorkshop\ResultRenderer\ComparisonFailureRenderer; -use Prophecy\PhpUnit\ProphecyTrait; /** * @author Aydin Hassan */ class ComparisonFailureRendererTest extends AbstractResultRendererTest { - use ProphecyTrait; - public function testRender() : void { $failure = new ComparisonFailure('Name', 'EXPECTED OUTPUT', 'ACTUAL OUTPUT'); diff --git a/test/ResultRenderer/FailureRendererTest.php b/test/ResultRenderer/FailureRendererTest.php index 7ba8c5ca..3721a79b 100644 --- a/test/ResultRenderer/FailureRendererTest.php +++ b/test/ResultRenderer/FailureRendererTest.php @@ -2,13 +2,9 @@ namespace PhpSchool\PhpWorkshopTest\ResultRenderer; -use Colors\Color; -use InvalidArgumentException; use PhpSchool\PhpWorkshop\Check\CheckInterface; use PhpSchool\PhpWorkshop\Result\Failure; -use PhpSchool\PhpWorkshop\Result\ResultInterface; use PhpSchool\PhpWorkshop\ResultRenderer\FailureRenderer; -use Prophecy\PhpUnit\ProphecyTrait; /** * Class FailureRendererTest @@ -17,8 +13,6 @@ */ class FailureRendererTest extends AbstractResultRendererTest { - use ProphecyTrait; - public function testRender() : void { $failure = new Failure($this->createMock(CheckInterface::class), 'Something went wrong'); diff --git a/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php b/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php index a5ccee43..53a4217e 100644 --- a/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php +++ b/test/ResultRenderer/FunctionRequirementsFailureRendererTest.php @@ -7,7 +7,6 @@ use PhpSchool\PhpWorkshop\Result\FunctionRequirementsFailure; use PhpSchool\PhpWorkshop\Result\ResultInterface; use PhpSchool\PhpWorkshop\ResultRenderer\FunctionRequirementsFailureRenderer; -use Prophecy\PhpUnit\ProphecyTrait; /** * Class FunctionRequirementsFailureRendererTest @@ -15,8 +14,6 @@ */ class FunctionRequirementsFailureRendererTest extends AbstractResultRendererTest { - use ProphecyTrait; - public function testRenderer() : void { $failure = new FunctionRequirementsFailure( diff --git a/test/ResultRenderer/ResultsRendererTest.php b/test/ResultRenderer/ResultsRendererTest.php index 69d883ee..ef341190 100644 --- a/test/ResultRenderer/ResultsRendererTest.php +++ b/test/ResultRenderer/ResultsRendererTest.php @@ -21,7 +21,6 @@ use PhpSchool\PhpWorkshop\UserState; use PHPUnit\Framework\TestCase; use Prophecy\Argument; -use Prophecy\PhpUnit\ProphecyTrait; /** * Class ResultsRendererTest @@ -30,8 +29,6 @@ */ class ResultsRendererTest extends TestCase { - use ProphecyTrait; - public function testRenderIndividualResult() : void { $color = new Color; diff --git a/test/UserStateSerializerTest.php b/test/UserStateSerializerTest.php index d6bd4c75..36dcf436 100644 --- a/test/UserStateSerializerTest.php +++ b/test/UserStateSerializerTest.php @@ -8,7 +8,6 @@ use PhpSchool\PhpWorkshop\UserStateSerializer; use PhpSchool\PhpWorkshopTest\Asset\CliExerciseInterface; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; /** * Class UserStateSerializerTest @@ -17,8 +16,6 @@ */ class UserStateSerializerTest extends TestCase { - use ProphecyTrait; - /** * @var string */ diff --git a/test/bootstrap.php b/test/bootstrap.php new file mode 100644 index 00000000..6c8c4f51 --- /dev/null +++ b/test/bootstrap.php @@ -0,0 +1,3 @@ + Date: Tue, 20 Oct 2020 19:44:40 +0100 Subject: [PATCH 30/36] Update install of install --- .github/workflows/php-workshop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index abca1b00..1bbd7548 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -26,7 +26,7 @@ jobs: tools: composer:v2 - name: Install Dependencies - run: composer install --prefer-dist + run: composer update --prefer-dist - name: Run phpunit tests run: | From b3f09ecf2eacd53dec442824b9388969d697d0ca Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 19:46:15 +0100 Subject: [PATCH 31/36] fix binary name --- .github/workflows/php-workshop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index 1bbd7548..e0a54e64 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -31,7 +31,7 @@ jobs: - name: Run phpunit tests run: | mkdir -p build/logs - vendor/bin/phpunit-simple --coverage-clover ./build/logs/clover.xml + vendor/bin/simple-phpunit --coverage-clover ./build/logs/clover.xml - name: Run phpcs run: composer cs From b4b1097bd3ed4b948c74db613afc572ff021d7e4 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 20:01:50 +0100 Subject: [PATCH 32/36] Use terminal from container --- src/Factory/MenuFactory.php | 3 ++- test/Factory/MenuFactoryTest.php | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Factory/MenuFactory.php b/src/Factory/MenuFactory.php index 07e89b7e..4b221538 100644 --- a/src/Factory/MenuFactory.php +++ b/src/Factory/MenuFactory.php @@ -3,6 +3,7 @@ namespace PhpSchool\PhpWorkshop\Factory; use PhpSchool\CliMenu\Style\SelectableStyle; +use PhpSchool\Terminal\Terminal; use Psr\Container\ContainerInterface; use PhpSchool\CliMenu\CliMenu; use PhpSchool\CliMenu\Builder\CliMenuBuilder; @@ -40,7 +41,7 @@ public function __invoke(ContainerInterface $c) $workshopType = $c->get(WorkshopType::class); $eventDispatcher = $c->get(EventDispatcher::class); - $builder = (new CliMenuBuilder) + $builder = (new CliMenuBuilder($c->get(Terminal::class))) ->addLineBreak(); if (null !== $c->get('workshopLogo')) { diff --git a/test/Factory/MenuFactoryTest.php b/test/Factory/MenuFactoryTest.php index a1359f18..01d7bf9b 100644 --- a/test/Factory/MenuFactoryTest.php +++ b/test/Factory/MenuFactoryTest.php @@ -15,6 +15,7 @@ use PhpSchool\PhpWorkshop\UserState; use PhpSchool\PhpWorkshop\UserStateSerializer; use PhpSchool\PhpWorkshop\WorkshopType; +use PhpSchool\Terminal\Terminal; use PHPUnit\Framework\TestCase; /** @@ -42,6 +43,11 @@ public function testFactoryReturnsInstance() : void ->expects($this->once()) ->method('findAll') ->willReturn([$exercise]); + + $terminal = $this->createMock(Terminal::class); + $terminal + ->method('getWidth') + ->willReturn(70); $services = [ UserStateSerializer::class => $userStateSerializer, @@ -56,6 +62,7 @@ public function testFactoryReturnsInstance() : void 'workshopTitle' => 'TITLE', WorkshopType::class => WorkshopType::STANDARD(), EventDispatcher::class => $this->createMock(EventDispatcher::class), + Terminal::class => $terminal ]; $container From d8d107e6d3bf11eae0b2b7bf0b6f8417a04fd135 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 20:12:06 +0100 Subject: [PATCH 33/36] Use error output only for linting --- src/Check/PhpLintCheck.php | 2 +- test/Check/PhpLintCheckTest.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Check/PhpLintCheck.php b/src/Check/PhpLintCheck.php index 30c0b0a1..1a6788ca 100644 --- a/src/Check/PhpLintCheck.php +++ b/src/Check/PhpLintCheck.php @@ -41,7 +41,7 @@ public function check(ExerciseInterface $exercise, Input $input) : ResultInterfa return Success::fromCheck($this); } - return Failure::fromCheckAndReason($this, trim($process->getOutput())); + return Failure::fromCheckAndReason($this, trim($process->getErrorOutput())); } /** diff --git a/test/Check/PhpLintCheckTest.php b/test/Check/PhpLintCheckTest.php index 00cbfce4..52b255ef 100644 --- a/test/Check/PhpLintCheckTest.php +++ b/test/Check/PhpLintCheckTest.php @@ -13,7 +13,6 @@ class PhpLintCheckTest extends TestCase { - /** * @var PhpLintCheck */ @@ -52,7 +51,7 @@ public function testFailure() : void ); $this->assertInstanceOf(Failure::class, $failure); $this->assertMatchesRegularExpression( - "/^Parse error: syntax error, unexpected end of file, expecting '[,;]' or '[;,]'/", + "/(PHP )?Parse error:\W+syntax error, unexpected end of file, expecting '[,;]' or '[;,]'/", $failure->getReason() ); } From 10d4272fabb400fe8c9d725535bb4cb3d5e94752 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 20:15:01 +0100 Subject: [PATCH 34/36] Fix failure regex --- test/ExerciseRunner/CliRunnerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ExerciseRunner/CliRunnerTest.php b/test/ExerciseRunner/CliRunnerTest.php index e385db26..ca35d4f9 100644 --- a/test/ExerciseRunner/CliRunnerTest.php +++ b/test/ExerciseRunner/CliRunnerTest.php @@ -216,7 +216,7 @@ public function testRunPassesOutputAndReturnsFailureIfScriptFails() : void ->willReturn([[1, 2, 3]]); $this->expectOutputRegex( - '/(PHP )?Parse error: syntax error, unexpected end of file, expecting \'[,;]\' or \'[;,]\' /' + '/(PHP )?Parse error:\W+syntax error, unexpected end of file, expecting \'[,;]\' or \'[;,]\' /' ); $success = $this->runner->run(new Input('app', ['program' => __DIR__ . '/../res/cli/user-error.php']), $output); From 0e22bfa7bc84382cbcd610c2c6a168bcd74e9fab Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 20:15:41 +0100 Subject: [PATCH 35/36] Remove fast fail --- .github/workflows/php-workshop.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/php-workshop.yml b/.github/workflows/php-workshop.yml index e0a54e64..2c17e0af 100644 --- a/.github/workflows/php-workshop.yml +++ b/.github/workflows/php-workshop.yml @@ -10,7 +10,6 @@ jobs: build: runs-on: ubuntu-latest strategy: - fail-fast: true matrix: php: [7.2, 7.3, 7.4] From 9362a5983a3005f66864c3a9d816f13357b2d094 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Tue, 20 Oct 2020 20:21:42 +0100 Subject: [PATCH 36/36] Remove travis --- .travis.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b5371a28..00000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: php - -matrix: - include: - - php: 7.2 - - php: 7.3 - - php: 7.4 - -before_install: - - composer self-update - -install: - - echo $TRAVIS_PHP_VERSION - - if [[ $(phpenv version-name) == '7.2' ]]; then composer update --ignore-platform-reqs ; fi - - if [[ $(phpenv version-name) == '7.2' ]]; then composer remove --dev phpspec/prophecy-phpunit --no-update-with-dependencies ; fi - - if [[ $(phpenv version-name) == '7.2' ]]; then composer update ; fi - - composer update $COMPOSER_FLAGS --prefer-dist --optimize-autoloader - -before_script: - - mkdir -p build/logs - -script: - - ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml - - composer cs - -after_script: - - bash <(curl -s https://codecov.io/bash) - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml