diff --git a/.github/release.yml b/.github/release.yml index b7ae9606..0fd883d5 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -8,9 +8,6 @@ changelog: - question - wontfix categories: - - title: 📖 Documentation - labels: - - documentation - title: ⚡ Breaking labels: - breaking @@ -20,12 +17,15 @@ changelog: - title: 🚑 Fixed labels: - bug - - title: ⚙️ Dependencies - labels: - - dependencies - title: 👷 Changed labels: - maintenance + - title: 📖 Documentation + labels: + - documentation + - title: ⚙️ Dependencies + labels: + - dependencies - title: Other changes labels: - "*" diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index daa4245c..b39740b4 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -36,4 +36,4 @@ jobs: path: 'docs/_build/html' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v2 diff --git a/composer.json b/composer.json index e84dbfe2..d6b54959 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "phpstan/phpstan-strict-rules": "^1.2", "phpstan/phpstan-symfony": "^1.2", "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^9.5.5", + "phpunit/phpunit": "^10.0.0", "rector/rector": "^0.15.4", "seld/jsonlint": "^1.9" }, diff --git a/composer.lock b/composer.lock index fc52e89a..fb1a2208 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": "23969d0bb73f79d0be34f087e6f85a47", + "content-hash": "93887f4a7a62c6ee2b4624ca382a52e4", "packages": [ { "name": "cocur/slugify", @@ -367,16 +367,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.4.3", + "version": "2.4.4", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "67c26b443f348a51926030c83481b85718457d3d" + "reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/67c26b443f348a51926030c83481b85718457d3d", - "reference": "67c26b443f348a51926030c83481b85718457d3d", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", + "reference": "3cf1b6d4f0c820a2cf8bcaec39fc698f3443b5cf", "shasum": "" }, "require": { @@ -466,7 +466,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.4.3" + "source": "https://github.com/guzzle/psr7/tree/2.4.4" }, "funding": [ { @@ -482,7 +482,7 @@ "type": "tidelift" } ], - "time": "2022-10-26T14:07:24+00:00" + "time": "2023-03-09T13:19:02+00:00" }, { "name": "nyholm/psr7", @@ -1322,25 +1322,25 @@ }, { "name": "symfony/cache", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "81ca309f056e836480928b20280ec52ce8369bb3" + "reference": "01a36b32f930018764bcbde006fbbe421fa6b61e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/81ca309f056e836480928b20280ec52ce8369bb3", - "reference": "81ca309f056e836480928b20280ec52ce8369bb3", + "url": "https://api.github.com/repos/symfony/cache/zipball/01a36b32f930018764bcbde006fbbe421fa6b61e", + "reference": "01a36b32f930018764bcbde006fbbe421fa6b61e", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^1.1.7|^2|^3", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/var-exporter": "^6.2.7" }, "conflict": { "doctrine/dbal": "<2.13.1", @@ -1370,6 +1370,9 @@ "psr-4": { "Symfony\\Component\\Cache\\": "" }, + "classmap": [ + "Traits/ValueWrapper.php" + ], "exclude-from-classmap": [ "/Tests/" ] @@ -1395,7 +1398,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.0.19" + "source": "https://github.com/symfony/cache/tree/v6.2.7" }, "funding": [ { @@ -1411,24 +1414,24 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:44:14+00:00" + "time": "2023-02-21T16:15:44+00:00" }, { "name": "symfony/cache-contracts", - "version": "v3.0.2", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "1c0a181c9ee221afe4fa55b2d13fc63c5ae14348" + "reference": "eeb71f04b6f7f34ca6d15633df82e014528b1632" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/1c0a181c9ee221afe4fa55b2d13fc63c5ae14348", - "reference": "1c0a181c9ee221afe4fa55b2d13fc63c5ae14348", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/eeb71f04b6f7f34ca6d15633df82e014528b1632", + "reference": "eeb71f04b6f7f34ca6d15633df82e014528b1632", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/cache": "^3.0" }, "suggest": { @@ -1437,7 +1440,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -1474,7 +1477,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/cache-contracts/tree/v3.2.1" }, "funding": [ { @@ -1490,31 +1493,30 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2023-03-01T10:32:47+00:00" }, { "name": "symfony/config", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "db4fc45c24e0c3e2198e68ada9d7f90daa1f97e3" + "reference": "249271da6f545d6579e0663374f8249a80be2893" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/db4fc45c24e0c3e2198e68ada9d7f90daa1f97e3", - "reference": "db4fc45c24e0c3e2198e68ada9d7f90daa1f97e3", + "url": "https://api.github.com/repos/symfony/config/zipball/249271da6f545d6579e0663374f8249a80be2893", + "reference": "249271da6f545d6579e0663374f8249a80be2893", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/deprecation-contracts": "^2.1|^3", "symfony/filesystem": "^5.4|^6.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php81": "^1.22" + "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<4.4" + "symfony/finder": "<5.4" }, "require-dev": { "symfony/event-dispatcher": "^5.4|^6.0", @@ -1552,7 +1554,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.0.19" + "source": "https://github.com/symfony/config/tree/v6.2.7" }, "funding": [ { @@ -1568,24 +1570,25 @@ "type": "tidelift" } ], - "time": "2023-01-09T04:36:00+00:00" + "time": "2023-02-14T08:44:56+00:00" }, { "name": "symfony/console", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed" + "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c3ebc83d031b71c39da318ca8b7a07ecc67507ed", - "reference": "c3ebc83d031b71c39da318ca8b7a07ecc67507ed", + "url": "https://api.github.com/repos/symfony/console/zipball/cbad09eb8925b6ad4fb721c7a179344dc4a19d45", + "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.4|^6.0" @@ -1647,7 +1650,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.19" + "source": "https://github.com/symfony/console/tree/v6.2.7" }, "funding": [ { @@ -1663,34 +1666,34 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2023-02-25T17:00:03+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "34302da3d0b723114484c49d0a8740422439f9c6" + "reference": "83369dd4ec84bba9673524d25b79dfbde9e6e84c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/34302da3d0b723114484c49d0a8740422439f9c6", - "reference": "34302da3d0b723114484c49d0a8740422439f9c6", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/83369dd4ec84bba9673524d25b79dfbde9e6e84c", + "reference": "83369dd4ec84bba9673524d25b79dfbde9e6e84c", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php81": "^1.22", - "symfony/service-contracts": "^1.1.6|^2.0|^3.0" + "symfony/service-contracts": "^1.1.6|^2.0|^3.0", + "symfony/var-exporter": "^6.2.7" }, "conflict": { "ext-psr": "<1.1|>=2", - "symfony/config": "<5.4", + "symfony/config": "<6.1", "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<5.4", + "symfony/proxy-manager-bridge": "<6.2", "symfony/yaml": "<5.4" }, "provide": { @@ -1698,7 +1701,7 @@ "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^5.4|^6.0", + "symfony/config": "^6.1", "symfony/expression-language": "^5.4|^6.0", "symfony/yaml": "^5.4|^6.0" }, @@ -1706,7 +1709,6 @@ "symfony/config": "", "symfony/expression-language": "For using expressions in service container configuration", "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, "type": "library", @@ -1735,7 +1737,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.0.19" + "source": "https://github.com/symfony/dependency-injection/tree/v6.2.7" }, "funding": [ { @@ -1751,7 +1753,7 @@ "type": "tidelift" } ], - "time": "2023-01-23T15:49:22+00:00" + "time": "2023-02-16T14:11:02+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1822,20 +1824,20 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a" + "reference": "404b307de426c1c488e5afad64403e5f145e82a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", - "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/404b307de426c1c488e5afad64403e5f145e82a5", + "reference": "404b307de426c1c488e5afad64403e5f145e82a5", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/event-dispatcher-contracts": "^2|^3" }, "conflict": { @@ -1885,7 +1887,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.7" }, "funding": [ { @@ -1901,24 +1903,24 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2023-02-14T08:44:56+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.0.2", + "version": "v3.2.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" + "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, "suggest": { @@ -1927,7 +1929,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -1964,7 +1966,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" }, "funding": [ { @@ -1980,24 +1982,24 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2023-03-01T10:32:47+00:00" }, { "name": "symfony/expression-language", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "d912aa436eeed66ae369a2b8a247249bed8f9a03" + "reference": "83e1fee4c018aa60bcbbecd585a2c54af6aca905" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/d912aa436eeed66ae369a2b8a247249bed8f9a03", - "reference": "d912aa436eeed66ae369a2b8a247249bed8f9a03", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/83e1fee4c018aa60bcbbecd585a2c54af6aca905", + "reference": "83e1fee4c018aa60bcbbecd585a2c54af6aca905", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/cache": "^5.4|^6.0", "symfony/service-contracts": "^1.1|^2|^3" }, @@ -2027,7 +2029,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v6.0.19" + "source": "https://github.com/symfony/expression-language/tree/v6.2.7" }, "funding": [ { @@ -2043,24 +2045,24 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:44:14+00:00" + "time": "2023-02-16T09:57:23+00:00" }, { "name": "symfony/filesystem", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214" + "reference": "82b6c62b959f642d000456f08c6d219d749215b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3d49eec03fda1f0fc19b7349fbbe55ebc1004214", - "reference": "3d49eec03fda1f0fc19b7349fbbe55ebc1004214", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3", + "reference": "82b6c62b959f642d000456f08c6d219d749215b3", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, @@ -2090,7 +2092,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.0.19" + "source": "https://github.com/symfony/filesystem/tree/v6.2.7" }, "funding": [ { @@ -2106,24 +2108,27 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:44:14+00:00" + "time": "2023-02-14T08:44:56+00:00" }, { "name": "symfony/finder", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11" + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/5cc9cac6586fc0c28cd173780ca696e419fefa11", - "reference": "5cc9cac6586fc0c28cd173780ca696e419fefa11", + "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0" }, "type": "library", "autoload": { @@ -2151,7 +2156,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.0.19" + "source": "https://github.com/symfony/finder/tree/v6.2.7" }, "funding": [ { @@ -2167,7 +2172,7 @@ "type": "tidelift" } ], - "time": "2023-01-20T17:44:14+00:00" + "time": "2023-02-16T09:57:23+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2499,85 +2504,6 @@ ], "time": "2022-11-03T14:55:06+00:00" }, - { - "name": "symfony/polyfill-php81", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "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 polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" - }, - "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": "2022-11-03T14:55:06+00:00" - }, { "name": "symfony/service-contracts", "version": "v3.2.1", @@ -2665,20 +2591,20 @@ }, { "name": "symfony/string", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" + "reference": "67b8c1eec78296b85dc1c7d9743830160218993d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", + "url": "https://api.github.com/repos/symfony/string/zipball/67b8c1eec78296b85dc1c7d9743830160218993d", + "reference": "67b8c1eec78296b85dc1c7d9743830160218993d", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -2690,6 +2616,7 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -2730,7 +2657,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.19" + "source": "https://github.com/symfony/string/tree/v6.2.7" }, "funding": [ { @@ -2746,24 +2673,24 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2023-02-24T10:42:00+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2" + "reference": "86062dd0103530e151588c8f60f5b85a139f1442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", - "reference": "df56f53818c2d5d9f683f4ad2e365ba73a3b69d2", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/86062dd0103530e151588c8f60f5b85a139f1442", + "reference": "86062dd0103530e151588c8f60f5b85a139f1442", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "require-dev": { "symfony/var-dumper": "^5.4|^6.0" @@ -2799,10 +2726,12 @@ "export", "hydrate", "instantiate", + "lazy loading", + "proxy", "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.0.19" + "source": "https://github.com/symfony/var-exporter/tree/v6.2.7" }, "funding": [ { @@ -2818,24 +2747,24 @@ "type": "tidelift" } ], - "time": "2023-01-13T08:34:10+00:00" + "time": "2023-02-24T10:42:00+00:00" }, { "name": "symfony/yaml", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884" + "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/deec3a812a0305a50db8ae689b183f43d915c884", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e8e6a1d59e050525f27a1f530aa9703423cb7f57", + "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -2876,7 +2805,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.0.19" + "source": "https://github.com/symfony/yaml/tree/v6.2.7" }, "funding": [ { @@ -2892,7 +2821,7 @@ "type": "tidelift" } ], - "time": "2023-01-11T11:50:03+00:00" + "time": "2023-02-16T09:57:23+00:00" }, { "name": "twig/twig", @@ -3239,16 +3168,16 @@ }, { "name": "composer/composer", - "version": "2.5.1", + "version": "2.5.5", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "923278ad13e1621946eb76ab2882655d2cc396a4" + "reference": "c7cffaad16a60636a776017eac5bd8cd0095c32f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/923278ad13e1621946eb76ab2882655d2cc396a4", - "reference": "923278ad13e1621946eb76ab2882655d2cc396a4", + "url": "https://api.github.com/repos/composer/composer/zipball/c7cffaad16a60636a776017eac5bd8cd0095c32f", + "reference": "c7cffaad16a60636a776017eac5bd8cd0095c32f", "shasum": "" }, "require": { @@ -3332,7 +3261,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.5.1" + "source": "https://github.com/composer/composer/tree/2.5.5" }, "funding": [ { @@ -3348,7 +3277,7 @@ "type": "tidelift" } ], - "time": "2022-12-22T14:33:54+00:00" + "time": "2023-03-21T10:50:05+00:00" }, { "name": "composer/metadata-minifier", @@ -3793,76 +3722,6 @@ }, "time": "2023-02-02T22:02:53+00:00" }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "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": "https://ocramius.github.io/" - } - ], - "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" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "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": "2022-12-30T00:23:10+00:00" - }, { "name": "doctrine/lexer", "version": "3.0.0", @@ -4940,16 +4799,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.10.9", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "9b13dafe3d66693d20fe5729c3dde1d31bb64703" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b13dafe3d66693d20fe5729c3dde1d31bb64703", + "reference": "9b13dafe3d66693d20fe5729c3dde1d31bb64703", "shasum": "" }, "require": { @@ -4978,8 +4837,11 @@ "static analysis" ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.14" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -4995,25 +4857,25 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-03-30T08:58:01+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "2c6792eda026d9c474c14aa018aed312686714db" + "reference": "a22b36b955a2e9a3d39fe533b6c1bb5359f9c319" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/2c6792eda026d9c474c14aa018aed312686714db", - "reference": "2c6792eda026d9c474c14aa018aed312686714db", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/a22b36b955a2e9a3d39fe533b6c1bb5359f9c319", + "reference": "a22b36b955a2e9a3d39fe533b6c1bb5359f9c319", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.3" + "phpstan/phpstan": "^1.10" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -5041,27 +4903,27 @@ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.1" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.3" }, - "time": "2022-12-13T14:26:20+00:00" + "time": "2023-03-17T07:50:08+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.3", + "version": "1.3.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7" + "reference": "9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/54a24bd23e9e80ee918cdc24f909d376c2e273f7", - "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c", + "reference": "9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.3" + "phpstan/phpstan": "^1.10" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -5093,31 +4955,32 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.3" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.11" }, - "time": "2022-12-21T15:25:00+00:00" + "time": "2023-03-25T19:42:13+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.4.5", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "361f75b06066f3fdaba87c1f57bdb1ffc28d6f1d" + "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/361f75b06066f3fdaba87c1f57bdb1ffc28d6f1d", - "reference": "361f75b06066f3fdaba87c1f57bdb1ffc28d6f1d", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b21c03d4f6f3a446e4311155f4be9d65048218e6", + "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.7" + "phpstan/phpstan": "^1.10" }, "require-dev": { "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-phpunit": "^1.0", "phpunit/phpunit": "^9.5" }, @@ -5141,28 +5004,28 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.4.5" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.1" }, - "time": "2023-01-11T14:16:29+00:00" + "time": "2023-03-29T14:47:40+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.2.20", + "version": "1.2.24", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "d89a521e7e31822409bf37f70691f7a12a6e7d76" + "reference": "db81b1861aac7cc2e66115cb33b4d1ea2a73d096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/d89a521e7e31822409bf37f70691f7a12a6e7d76", - "reference": "d89a521e7e31822409bf37f70691f7a12a6e7d76", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/db81b1861aac7cc2e66115cb33b4d1ea2a73d096", + "reference": "db81b1861aac7cc2e66115cb33b4d1ea2a73d096", "shasum": "" }, "require": { "ext-simplexml": "*", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.1" + "phpstan/phpstan": "^1.9.18" }, "conflict": { "symfony/framework-bundle": "<3.0" @@ -5172,7 +5035,7 @@ "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^8.5.29 || ^9.5", "psr/container": "1.0 || 1.1.1", "symfony/config": "^5.4 || ^6.1", "symfony/console": "^5.4 || ^6.1", @@ -5212,31 +5075,32 @@ "description": "Symfony Framework extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.20" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.24" }, - "time": "2023-01-15T12:28:31+00:00" + "time": "2023-03-30T08:38:10+00:00" }, { "name": "phpstan/phpstan-webmozart-assert", - "version": "1.2.2", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-webmozart-assert.git", - "reference": "01259f5c85d175cbd380d91789ed80602c870ce9" + "reference": "d1ff28697bd4e1c9ef5d3f871367ce9092871fec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-webmozart-assert/zipball/01259f5c85d175cbd380d91789ed80602c870ce9", - "reference": "01259f5c85d175cbd380d91789ed80602c870ce9", + "url": "https://api.github.com/repos/phpstan/phpstan-webmozart-assert/zipball/d1ff28697bd4e1c9ef5d3f871367ce9092871fec", + "reference": "d1ff28697bd4e1c9ef5d3f871367ce9092871fec", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.0" + "phpstan/phpstan": "^1.10" }, "require-dev": { "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-strict-rules": "^1.0", "phpunit/phpunit": "^9.5", @@ -5262,22 +5126,22 @@ "description": "PHPStan webmozart/assert extension", "support": { "issues": "https://github.com/phpstan/phpstan-webmozart-assert/issues", - "source": "https://github.com/phpstan/phpstan-webmozart-assert/tree/1.2.2" + "source": "https://github.com/phpstan/phpstan-webmozart-assert/tree/1.2.4" }, - "time": "2022-11-03T15:12:25+00:00" + "time": "2023-02-21T20:34:19+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "10.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4", + "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4", "shasum": "" }, "require": { @@ -5285,18 +5149,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -5305,7 +5169,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.0-dev" } }, "autoload": { @@ -5333,7 +5197,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2" }, "funding": [ { @@ -5341,32 +5205,32 @@ "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-03-06T13:00:19+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -5393,7 +5257,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" }, "funding": [ { @@ -5401,28 +5265,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-02-10T16:53:14+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -5430,7 +5294,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -5456,7 +5320,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -5464,32 +5328,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -5515,7 +5379,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" }, "funding": [ { @@ -5523,32 +5387,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-02-03T06:56:46+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -5574,7 +5438,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -5582,24 +5446,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.5", + "version": "10.0.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" + "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/20c23e85c86e5c06d63538ba464e8054f4744e62", + "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -5609,27 +5472,26 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "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.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.0", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.0", + "sebastian/global-state": "^6.0", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -5637,7 +5499,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.0-dev" } }, "autoload": { @@ -5668,7 +5530,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.19" }, "funding": [ { @@ -5684,7 +5547,7 @@ "type": "tidelift" } ], - "time": "2023-03-09T06:34:10+00:00" + "time": "2023-03-27T11:46:33+00:00" }, { "name": "react/promise", @@ -5764,21 +5627,21 @@ }, { "name": "rector/rector", - "version": "0.15.17", + "version": "0.15.23", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "7f6ee7974175138864d3b50c28ea73a7b0fd4e2d" + "reference": "f4984ebd62b3613002869b0ddd6868261d62819e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/7f6ee7974175138864d3b50c28ea73a7b0fd4e2d", - "reference": "7f6ee7974175138864d3b50c28ea73a7b0fd4e2d", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/f4984ebd62b3613002869b0ddd6868261d62819e", + "reference": "f4984ebd62b3613002869b0ddd6868261d62819e", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.9.14" + "phpstan/phpstan": "^1.10.1" }, "conflict": { "rector/rector-doctrine": "*", @@ -5805,9 +5668,15 @@ "MIT" ], "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.17" + "source": "https://github.com/rectorphp/rector/tree/0.15.23" }, "funding": [ { @@ -5815,32 +5684,32 @@ "type": "github" } ], - "time": "2023-02-17T20:34:07+00:00" + "time": "2023-03-22T15:22:45+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -5863,7 +5732,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" }, "funding": [ { @@ -5871,32 +5740,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2023-02-03T06:58:15+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -5919,7 +5788,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -5927,32 +5796,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -5974,7 +5843,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -5982,34 +5851,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -6048,7 +5919,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" }, "funding": [ { @@ -6056,33 +5927,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2023-02-03T07:07:16+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -6105,7 +5976,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" }, "funding": [ { @@ -6113,33 +5984,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-02-03T06:59:47+00:00" }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -6171,7 +6042,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" }, "funding": [ { @@ -6179,27 +6051,27 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-03-23T05:12:41+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc", + "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -6207,7 +6079,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6226,7 +6098,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -6234,7 +6106,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0" }, "funding": [ { @@ -6242,34 +6114,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2023-02-03T07:03:04+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -6311,7 +6183,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" }, "funding": [ { @@ -6319,38 +6191,35 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2023-02-03T07:06:49+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "aab257c712de87b90194febd52e4d184551c2d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", + "reference": "aab257c712de87b90194febd52e4d184551c2d44", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6375,7 +6244,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.0" }, "funding": [ { @@ -6383,33 +6252,33 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-02-03T07:07:38+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -6432,7 +6301,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" }, "funding": [ { @@ -6440,34 +6309,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-02-03T07:08:02+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -6489,7 +6358,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -6497,32 +6366,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -6544,7 +6413,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -6552,32 +6421,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -6607,7 +6476,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -6615,87 +6484,32 @@ "type": "github" } ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "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" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -6718,7 +6532,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -6726,29 +6540,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -6771,7 +6585,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -6779,7 +6593,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "seld/jsonlint", @@ -6956,20 +6770,20 @@ }, { "name": "symfony/mime", - "version": "v6.0.19", + "version": "v6.2.7", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "d7052547a0070cbeadd474e172b527a00d657301" + "reference": "62e341f80699badb0ad70b31149c8df89a2d778e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/d7052547a0070cbeadd474e172b527a00d657301", - "reference": "d7052547a0070cbeadd474e172b527a00d657301", + "url": "https://api.github.com/repos/symfony/mime/zipball/62e341f80699badb0ad70b31149c8df89a2d778e", + "reference": "62e341f80699badb0ad70b31149c8df89a2d778e", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0" }, @@ -6978,15 +6792,16 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<5.4", - "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6" + "symfony/serializer": "<6.2" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", + "league/html-to-markdown": "^5.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", "symfony/dependency-injection": "^5.4|^6.0", "symfony/property-access": "^5.4|^6.0", "symfony/property-info": "^5.4|^6.0", - "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6" + "symfony/serializer": "^6.2" }, "type": "library", "autoload": { @@ -7018,7 +6833,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.0.19" + "source": "https://github.com/symfony/mime/tree/v6.2.7" }, "funding": [ { @@ -7034,7 +6849,7 @@ "type": "tidelift" } ], - "time": "2023-01-11T11:50:03+00:00" + "time": "2023-02-24T10:42:00+00:00" }, { "name": "symfony/options-resolver", @@ -7428,6 +7243,85 @@ ], "time": "2022-11-03T14:55:06+00:00" }, + { + "name": "symfony/polyfill-php81", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "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 polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + }, + "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": "2022-11-03T14:55:06+00:00" + }, { "name": "symfony/process", "version": "v6.2.7", diff --git a/docs/conf.py b/docs/conf.py index f8256b13..8ec1e024 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ project = "Project Builder" copyright = "since 2022 by coding. powerful. systems. CPS GmbH" author = "Elias Häußler, Martin Adler" -release = "1.7.4" +release = "2.0.1" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -32,7 +32,6 @@ html_static_path = ["_static"] html_css_files = [ "css/sidebar.css" -# "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" ] # -- Options for HTML output ------------------------------------------------- diff --git a/docs/getting-started.md b/docs/getting-started.md index 221390d1..2b52215e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -25,7 +25,7 @@ It requires Composer and PHP to be installed on your computer. If you don't have them installed, you can still use the alternative method with Docker. -```{button-ref} usage/composer.md +```{button-ref} usage/composer :ref-type: myst :color: light :expand: @@ -57,7 +57,7 @@ installed or if any of the installed versions are outdated. The only requirement with this method is a local Docker installation. -```{button-ref} usage/docker.md +```{button-ref} usage/docker :ref-type: myst :color: primary :outline: diff --git a/rector.php b/rector.php index b3099f4b..fbe5665a 100644 --- a/rector.php +++ b/rector.php @@ -24,6 +24,8 @@ use Rector\Config\RectorConfig; use Rector\Core\ValueObject\PhpVersion; use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector; +use Rector\Php80\Rector\Class_\AnnotationToAttributeRector; +use Rector\PHPUnit\Set\PHPUnitLevelSetList; use Rector\Set\ValueObject\LevelSetList; return static function (RectorConfig $rectorConfig): void { @@ -37,11 +39,23 @@ __DIR__.'/tests/src/Fixtures/Templates/*/vendor/*', AddLiteralSeparatorToNumberRector::class, + AnnotationToAttributeRector::class => [ + __DIR__.'/src/Bootstrap.php', + __DIR__.'/src/Builder/Config/ConfigFactory.php', + __DIR__.'/src/Console/Simulation.php', + __DIR__.'/src/DependencyInjection/CompilerPass/ContainerBuilderDebugDumpPass.php', + __DIR__.'/src/DependencyInjection/CompilerPass/EventListenerPass.php', + __DIR__.'/src/DependencyInjection/CompilerPass/FactoryServicesPass.php', + __DIR__.'/src/DependencyInjection/CompilerPass/PublicServicePass.php', + __DIR__.'/src/DependencyInjection/ContainerFactory.php', + __DIR__.'/src/ProjectBuilderPlugin.php', + ], ]); $rectorConfig->phpVersion(PhpVersion::PHP_81); $rectorConfig->sets([ LevelSetList::UP_TO_PHP_81, + PHPUnitLevelSetList::UP_TO_PHPUNIT_100, ]); }; diff --git a/resources/config.schema.json b/resources/config.schema.json index 13e65176..57c35431 100644 --- a/resources/config.schema.json +++ b/resources/config.schema.json @@ -3,6 +3,10 @@ "type": "object", "title": "Project builder template configuration", "properties": { + "$schema": { + "type": "string", + "title": "Public URL to this JSON schema file" + }, "name": { "type": "string", "title": "Project template name", diff --git a/src/Builder/Config/ConfigFactory.php b/src/Builder/Config/ConfigFactory.php index 3b145502..8ce77ba7 100644 --- a/src/Builder/Config/ConfigFactory.php +++ b/src/Builder/Config/ConfigFactory.php @@ -132,6 +132,9 @@ private function generateMapperSource(string $content, string $identifier, FileT // Enforce custom identifier $parsedContent['identifier'] = $identifier; + // Unset $schema property + unset($parsedContent['$schema']); + return Mapper\Source\Source::array($parsedContent); } @@ -146,6 +149,9 @@ private function parseContent(string $content, FileType $fileType): stdClass throw Exception\InvalidConfigurationException::forSource($content); } + // Unset $schema property + unset($parsedContent->{'$schema'}); + return $parsedContent; } diff --git a/src/Exception/MisconfiguredValidatorException.php b/src/Exception/MisconfiguredValidatorException.php index f321dc35..17d25046 100644 --- a/src/Exception/MisconfiguredValidatorException.php +++ b/src/Exception/MisconfiguredValidatorException.php @@ -26,6 +26,9 @@ use CPSIT\ProjectBuilder\IO; use Exception; +use function array_pop; +use function count; +use function implode; use function sprintf; /** @@ -49,4 +52,32 @@ public static function forUnexpectedOption( 1673886742, ); } + + /** + * @param list $options + */ + public static function forUnexpectedOptions( + string|IO\Validator\ValidatorInterface $validator, + array $options, + ): self { + if (1 === count($options)) { + return self::forUnexpectedOption($validator, $options[0]); + } + + if ($validator instanceof IO\Validator\ValidatorInterface) { + $validator = $validator::getType(); + } + + $lastOption = array_pop($options); + + return new self( + sprintf( + 'The validator options "%s" and "%s" of validator "%s" are invalid.', + implode('", "', $options), + $lastOption, + $validator, + ), + 1679253412, + ); + } } diff --git a/src/IO/Messenger.php b/src/IO/Messenger.php index 9d9174c9..fd62b1c6 100644 --- a/src/IO/Messenger.php +++ b/src/IO/Messenger.php @@ -84,10 +84,16 @@ public function clearLine(): void public function welcome(): void { $this->getIO()->write([ - ''.Emoji::Sparkles->value.' Welcome to the Project Builder!', + ''.Emoji::Sparkles->value.' Welcome to the Project Builder!', '==================================', + '', + 'The Project Builder helps you create Composer based projects with templates.', + 'A template holds project/framework related information such as Composer dependencies and configuration.', ]); $this->newLine(); + $this->comment('You may find templates on public and private providers/registries such as Satis, GitLab or GitHub.'); + $this->comment('Let\'s start by looking for templates on Packagist.org:'); + $this->newLine(); } public function section(string $name): void @@ -159,12 +165,12 @@ public function selectTemplateSource(Template\Provider\ProviderInterface $provid } $labels = array_map($this->decorateTemplateSource(...), $templateSources); - $labels[] = 'Try another template provider.'; + $labels[] = 'Try a different provider (e.g. Satis or GitHub)'; $defaultIdentifier = array_key_first($templateSources); $index = $this->getIO()->select( - self::decorateLabel('Select a project template', $defaultIdentifier), + self::decorateLabel('Select a project template or try a different provider', $defaultIdentifier), $labels, (string) $defaultIdentifier, ); @@ -439,7 +445,7 @@ private function decorateTemplateSource(Template\TemplateSource $templateSource) return $name; } - return sprintf('%s (%s)', $description, $name); + return sprintf('%s (%s)', $description, $name); } /** diff --git a/src/IO/Validator/AbstractValidator.php b/src/IO/Validator/AbstractValidator.php index 7f6e253b..36283106 100644 --- a/src/IO/Validator/AbstractValidator.php +++ b/src/IO/Validator/AbstractValidator.php @@ -23,6 +23,8 @@ namespace CPSIT\ProjectBuilder\IO\Validator; +use CPSIT\ProjectBuilder\Exception; + /** * AbstractValidator. * @@ -45,10 +47,19 @@ abstract class AbstractValidator implements ValidatorInterface /** * @param array $options + * + * @throws Exception\MisconfiguredValidatorException */ public function __construct( array $options = [], ) { + $invalidOptions = array_diff_key($options, static::$defaultOptions); + + if ([] !== $invalidOptions) { + throw Exception\MisconfiguredValidatorException::forUnexpectedOptions($this, array_keys($invalidOptions)); + } + + /* @phpstan-ignore-next-line */ $this->options = [...static::$defaultOptions, ...$options]; } } diff --git a/src/IO/Validator/ValidatorFactory.php b/src/IO/Validator/ValidatorFactory.php index 4bb3f987..91ab5cef 100644 --- a/src/IO/Validator/ValidatorFactory.php +++ b/src/IO/Validator/ValidatorFactory.php @@ -44,7 +44,7 @@ public function __construct( public function get(Builder\Config\ValueObject\PropertyValidator $validator): ValidatorInterface { - /** @var ValidatorInterface $currentValidator */ + /** @var class-string $currentValidator */ foreach ($this->validators as $currentValidator) { if (!$currentValidator::supports($validator->getType())) { continue; diff --git a/src/Template/Provider/BaseProvider.php b/src/Template/Provider/BaseProvider.php index a46af95a..1c86d46a 100644 --- a/src/Template/Provider/BaseProvider.php +++ b/src/Template/Provider/BaseProvider.php @@ -177,8 +177,24 @@ protected function requestPackageVersionConstraint(Template\TemplateSource $temp $inputReader = $this->messenger->createInputReader(); $repository = $templateSource->getPackage()->getRepository() ?? $this->createRepository(); + $this->messenger->writeWithEmoji( + IO\Emoji::WhiteHeavyCheckMark->value, + sprintf('Well done! You\'ve selected %s.', $templateSource->getPackage()->getName()), + ); + + $this->messenger->newLine(); + $this->messenger->write( + sprintf('Do you require a specific version of %s?', $templateSource->getPackage()->getName()), + ); + $this->messenger->comment( + 'If so, you may specify it here. Leave it empty and we\'ll find a current version for you.', + ); + $this->messenger->newLine(); + $this->messenger->comment('Example: 2.1.0 or dev-feature/xyz'); + $this->messenger->newLine(); + $constraint = $inputReader->staticValue( - 'Enter the version constraint to require (or leave blank to use the latest version)', + 'Enter the version constraint to require: ', validator: new IO\Validator\CallbackValidator([ 'callback' => $this->validateConstraint(...), ]), diff --git a/src/Template/Provider/ComposerProvider.php b/src/Template/Provider/ComposerProvider.php index a52a95dd..1f2c22a5 100644 --- a/src/Template/Provider/ComposerProvider.php +++ b/src/Template/Provider/ComposerProvider.php @@ -62,7 +62,7 @@ public function requestCustomOptions(IO\Messenger $messenger): void $inputReader = $messenger->createInputReader(); $this->url = $inputReader->staticValue( - 'Base URL', + 'Composer Base URL (e.g. https://composer.example.com)', required: true, validator: new IO\Validator\ChainedValidator([ new IO\Validator\NotEmptyValidator(), @@ -92,7 +92,7 @@ protected function getRepositoryType(): string public static function getName(): string { - return 'Custom Composer registry'; + return 'Custom Composer registry (e.g. Satis)'; } public static function getType(): string diff --git a/src/Template/Provider/VcsProvider.php b/src/Template/Provider/VcsProvider.php index ec56f281..adf39a35 100644 --- a/src/Template/Provider/VcsProvider.php +++ b/src/Template/Provider/VcsProvider.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder\Exception; use CPSIT\ProjectBuilder\IO; +use CPSIT\ProjectBuilder\Template; /** * VcsProvider. @@ -47,16 +48,34 @@ public function requestCustomOptions(IO\Messenger $messenger): void { $inputReader = $messenger->createInputReader(); - $this->url = $inputReader->staticValue('Repository URL', required: true); - - while ($inputReader->ask('Does the repository require additional transitive repositories?', default: false)) { - $this->repositories[] = [ - 'type' => $inputReader->staticValue('Type', 'vcs', true), - 'url' => $inputReader->staticValue('URL', required: true), - ]; + $this->url = $inputReader->staticValue( + 'Repository URL (e.g. https://github.com/vendor/template.git)', + required: true, + ); + } - $messenger->writeWithEmoji(IO\Emoji::WhiteHeavyCheckMark->value, 'Repository added.'); - $messenger->newLine(); + public function installTemplateSource(Template\TemplateSource $templateSource): void + { + try { + parent::installTemplateSource($templateSource); + } catch (Exception\InvalidTemplateSourceException $exception) { + // If additional repositories were already added, installation is obviously not possible + if ([] !== $this->repositories) { + throw $exception; + } + + // Ask for additional repositories to resolve probable installation failures + $this->messenger->newLine(); + $this->messenger->error(sprintf('Unable to install %s.', $templateSource->getPackage()->getName())); + $this->askForAdditionalRepositories(); + + // Fail with original exception if no additional repositories were added + if ([] === $this->repositories) { + throw $exception; + } + + // Retry installation with additional repositories + $this->installTemplateSource($templateSource); } } @@ -74,6 +93,26 @@ public function setUrl(string $url): void $this->url = $url; } + private function askForAdditionalRepositories(): void + { + $inputReader = $this->messenger->createInputReader(); + + $this->messenger->newLine(); + $this->messenger->comment('Some VCS repositories require additional transitive packages.'); + $this->messenger->comment('If no additional packages are required, the selected package probably cannot be used.'); + $this->messenger->newLine(); + + while ($inputReader->ask('Are additional transitive packages required?', default: false)) { + $this->repositories[] = [ + 'type' => $inputReader->staticValue('Package type', 'vcs', true), + 'url' => $inputReader->staticValue('Package URL', required: true), + ]; + + $this->messenger->writeWithEmoji(IO\Emoji::WhiteHeavyCheckMark->value, 'Package added.'); + $this->messenger->newLine(); + } + } + protected function createComposerJson(array $templateSources, array $repositories = []): string { $repositories = [...$repositories, ...$this->repositories]; @@ -88,7 +127,7 @@ protected function getRepositoryType(): string public static function getName(): string { - return 'VCS repository'; + return 'VCS repository (e.g. GitHub)'; } public static function getType(): string diff --git a/tests/src/Builder/BuildInstructionsTest.php b/tests/src/Builder/BuildInstructionsTest.php index c83a815b..35b8dc19 100644 --- a/tests/src/Builder/BuildInstructionsTest.php +++ b/tests/src/Builder/BuildInstructionsTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use function dirname; use function sys_get_temp_dir; @@ -47,60 +48,48 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getConfigReturnsConfig(): void { self::assertSame(self::$container->get('app.config'), $this->subject->getConfig()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTemplateDirectoryReturnsTemplateDirectory(): void { self::assertSame(dirname(__DIR__), $this->subject->getTemplateDirectory()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getSourceDirectoryReturnsSourceDirectory(): void { self::assertSame(dirname(__DIR__).'/templates/src', $this->subject->getSourceDirectory()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getSharedSourceDirectoryReturnsSharedSourceDirectory(): void { self::assertSame(dirname(__DIR__).'/templates/shared', $this->subject->getSharedSourceDirectory()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { + $prefix = sys_get_temp_dir(); $actual = $this->subject->getTemporaryDirectory(); + self::assertNotEmpty($prefix); self::assertDirectoryDoesNotExist($actual); - self::assertStringStartsWith(sys_get_temp_dir(), $actual); + self::assertStringStartsWith($prefix, $actual); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTargetDirectoryReturnsTargetDirectory(): void { self::assertSame('foo', $this->subject->getTargetDirectory()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTemplateVariablesReturnsTemplateVariables(): void { self::assertSame([], $this->subject->getTemplateVariables()); @@ -110,9 +99,7 @@ public function getTemplateVariablesReturnsTemplateVariables(): void self::assertSame(['foo' => 'bar'], $this->subject->getTemplateVariables()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTemplateVariableReturnsTemplateVariableAtGivenPath(): void { self::assertNull($this->subject->getTemplateVariable('foo.bar.hello')); @@ -126,9 +113,7 @@ public function getTemplateVariableReturnsTemplateVariableAtGivenPath(): void self::assertSame('world!', $this->subject->getTemplateVariable('foo.bar.hello')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function addTemplateVariableSetsTemplateVariableAtGivenPath(): void { self::assertNull($this->subject->getTemplateVariable('foo.bar.hello')); diff --git a/tests/src/Builder/BuildResultTest.php b/tests/src/Builder/BuildResultTest.php index 07a92639..7ea81f93 100644 --- a/tests/src/Builder/BuildResultTest.php +++ b/tests/src/Builder/BuildResultTest.php @@ -26,6 +26,7 @@ use Composer\Package; use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Finder; use function basename; @@ -51,26 +52,20 @@ protected function setUp(): void $this->subject = new Src\Builder\BuildResult($this->instructions); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getInstructionsReturnsInstructions(): void { self::assertSame($this->instructions, $this->subject->getInstructions()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isMirroredReturnsMirrorState(): void { self::assertFalse($this->subject->isMirrored()); self::assertTrue($this->subject->setMirrored(true)->isMirrored()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getBuildArtifactReturnsBuildArtifact(): void { self::assertNull($this->subject->getBuildArtifact()); @@ -84,9 +79,7 @@ public function getBuildArtifactReturnsBuildArtifact(): void self::assertSame($buildArtifact, $this->subject->setBuildArtifact($buildArtifact)->getBuildArtifact()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getAppliedStepsReturnsAppliedSteps(): void { $step = new Tests\Fixtures\DummyStep(); @@ -98,9 +91,7 @@ public function getAppliedStepsReturnsAppliedSteps(): void self::assertSame([$step::getType() => $step], $this->subject->getAppliedSteps()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isStepAppliedTestsWhetherStepIsApplied(): void { $step = new Tests\Fixtures\DummyStep(); @@ -117,9 +108,7 @@ public function isStepAppliedTestsWhetherStepIsApplied(): void )); } - /** - * @test - */ + #[Framework\Attributes\Test] public function applyStepAddsStepToAppliedSteps(): void { $step = new Tests\Fixtures\DummyStep(); @@ -131,9 +120,7 @@ public function applyStepAddsStepToAppliedSteps(): void self::assertTrue($this->subject->isStepApplied($step)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getProcessedFilesReturnsProcessedFiles(): void { self::assertSame([], $this->subject->getProcessedFiles()); @@ -151,17 +138,13 @@ public function getProcessedFilesReturnsProcessedFiles(): void self::assertSame([$barFile], $this->subject->getProcessedFiles('/bar')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getWrittenDirectoryReturnsTemporaryDirectoryIfBuildWasNotMirrored(): void { self::assertSame($this->instructions->getTemporaryDirectory(), $this->subject->getWrittenDirectory()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getWrittenDirectoryReturnsTargetDirectoryIfBuildWasMirrored(): void { $this->subject->setMirrored(true); diff --git a/tests/src/Builder/Config/ConfigFactoryTest.php b/tests/src/Builder/Config/ConfigFactoryTest.php index 40e13254..a2bcbf3a 100644 --- a/tests/src/Builder/Config/ConfigFactoryTest.php +++ b/tests/src/Builder/Config/ConfigFactoryTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use function dirname; use function ucfirst; @@ -35,7 +35,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ConfigFactoryTest extends TestCase +final class ConfigFactoryTest extends Framework\TestCase { private Src\Builder\Config\ConfigFactory $subject; @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = Src\Builder\Config\ConfigFactory::create(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function buildFromFileThrowsExceptionIfFileContentsAreInvalid(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -55,9 +53,7 @@ public function buildFromFileThrowsExceptionIfFileContentsAreInvalid(): void $this->subject->buildFromFile(dirname(__DIR__, 2).'/Fixtures/Files/invalid-config.yaml', 'foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function buildFromFileReturnsHydratedConfigObject(): void { $createConfig = fn (string $type): Src\Builder\Config\Config => new Src\Builder\Config\Config( @@ -136,9 +132,7 @@ public function buildFromFileReturnsHydratedConfigObject(): void } } - /** - * @test - */ + #[Framework\Attributes\Test] public function buildFromStringThrowsExceptionIfGivenContentIsInvalid(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); diff --git a/tests/src/Builder/Config/ConfigReaderTest.php b/tests/src/Builder/Config/ConfigReaderTest.php index 5f1b2a2e..17694f1c 100644 --- a/tests/src/Builder/Config/ConfigReaderTest.php +++ b/tests/src/Builder/Config/ConfigReaderTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use function dirname; @@ -34,7 +34,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ConfigReaderTest extends TestCase +final class ConfigReaderTest extends Framework\TestCase { private Src\Builder\Config\ConfigReader $subject; @@ -45,9 +45,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createCreatesTemplateDirectoryIfItDoesNotExist(): void { $templateDirectory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -59,9 +57,7 @@ public function createCreatesTemplateDirectoryIfItDoesNotExist(): void self::assertDirectoryExists($templateDirectory); } - /** - * @test - */ + #[Framework\Attributes\Test] public function readConfigThrowsExceptionIfTemplateHasNoComposerJson(): void { $templateDirectory = dirname(__DIR__, 2).'/Fixtures'; @@ -74,9 +70,7 @@ public function readConfigThrowsExceptionIfTemplateHasNoComposerJson(): void $subject->readConfig('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function readConfigThrowsExceptionIfTemplateWithGivenIdentifierDoesNotExist(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -86,9 +80,7 @@ public function readConfigThrowsExceptionIfTemplateWithGivenIdentifierDoesNotExi $this->subject->readConfig('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function readConfigThrowsExceptionIfTemplateContainsMultipleConfigFiles(): void { $subject = Src\Builder\Config\ConfigReader::create( @@ -102,9 +94,7 @@ public function readConfigThrowsExceptionIfTemplateContainsMultipleConfigFiles() $subject->readConfig('cpsit/project-builder-template-invalid'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function readConfigReturnsHydratedConfigObject(): void { $actual = $this->subject->readConfig('cpsit/project-builder-template-yaml'); @@ -116,9 +106,7 @@ public function readConfigReturnsHydratedConfigObject(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function hasConfigChecksWhetherConfigWithGivenIdentifierExists(): void { self::assertTrue($this->subject->hasConfig('cpsit/project-builder-template-json')); @@ -126,9 +114,7 @@ public function hasConfigChecksWhetherConfigWithGivenIdentifierExists(): void self::assertFalse($this->subject->hasConfig('foo')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function listTemplateListsAllAvailableTemplates(): void { $expected = [ diff --git a/tests/src/Builder/Config/ConfigTest.php b/tests/src/Builder/Config/ConfigTest.php index 6d3d09af..1aed7cc7 100644 --- a/tests/src/Builder/Config/ConfigTest.php +++ b/tests/src/Builder/Config/ConfigTest.php @@ -25,7 +25,7 @@ use Composer\Package; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use function serialize; @@ -35,7 +35,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ConfigTest extends TestCase +final class ConfigTest extends Framework\TestCase { private Src\Builder\Config\Config $subject; @@ -53,25 +53,19 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getIdentifierReturnsIdentifier(): void { self::assertSame('identifier', $this->subject->getIdentifier()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getNameReturnsName(): void { self::assertSame('name', $this->subject->getName()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getStepsReturnsSteps(): void { self::assertEquals( @@ -82,9 +76,7 @@ public function getStepsReturnsSteps(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPropertiesReturnsProperties(): void { self::assertEquals( @@ -95,9 +87,7 @@ public function getPropertiesReturnsProperties(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getDeclaringFileThrowsExceptionIfDeclaringFileIsNotSet(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -107,17 +97,13 @@ public function getDeclaringFileThrowsExceptionIfDeclaringFileIsNotSet(): void $this->subject->getDeclaringFile(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setDeclaringFileAppliesDeclaringFile(): void { self::assertSame('foo', $this->subject->setDeclaringFile('foo')->getDeclaringFile()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTemplateSourceThrowsExceptionIfTemplateSourceIsNotSet(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -127,9 +113,7 @@ public function getTemplateSourceThrowsExceptionIfTemplateSourceIsNotSet(): void $this->subject->getTemplateSource(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setTemplateSourceAppliesTemplateSource(): void { $templateSource = new Src\Template\TemplateSource( @@ -140,9 +124,7 @@ public function setTemplateSourceAppliesTemplateSource(): void self::assertSame($templateSource, $this->subject->setTemplateSource($templateSource)->getTemplateSource()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function buildHashCalculatesConfigHash(): void { $hash = sha1( diff --git a/tests/src/Builder/Config/FileTypeTest.php b/tests/src/Builder/Config/FileTypeTest.php index 42edb1b8..f13dfc10 100644 --- a/tests/src/Builder/Config/FileTypeTest.php +++ b/tests/src/Builder/Config/FileTypeTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * FileTypeTest. @@ -33,11 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class FileTypeTest extends TestCase +final class FileTypeTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function fromExtensionThrowsExceptionIfGivenExtensionIsNotSupported(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -47,11 +45,8 @@ public function fromExtensionThrowsExceptionIfGivenExtensionIsNotSupported(): vo Src\Builder\Config\FileType::fromExtension('php'); } - /** - * @test - * - * @dataProvider fromExtensionReturnsFileTypeOfGivenExtensionDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('fromExtensionReturnsFileTypeOfGivenExtensionDataProvider')] public function fromExtensionReturnsFileTypeOfGivenExtension( string $extension, Src\Builder\Config\FileType $expected, @@ -59,9 +54,7 @@ public function fromExtensionReturnsFileTypeOfGivenExtension( self::assertSame($expected, Src\Builder\Config\FileType::fromExtension($extension)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function fromFileThrowsExceptionIfExtensionOfGivenFileIsNotSupported(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -71,11 +64,8 @@ public function fromFileThrowsExceptionIfExtensionOfGivenFileIsNotSupported(): v Src\Builder\Config\FileType::fromFile(__FILE__); } - /** - * @test - * - * @dataProvider fromFileReturnsFileTypeOfGivenFileDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('fromFileReturnsFileTypeOfGivenFileDataProvider')] public function fromFileReturnsFileTypeOfGivenFile( string $file, Src\Builder\Config\FileType $expected, @@ -86,7 +76,7 @@ public function fromFileReturnsFileTypeOfGivenFile( /** * @return Generator */ - public function fromExtensionReturnsFileTypeOfGivenExtensionDataProvider(): Generator + public static function fromExtensionReturnsFileTypeOfGivenExtensionDataProvider(): Generator { yield 'json' => ['json', Src\Builder\Config\FileType::Json]; yield 'yml' => ['yml', Src\Builder\Config\FileType::Yaml]; @@ -96,7 +86,7 @@ public function fromExtensionReturnsFileTypeOfGivenExtensionDataProvider(): Gene /** * @return Generator */ - public function fromFileReturnsFileTypeOfGivenFileDataProvider(): Generator + public static function fromFileReturnsFileTypeOfGivenFileDataProvider(): Generator { yield 'json' => ['foo.json', Src\Builder\Config\FileType::Json]; yield 'yml' => ['foo.yml', Src\Builder\Config\FileType::Yaml]; diff --git a/tests/src/Builder/Config/ValueObject/FileConditionTest.php b/tests/src/Builder/Config/ValueObject/FileConditionTest.php index 14236657..5445db02 100644 --- a/tests/src/Builder/Config/ValueObject/FileConditionTest.php +++ b/tests/src/Builder/Config/ValueObject/FileConditionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config\ValueObject; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use Symfony\Component\ExpressionLanguage; /** @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class FileConditionTest extends TestCase +final class FileConditionTest extends Framework\TestCase { private Src\Builder\Config\ValueObject\FileCondition $subject; @@ -42,33 +42,25 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\FileCondition('foo', 'bar', 'target'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('foo', $this->subject->getPath()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getConditionReturnsCondition(): void { self::assertSame('bar', $this->subject->getCondition()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function hasConditionReturnsTrue(): void { self::assertTrue($this->subject->hasCondition()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function conditionMatchesChecksIfConditionMatches(): void { $expressionLanguage = new ExpressionLanguage\ExpressionLanguage(); @@ -77,9 +69,7 @@ public function conditionMatchesChecksIfConditionMatches(): void self::assertTrue($this->subject->conditionMatches($expressionLanguage, ['bar' => true])); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTargetReturnsTarget(): void { self::assertSame('target', $this->subject->getTarget()); diff --git a/tests/src/Builder/Config/ValueObject/PropertyOptionTest.php b/tests/src/Builder/Config/ValueObject/PropertyOptionTest.php index fbf4b959..dccc1ee4 100644 --- a/tests/src/Builder/Config/ValueObject/PropertyOptionTest.php +++ b/tests/src/Builder/Config/ValueObject/PropertyOptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config\ValueObject; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use Symfony\Component\ExpressionLanguage; /** @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class PropertyOptionTest extends TestCase +final class PropertyOptionTest extends Framework\TestCase { private Src\Builder\Config\ValueObject\PropertyOption $subject; @@ -42,17 +42,13 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\PropertyOption('foo', 'bar'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getValueReturnsValue(): void { self::assertSame('foo', $this->subject->getValue()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function conditionMatchesReturnsDefaultIfNoConditionIsSet(): void { $expressionLanguage = new ExpressionLanguage\ExpressionLanguage(); diff --git a/tests/src/Builder/Config/ValueObject/PropertyTest.php b/tests/src/Builder/Config/ValueObject/PropertyTest.php index d4dcc62a..1351e50b 100644 --- a/tests/src/Builder/Config/ValueObject/PropertyTest.php +++ b/tests/src/Builder/Config/ValueObject/PropertyTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config\ValueObject; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * PropertyTest. @@ -32,7 +32,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class PropertyTest extends TestCase +final class PropertyTest extends Framework\TestCase { private Src\Builder\Config\ValueObject\Property $subject; @@ -54,9 +54,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getSubPropertiesReturnsSubProperties(): void { self::assertEquals( @@ -71,9 +69,7 @@ public function getSubPropertiesReturnsSubProperties(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function hasSubPropertiesChecksWhetherPropertyHasSubProperties(): void { self::assertTrue($this->subject->hasSubProperties()); @@ -83,25 +79,19 @@ public function hasSubPropertiesChecksWhetherPropertyHasSubProperties(): void self::assertFalse($subject->hasSubProperties()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getIdentifierReturnsIdentifier(): void { self::assertSame('identifier', $this->subject->getIdentifier()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('path', $this->subject->getPath()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPathFallsBackToIdentifierIfPathIsNotSet(): void { $subject = new Src\Builder\Config\ValueObject\Property('identifier', 'name'); @@ -109,25 +99,19 @@ public function getPathFallsBackToIdentifierIfPathIsNotSet(): void self::assertSame('identifier', $subject->getPath()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getNameReturnsName(): void { self::assertSame('name', $this->subject->getName()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getValueReturnsValue(): void { self::assertSame('value', $this->subject->getValue()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function hasValueChecksIfPropertyHasValue(): void { self::assertTrue($this->subject->hasValue()); diff --git a/tests/src/Builder/Config/ValueObject/PropertyValidatorTest.php b/tests/src/Builder/Config/ValueObject/PropertyValidatorTest.php index f706c2e0..d9c67f45 100644 --- a/tests/src/Builder/Config/ValueObject/PropertyValidatorTest.php +++ b/tests/src/Builder/Config/ValueObject/PropertyValidatorTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config\ValueObject; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * PropertyValidatorTest. @@ -32,7 +32,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class PropertyValidatorTest extends TestCase +final class PropertyValidatorTest extends Framework\TestCase { private Src\Builder\Config\ValueObject\PropertyValidator $subject; @@ -41,17 +41,13 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\PropertyValidator('foo', ['bar' => 'bar']); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getOptionsReturnsOptions(): void { self::assertSame(['bar' => 'bar'], $this->subject->getOptions()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTypeReturnsType(): void { self::assertSame('foo', $this->subject->getType()); diff --git a/tests/src/Builder/Config/ValueObject/StepOptionsTest.php b/tests/src/Builder/Config/ValueObject/StepOptionsTest.php index e8452348..846628a2 100644 --- a/tests/src/Builder/Config/ValueObject/StepOptionsTest.php +++ b/tests/src/Builder/Config/ValueObject/StepOptionsTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config\ValueObject; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * StepOptionsTest. @@ -32,7 +32,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class StepOptionsTest extends TestCase +final class StepOptionsTest extends Framework\TestCase { private Src\Builder\Config\ValueObject\StepOptions $subject; @@ -47,9 +47,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getFileConditionsReturnsFileConditions(): void { self::assertEquals( @@ -60,17 +58,13 @@ public function getFileConditionsReturnsFileConditions(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTemplateFileReturnsTemplateFile(): void { self::assertSame('foo', $this->subject->getTemplateFile()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getArtifactPathReturnsArtifactPath(): void { self::assertSame('artifact.json', $this->subject->getArtifactPath()); diff --git a/tests/src/Builder/Config/ValueObject/StepTest.php b/tests/src/Builder/Config/ValueObject/StepTest.php index feafd4ab..f14f6c72 100644 --- a/tests/src/Builder/Config/ValueObject/StepTest.php +++ b/tests/src/Builder/Config/ValueObject/StepTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config\ValueObject; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * StepTest. @@ -32,7 +32,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class StepTest extends TestCase +final class StepTest extends Framework\TestCase { private Src\Builder\Config\ValueObject\Step $subject; @@ -44,9 +44,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getOptionsReturnsOptions(): void { self::assertEquals( diff --git a/tests/src/Builder/Config/ValueObject/SubPropertyTest.php b/tests/src/Builder/Config/ValueObject/SubPropertyTest.php index e8e209e5..246f72c0 100644 --- a/tests/src/Builder/Config/ValueObject/SubPropertyTest.php +++ b/tests/src/Builder/Config/ValueObject/SubPropertyTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Builder\Config\ValueObject; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * SubPropertyTest. @@ -32,7 +32,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class SubPropertyTest extends TestCase +final class SubPropertyTest extends Framework\TestCase { private Src\Builder\Config\ValueObject\SubProperty $subject; @@ -57,17 +57,13 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('path', $this->subject->getPath()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPathConstructsPathFromIdentifierAndParentProperty(): void { $subject = new Src\Builder\Config\ValueObject\SubProperty( @@ -80,9 +76,7 @@ public function getPathConstructsPathFromIdentifierAndParentProperty(): void self::assertSame('parent-identifier.identifier', $subject->getPath()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getOptionsReturnsOptions(): void { self::assertEquals( @@ -93,25 +87,19 @@ public function getOptionsReturnsOptions(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function canHaveMultipleValuesReturnsTrue(): void { self::assertTrue($this->subject->canHaveMultipleValues()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getDefaultValueReturnsDefaultValue(): void { self::assertSame('defaultValue', $this->subject->getDefaultValue()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getValidatorsReturnsValidators(): void { self::assertEquals( @@ -122,9 +110,7 @@ public function getValidatorsReturnsValidators(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isRequiredChecksIfNotEmptyValidatorIsSet(): void { self::assertFalse($this->subject->isRequired()); @@ -141,9 +127,7 @@ public function isRequiredChecksIfNotEmptyValidatorIsSet(): void self::assertTrue($subject->isRequired()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getParentReturnsParentProperty(): void { self::assertEquals( @@ -152,9 +136,7 @@ public function getParentReturnsParentProperty(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setParentAppliesParentProperty(): void { $newParent = new Src\Builder\Config\ValueObject\Property('new-parent', 'name'); diff --git a/tests/src/Builder/Generator/GeneratorTest.php b/tests/src/Builder/Generator/GeneratorTest.php index 2336cb18..f36dfe37 100644 --- a/tests/src/Builder/Generator/GeneratorTest.php +++ b/tests/src/Builder/Generator/GeneratorTest.php @@ -26,6 +26,7 @@ use Composer\Package; use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\EventDispatcher; use Symfony\Component\Filesystem; @@ -54,9 +55,7 @@ protected function setUp(): void $this->targetDirectory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runRunsThroughAllConfiguredSteps(): void { self::$io->setUserInputs(['foo']); @@ -93,9 +92,7 @@ public function runRunsThroughAllConfiguredSteps(): void self::assertInstanceOf(Src\Event\ProjectBuildFinishedEvent::class, $this->eventListener->dispatchedEvents[6]); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runRevertsAppliedStepsOnStepFailure(): void { $listener = function (Src\Event\ProjectBuildStartedEvent $event): void { @@ -149,9 +146,7 @@ public function runRevertsAppliedStepsOnStepFailure(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runRevertsAppliedStepsAndExistsIfStoppableStepFailed(): void { $config = new Src\Builder\Config\Config( @@ -181,9 +176,7 @@ public function runRevertsAppliedStepsAndExistsIfStoppableStepFailed(): void self::assertFalse($actual->isMirrored()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function dumpArtifactDumpsBuildArtifact(): void { self::$io->setUserInputs(['foo']); @@ -195,9 +188,7 @@ public function dumpArtifactDumpsBuildArtifact(): void self::assertTrue($result->isStepApplied('dumpBuildArtifact')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function cleanUpCleansUpRemainingFilesInTargetDirectory(): void { self::$io->setUserInputs(['foo']); diff --git a/tests/src/Builder/Generator/Step/AbstractStepTest.php b/tests/src/Builder/Generator/Step/AbstractStepTest.php index 05082bf6..7b7179af 100644 --- a/tests/src/Builder/Generator/Step/AbstractStepTest.php +++ b/tests/src/Builder/Generator/Step/AbstractStepTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * AbstractStepTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class AbstractStepTest extends TestCase +final class AbstractStepTest extends Framework\TestCase { private Tests\Fixtures\DummyStep $subject; @@ -42,9 +42,7 @@ protected function setUp(): void $this->subject = new Tests\Fixtures\DummyStep(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setConfigAppliesGivenConfig(): void { $config = new Src\Builder\Config\ValueObject\Step('dummy'); diff --git a/tests/src/Builder/Generator/Step/CleanUpStepTest.php b/tests/src/Builder/Generator/Step/CleanUpStepTest.php index e6349c77..ce19b0e2 100644 --- a/tests/src/Builder/Generator/Step/CleanUpStepTest.php +++ b/tests/src/Builder/Generator/Step/CleanUpStepTest.php @@ -26,6 +26,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use LogicException; +use PHPUnit\Framework; use Symfony\Component\Filesystem; /** @@ -52,9 +53,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runCleansUpRemainingFilesInTargetDirectory(): void { $targetDirectory = $this->result->getInstructions()->getTargetDirectory(); @@ -72,9 +71,7 @@ public function runCleansUpRemainingFilesInTargetDirectory(): void self::assertTrue($this->result->isStepApplied('cleanUp')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function revertThrowsException(): void { $this->expectException(LogicException::class); @@ -84,9 +81,7 @@ public function revertThrowsException(): void $this->subject->revert($this->result); } - /** - * @test - */ + #[Framework\Attributes\Test] public function supportsReturnsFalse(): void { self::assertFalse($this->subject::supports('foo')); diff --git a/tests/src/Builder/Generator/Step/CollectBuildInstructionsStepTest.php b/tests/src/Builder/Generator/Step/CollectBuildInstructionsStepTest.php index 30872868..6a62f3d7 100644 --- a/tests/src/Builder/Generator/Step/CollectBuildInstructionsStepTest.php +++ b/tests/src/Builder/Generator/Step/CollectBuildInstructionsStepTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * CollectBuildInstructionsStepTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\CollectBuildInstructionsStep::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runAppliesNullAsDefaultValueOnSkippedProperties(): void { $config = new Src\Builder\Config\Config( @@ -73,9 +72,7 @@ public function runAppliesNullAsDefaultValueOnSkippedProperties(): void self::assertNull($buildResult->getInstructions()->getTemplateVariable('foo')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runAppliesNullAsDefaultValueOnSkippedSubProperties(): void { $config = new Src\Builder\Config\Config( diff --git a/tests/src/Builder/Generator/Step/DumpBuildArtifactStepTest.php b/tests/src/Builder/Generator/Step/DumpBuildArtifactStepTest.php index 90b86fdd..66e9113c 100644 --- a/tests/src/Builder/Generator/Step/DumpBuildArtifactStepTest.php +++ b/tests/src/Builder/Generator/Step/DumpBuildArtifactStepTest.php @@ -26,6 +26,7 @@ use Composer\Package; use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Filesystem; use function json_encode; @@ -60,9 +61,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runDoesNothingIfBuildArtifactWasNotGenerated(): void { self::assertTrue($this->subject->run($this->buildResult)); @@ -70,9 +69,7 @@ public function runDoesNothingIfBuildArtifactWasNotGenerated(): void self::assertFileDoesNotExist($this->buildArtifact->getFile()->getPathname()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runDumpsBuildArtifact(): void { $this->buildResult->setBuildArtifact($this->buildArtifact); @@ -86,9 +83,7 @@ public function runDumpsBuildArtifact(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function revertDoesNothingIfBuildArtifactWasNotGenerated(): void { $artifactPath = $this->buildArtifact->getFile()->getPathname(); @@ -104,9 +99,7 @@ public function revertDoesNothingIfBuildArtifactWasNotGenerated(): void self::assertStringEqualsFile($artifactPath, 'test'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function revertRemovesDumpedBuildArtifact(): void { $artifactPath = $this->buildArtifact->getFile()->getPathname(); @@ -124,9 +117,7 @@ public function revertRemovesDumpedBuildArtifact(): void self::assertFileDoesNotExist($artifactPath); } - /** - * @test - */ + #[Framework\Attributes\Test] public function supportsReturnsFalse(): void { self::assertFalse($this->subject::supports('foo')); diff --git a/tests/src/Builder/Generator/Step/GenerateBuildArtifactStepTest.php b/tests/src/Builder/Generator/Step/GenerateBuildArtifactStepTest.php index 9da614e8..8edb41b8 100644 --- a/tests/src/Builder/Generator/Step/GenerateBuildArtifactStepTest.php +++ b/tests/src/Builder/Generator/Step/GenerateBuildArtifactStepTest.php @@ -26,6 +26,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use Generator; +use PHPUnit\Framework; use Symfony\Component\Filesystem; /** @@ -54,11 +55,8 @@ protected function setUp(): void ); } - /** - * @test - * - * @dataProvider runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider')] public function runAsksForConfirmationIfBuildArtifactPathAlreadyExists(bool $continue, bool $expected): void { self::$io->setUserInputs([$continue ? 'yes' : 'no']); @@ -76,9 +74,7 @@ public function runAsksForConfirmationIfBuildArtifactPathAlreadyExists(bool $con ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runGeneratesBuildArtifact(): void { self::assertTrue($this->subject->run($this->buildResult)); @@ -89,7 +85,7 @@ public function runGeneratesBuildArtifact(): void /** * @return Generator */ - public function runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider(): Generator + public static function runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider(): Generator { yield 'continue' => [true, true]; yield 'do not continue' => [false, false]; diff --git a/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php b/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php index 2ee60a16..ccd50f7e 100644 --- a/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php +++ b/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Filesystem; use Symfony\Component\Finder; @@ -52,18 +53,14 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runInstallsComposerDependencies(): void { self::assertTrue($this->subject->run($this->buildResult)); self::assertTrue($this->buildResult->isStepApplied($this->subject)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runWritesComposerInstallOutputAndFailsOnFailure(): void { $newConfig = self::createConfig(); diff --git a/tests/src/Builder/Generator/Step/Interaction/InteractionFactoryTest.php b/tests/src/Builder/Generator/Step/Interaction/InteractionFactoryTest.php index 37618992..9a43e6cc 100644 --- a/tests/src/Builder/Generator/Step/Interaction/InteractionFactoryTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/InteractionFactoryTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * InteractionFactoryTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\Interaction\InteractionFactory::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -53,9 +52,7 @@ public function getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable(): void $this->subject->get('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getReturnsInteractionOfGivenType(): void { self::assertInstanceOf( diff --git a/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php b/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php index 7f31ef40..2d069761 100644 --- a/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * QuestionInteractionTest. @@ -43,9 +44,7 @@ protected function setUp(): void $this->instructions = new Src\Builder\BuildInstructions(self::$config, 'foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactUsesTruAndFalseAsDefaultYesNoValues(): void { $interactionSubject = $this->buildInteractionSubject(); @@ -56,9 +55,7 @@ public function interactUsesTruAndFalseAsDefaultYesNoValues(): void self::assertFalse($this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactReturnsValueFromMatchingOption(): void { $interactionSubject = $this->buildInteractionSubject([ @@ -72,9 +69,7 @@ public function interactReturnsValueFromMatchingOption(): void self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactUsesFallbackConditionIfOnlyOptionValueIsConfigured(): void { $interactionSubject = $this->buildInteractionSubject([ @@ -89,9 +84,8 @@ public function interactUsesFallbackConditionIfOnlyOptionValueIsConfigured(): vo /** * @param list $options - * @param int|float|string|bool|null $defaultValue */ - private function buildInteractionSubject(array $options = [], $defaultValue = null): Src\Builder\Config\ValueObject\CustomizableInterface + private function buildInteractionSubject(array $options = []): Src\Builder\Config\ValueObject\CustomizableInterface { return new Src\Builder\Config\ValueObject\SubProperty( 'foo', @@ -102,7 +96,6 @@ private function buildInteractionSubject(array $options = [], $defaultValue = nu null, $options, false, - $defaultValue, ); } } diff --git a/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php b/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php index 6fb8f4b8..17182fff 100644 --- a/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * SelectInteractionTest. @@ -43,9 +44,7 @@ protected function setUp(): void $this->instructions = new Src\Builder\BuildInstructions(self::$config, 'foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactReturnsNullOnEmptyUserInput(): void { $interactionSubject = $this->buildInteractionSubject(); @@ -53,9 +52,7 @@ public function interactReturnsNullOnEmptyUserInput(): void self::assertNull($this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection(): void { $propertyOptions = [ @@ -67,9 +64,7 @@ public function interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection() self::assertSame('foo', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection(): void { $propertyOptions = [ @@ -81,9 +76,7 @@ public function interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection( self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactReturnsSelectedOption(): void { $propertyOptions = [ @@ -97,9 +90,7 @@ public function interactReturnsSelectedOption(): void self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function interactReturnsSelectedOptionsIfMultipleOptionsAreAllowed(): void { $propertyOptions = [ @@ -117,12 +108,11 @@ public function interactReturnsSelectedOptionsIfMultipleOptionsAreAllowed(): voi /** * @param list $options - * @param int|float|string|bool|null $defaultValue */ private function buildInteractionSubject( array $options = [], bool $multiple = false, - $defaultValue = null, + int|float|string|bool|null $defaultValue = null, bool $required = false, ): Src\Builder\Config\ValueObject\CustomizableInterface { $validators = []; diff --git a/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php b/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php index d5a6e392..395482d4 100644 --- a/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php +++ b/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * ProcessSharedSourceFilesStepTest. @@ -48,9 +49,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runProcessesSourceFilesAndAppliesStep(): void { $actual = $this->subject->run($this->result); @@ -67,9 +66,7 @@ public function runProcessesSourceFilesAndAppliesStep(): void self::assertTrue($this->result->isStepApplied($this->subject)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function revertRemovesProcessedFiles(): void { $this->subject->run($this->result); diff --git a/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php b/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php index ece7c0bc..02bf89b1 100644 --- a/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php +++ b/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php @@ -26,6 +26,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use Generator; +use PHPUnit\Framework; use function dirname; @@ -51,9 +52,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runProcessesSourceFilesAndAppliesStep(): void { $actual = $this->subject->run($this->result); @@ -71,13 +70,11 @@ public function runProcessesSourceFilesAndAppliesStep(): void } /** - * @test - * - * @dataProvider runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider - * * @param list $fileConditions * @param list $notExpected */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider')] public function runCanProcessTheSameSourceFileWithMultipleConditions( array $fileConditions, string $expected, @@ -106,9 +103,7 @@ public function runCanProcessTheSameSourceFileWithMultipleConditions( } } - /** - * @test - */ + #[Framework\Attributes\Test] public function revertRemovesProcessedFiles(): void { $this->subject->run($this->result); @@ -123,7 +118,7 @@ public function revertRemovesProcessedFiles(): void /** * @return Generator, string, list}> */ - public function runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider(): Generator + public static function runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider(): Generator { yield 'one condition without target' => [ [ diff --git a/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php b/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php index fb63bacd..6b0fbc27 100644 --- a/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php +++ b/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use function dirname; @@ -47,9 +48,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runThrowsExceptionIfNoTemplateFileIsGiven(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -59,9 +58,7 @@ public function runThrowsExceptionIfNoTemplateFileIsGiven(): void $this->subject->run($this->result); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runThrowsExceptionIfTemplateFileDoesNotExist(): void { $this->subject->setConfig( @@ -78,9 +75,7 @@ public function runThrowsExceptionIfTemplateFileDoesNotExist(): void $this->subject->run($this->result); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runThrowsExceptionIfTemplateFileCannotBeRendered(): void { $this->subject->setConfig( @@ -100,9 +95,7 @@ public function runThrowsExceptionIfTemplateFileCannotBeRendered(): void $this->subject->run($this->result); } - /** - * @test - */ + #[Framework\Attributes\Test] public function runShowsNextStepsFromRenderedTemplateFileAndAppliesStep(): void { $this->subject->setConfig( diff --git a/tests/src/Builder/Generator/Step/StepFactoryTest.php b/tests/src/Builder/Generator/Step/StepFactoryTest.php index 0638fcbe..de78c7c2 100644 --- a/tests/src/Builder/Generator/Step/StepFactoryTest.php +++ b/tests/src/Builder/Generator/Step/StepFactoryTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * StepFactoryTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\StepFactory::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getThrowsExceptionIfGivenStepIsNotSupported(): void { $step = new Src\Builder\Config\ValueObject\Step('foo'); @@ -55,9 +54,7 @@ public function getThrowsExceptionIfGivenStepIsNotSupported(): void $this->subject->get($step); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getReturnsStepForGivenStep(): void { $step = new Src\Builder\Config\ValueObject\Step('collectBuildInstructions'); diff --git a/tests/src/Builder/Writer/GenericFileWriterTest.php b/tests/src/Builder/Writer/GenericFileWriterTest.php index 15081592..97135d65 100644 --- a/tests/src/Builder/Writer/GenericFileWriterTest.php +++ b/tests/src/Builder/Writer/GenericFileWriterTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Filesystem; use Symfony\Component\Finder; @@ -46,9 +47,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\GenericFileWriter::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function writeCopiesGivenFileToTemporaryDirectory(): void { $instructions = new Src\Builder\BuildInstructions( @@ -67,9 +66,7 @@ public function writeCopiesGivenFileToTemporaryDirectory(): void (new Filesystem\Filesystem())->remove(dirname($expected)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function writeCopiesGivenFileToGivenTargetFile(): void { $instructions = new Src\Builder\BuildInstructions( diff --git a/tests/src/Builder/Writer/JsonFileWriterTest.php b/tests/src/Builder/Writer/JsonFileWriterTest.php index aa8326f2..07565be2 100644 --- a/tests/src/Builder/Writer/JsonFileWriterTest.php +++ b/tests/src/Builder/Writer/JsonFileWriterTest.php @@ -27,6 +27,7 @@ use CPSIT\ProjectBuilder\Tests; use Generator; use JsonSerializable; +use PHPUnit\Framework; /** * JsonFileWriterTest. @@ -43,11 +44,8 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\JsonFileWriter::class); } - /** - * @test - * - * @dataProvider writeDumpsJsonToGivenFileDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('writeDumpsJsonToGivenFileDataProvider')] public function writeDumpsJsonToGivenFile(string|JsonSerializable $json, string $expected): void { $file = Src\Helper\FilesystemHelper::createFileObject( @@ -63,7 +61,7 @@ public function writeDumpsJsonToGivenFile(string|JsonSerializable $json, string /** * @return Generator */ - public function writeDumpsJsonToGivenFileDataProvider(): Generator + public static function writeDumpsJsonToGivenFileDataProvider(): Generator { yield 'json string' => ['{"foo":"baz"}', '{"foo":"baz"}']; yield 'serializable json object' => [ diff --git a/tests/src/Builder/Writer/TemplateWriterTest.php b/tests/src/Builder/Writer/TemplateWriterTest.php index ce19d7ab..10f64b0b 100644 --- a/tests/src/Builder/Writer/TemplateWriterTest.php +++ b/tests/src/Builder/Writer/TemplateWriterTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Filesystem; use Symfony\Component\Finder; @@ -46,9 +47,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\TemplateWriter::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function writeWritesRenderedTemplateFileToTemporaryDirectory(): void { $instructions = new Src\Builder\BuildInstructions( @@ -82,9 +81,7 @@ public function writeWritesRenderedTemplateFileToTemporaryDirectory(): void (new Filesystem\Filesystem())->remove(dirname($expected)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function writeWritesRenderedTemplateFileToGivenTargetFile(): void { $instructions = new Src\Builder\BuildInstructions( diff --git a/tests/src/Builder/Writer/WriterFactoryTest.php b/tests/src/Builder/Writer/WriterFactoryTest.php index a4e125bb..4d2a833a 100644 --- a/tests/src/Builder/Writer/WriterFactoryTest.php +++ b/tests/src/Builder/Writer/WriterFactoryTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * WriterFactoryTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\WriterFactory::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getThrowsExceptionIfFileIsNotSupported(): void { $subject = new Src\Builder\Writer\WriterFactory([]); @@ -55,9 +54,7 @@ public function getThrowsExceptionIfFileIsNotSupported(): void $subject->get('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getReturnsWriterForGivenFile(): void { self::assertInstanceOf(Src\Builder\Writer\GenericFileWriter::class, $this->subject->get('foo')); diff --git a/tests/src/Console/Command/CreateProjectCommandTest.php b/tests/src/Console/Command/CreateProjectCommandTest.php index 9a2cdf5c..85cfdec0 100644 --- a/tests/src/Console/Command/CreateProjectCommandTest.php +++ b/tests/src/Console/Command/CreateProjectCommandTest.php @@ -28,6 +28,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use Exception; +use PHPUnit\Framework; use Symfony\Component\Console as SymfonyConsole; use Symfony\Component\Filesystem; @@ -72,9 +73,7 @@ protected function setUp(): void self::$io->makeInteractive(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createReturnsInstanceWithGivenMessenger(): void { self::$io->makeInteractive(false); @@ -93,9 +92,7 @@ public function createReturnsInstanceWithGivenMessenger(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeThrowsExceptionIfInputIsNonInteractive(): void { self::$io->makeInteractive(false); @@ -109,9 +106,7 @@ public function executeThrowsExceptionIfInputIsNonInteractive(): void self::assertStringContainsString('This command cannot be run in non-interactive mode.', $output); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeShowsWelcomeScreen(): void { self::$io->setUserInputs(['no']); @@ -129,9 +124,7 @@ public function executeShowsWelcomeScreen(): void self::assertStringContainsString('Welcome to the Project Builder', $output); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderProvidesNoTemplates(): void { self::$io->setUserInputs(['yes', '', 'no']); @@ -150,9 +143,7 @@ public function executeAllowsSelectingADifferentTemplateProviderIfTheSelectedPro self::assertStringContainsString('Where can we find the project template?', $output); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderShouldBeChanged(): void { $this->templateProvider->templateSources = [ @@ -172,12 +163,10 @@ public function executeAllowsSelectingADifferentTemplateProviderIfTheSelectedPro $output = self::$io->getOutput(); self::assertStringContainsStringMultipleTimes('Fetching templates from https://www.example.com ...', $output); - self::assertStringContainsStringMultipleTimes('Try another template provider.', $output); + self::assertStringContainsStringMultipleTimes('Try a different provider (e.g. Satis or GitHub)', $output); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeFailsIfProjectGenerationIsAborted(): void { $this->filesystem->dumpFile($this->targetDirectory.'/foo', 'baz'); @@ -189,9 +178,7 @@ public function executeFailsIfProjectGenerationIsAborted(): void ])); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeHandlesErrorDuringProjectGeneration(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -210,9 +197,7 @@ public function executeHandlesErrorDuringProjectGeneration(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeSkipsOverwriteConfirmationIfForceOptionIsGiven(): void { $this->filesystem->dumpFile($this->targetDirectory.'/foo', 'baz'); @@ -236,9 +221,7 @@ public function executeSkipsOverwriteConfirmationIfForceOptionIsGiven(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeGeneratesNewProjectFromSelectedTemplateAndShowsNumberOfProcessedFiles(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -262,9 +245,7 @@ public function executeGeneratesNewProjectFromSelectedTemplateAndShowsNumberOfPr self::assertStringContainsString('Congratulations, your new project was successfully built!', $output); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeGeneratesNewProjectFromSelectedTemplateAndShowsAllProcessedFiles(): void { $this->templateProvider->installationPath = $this->targetDirectory; diff --git a/tests/src/Console/Command/ProxyCommandTest.php b/tests/src/Console/Command/ProxyCommandTest.php index f1c659f4..f5a7c743 100644 --- a/tests/src/Console/Command/ProxyCommandTest.php +++ b/tests/src/Console/Command/ProxyCommandTest.php @@ -26,6 +26,7 @@ use Composer\Console; use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Console as SymfonyConsole; /** @@ -50,9 +51,7 @@ protected function setUp(): void $this->commandTester = new SymfonyConsole\Tester\CommandTester($this->subject); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeConfiguresActualCommand(): void { $this->commandTester->execute([]); @@ -63,9 +62,7 @@ public function executeConfiguresActualCommand(): void self::assertTrue($inputDefinition->hasOption('dummy')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getNameReturnsActualCommandName(): void { $this->commandTester->execute([]); @@ -73,9 +70,7 @@ public function getNameReturnsActualCommandName(): void self::assertSame('dummy', $this->subject->getName()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getDescriptionReturnsActualCommandDescription(): void { $this->commandTester->execute([]); @@ -83,9 +78,7 @@ public function getDescriptionReturnsActualCommandDescription(): void self::assertSame('dummy description', $this->subject->getDescription()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getHelpReturnsActualCommandHelp(): void { $this->commandTester->execute([]); @@ -93,9 +86,7 @@ public function getHelpReturnsActualCommandHelp(): void self::assertSame('dummy help', $this->subject->getHelp()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getProcessedHelpReturnsActualProcessedCommandHelp(): void { $this->commandTester->execute([]); @@ -103,9 +94,7 @@ public function getProcessedHelpReturnsActualProcessedCommandHelp(): void self::assertSame('dummy help', $this->subject->getProcessedHelp()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getSynopsisReturnsActualCommandSynopsis(): void { $this->commandTester->execute([]); @@ -113,17 +102,13 @@ public function getSynopsisReturnsActualCommandSynopsis(): void self::assertSame('dummy [--dummy] [--] []', $this->subject->getSynopsis()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isProxyCommandReturnsTrue(): void { self::assertTrue($this->subject->isProxyCommand()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executeCallsActualCommandMethods(): void { $this->commandTester->execute([]); @@ -135,9 +120,7 @@ public function executeCallsActualCommandMethods(): void self::assertStringContainsString('execute was called', $output); } - /** - * @test - */ + #[Framework\Attributes\Test] public function executePassesInitializedMessengerToActualCommand(): void { $this->commandTester->execute([]); diff --git a/tests/src/Console/IO/AccessibleConsoleIOTest.php b/tests/src/Console/IO/AccessibleConsoleIOTest.php index 376039ed..735c99d9 100644 --- a/tests/src/Console/IO/AccessibleConsoleIOTest.php +++ b/tests/src/Console/IO/AccessibleConsoleIOTest.php @@ -26,6 +26,7 @@ use Composer\IO; use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Console; /** @@ -43,9 +44,7 @@ protected function setUp(): void $this->subject = Src\Console\IO\AccessibleConsoleIO::fromIO(self::$io); } - /** - * @test - */ + #[Framework\Attributes\Test] public function fromIOThrowsExceptionIfInvalidIOPropertiesAreGiven(): void { $io = new Tests\Fixtures\InvalidConsoleIO( @@ -59,9 +58,7 @@ public function fromIOThrowsExceptionIfInvalidIOPropertiesAreGiven(): void Src\Console\IO\AccessibleConsoleIO::fromIO($io); } - /** - * @test - */ + #[Framework\Attributes\Test] public function fromIOConstructsInputAndOutputIfIOIsNotConsoleIO(): void { $actual = Src\Console\IO\AccessibleConsoleIO::fromIO(new IO\NullIO()); @@ -70,9 +67,7 @@ public function fromIOConstructsInputAndOutputIfIOIsNotConsoleIO(): void self::assertInstanceOf(Console\Output\ConsoleOutput::class, $actual->getOutput()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getInputReturnsInput(): void { self::$io->makeInteractive(); @@ -88,9 +83,7 @@ public function getInputReturnsInput(): void self::assertFalse(self::$io->isInteractive()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getOutputReturnsOutput(): void { $output = $this->subject->getOutput(); diff --git a/tests/src/ContainerAwareTestCase.php b/tests/src/ContainerAwareTestCase.php index 3575d618..1e46dbb0 100644 --- a/tests/src/ContainerAwareTestCase.php +++ b/tests/src/ContainerAwareTestCase.php @@ -29,7 +29,7 @@ use GuzzleHttp\HandlerStack; use GuzzleHttp\Utils; use Nyholm\Psr7\Factory; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use Psr\Http\Client; use Psr\Http\Message; use Symfony\Component\DependencyInjection; @@ -40,7 +40,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -abstract class ContainerAwareTestCase extends TestCase +abstract class ContainerAwareTestCase extends Framework\TestCase { protected static DependencyInjection\ContainerInterface $container; protected static Factory\HttplugFactory $factory; diff --git a/tests/src/Error/ErrorHandlerTest.php b/tests/src/Error/ErrorHandlerTest.php index ee05a9a2..7c9a165c 100644 --- a/tests/src/Error/ErrorHandlerTest.php +++ b/tests/src/Error/ErrorHandlerTest.php @@ -30,6 +30,7 @@ use CuyZ\Valinor\MapperBuilder; use Exception; use Generator; +use PHPUnit\Framework; use Symfony\Component\Console; use Throwable; @@ -49,12 +50,10 @@ protected function setUp(): void } /** - * @test - * - * @dataProvider handleExceptionWritesFormattedErrorMessageDataProvider - * * @param list $expectedOutput */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('handleExceptionWritesFormattedErrorMessageDataProvider')] public function handleExceptionWritesFormattedErrorMessage(Throwable $exception, array $expectedOutput): void { $this->subject->handleException($exception); @@ -66,9 +65,7 @@ public function handleExceptionWritesFormattedErrorMessage(Throwable $exception, } } - /** - * @test - */ + #[Framework\Attributes\Test] public function handleExceptionThrowsExceptionIfOutputIsVerbose(): void { $io = new IO\BufferIO('', Console\Output\OutputInterface::VERBOSITY_VERBOSE); @@ -83,7 +80,7 @@ public function handleExceptionThrowsExceptionIfOutputIsVerbose(): void /** * @return Generator}> */ - public function handleExceptionWritesFormattedErrorMessageDataProvider(): Generator + public static function handleExceptionWritesFormattedErrorMessageDataProvider(): Generator { yield 'exception' => [ new Exception('Something went wrong.'), diff --git a/tests/src/Event/BeforeTemplateRenderedEventTest.php b/tests/src/Event/BeforeTemplateRenderedEventTest.php index 97573707..ea8d185d 100644 --- a/tests/src/Event/BeforeTemplateRenderedEventTest.php +++ b/tests/src/Event/BeforeTemplateRenderedEventTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Twig\Environment; /** @@ -51,9 +52,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTwigReturnsTwigEnvironment(): void { self::assertSame( @@ -62,9 +61,7 @@ public function getTwigReturnsTwigEnvironment(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getInstructionsReturnsBuildInstructions(): void { self::assertSame( @@ -73,9 +70,7 @@ public function getInstructionsReturnsBuildInstructions(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getVariablesReturnsVariables(): void { self::assertSame( @@ -87,9 +82,7 @@ public function getVariablesReturnsVariables(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setVariablesUpdatesVariables(): void { $this->subject->setVariables(['dummy' => null]); diff --git a/tests/src/Event/BuildStepProcessedEventTest.php b/tests/src/Event/BuildStepProcessedEventTest.php index ca4e5af5..bc6c96d7 100644 --- a/tests/src/Event/BuildStepProcessedEventTest.php +++ b/tests/src/Event/BuildStepProcessedEventTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * BuildStepProcessedEventTest. @@ -51,9 +52,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getStepReturnsStep(): void { self::assertSame( @@ -62,9 +61,7 @@ public function getStepReturnsStep(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getBuildResultReturnsBuildResult(): void { self::assertSame( @@ -73,9 +70,7 @@ public function getBuildResultReturnsBuildResult(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isSuccessfulReturnsState(): void { self::assertFalse($this->subject->isSuccessful()); diff --git a/tests/src/Event/BuildStepRevertedEventTest.php b/tests/src/Event/BuildStepRevertedEventTest.php index 9e6e4df6..f72d6fda 100644 --- a/tests/src/Event/BuildStepRevertedEventTest.php +++ b/tests/src/Event/BuildStepRevertedEventTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * BuildStepRevertedEventTest. @@ -50,9 +51,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getStepReturnsStep(): void { self::assertSame( @@ -61,9 +60,7 @@ public function getStepReturnsStep(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getBuildResultReturnsBuildResult(): void { self::assertSame( diff --git a/tests/src/Event/ProjectBuildFinishedEventTest.php b/tests/src/Event/ProjectBuildFinishedEventTest.php index b355ed50..36fe3441 100644 --- a/tests/src/Event/ProjectBuildFinishedEventTest.php +++ b/tests/src/Event/ProjectBuildFinishedEventTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * ProjectBuildFinishedEventTest. @@ -47,9 +48,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getBuildResultReturnsBuildResult(): void { self::assertSame( diff --git a/tests/src/Event/ProjectBuildStartedEventTest.php b/tests/src/Event/ProjectBuildStartedEventTest.php index c188b380..d16b8afd 100644 --- a/tests/src/Event/ProjectBuildStartedEventTest.php +++ b/tests/src/Event/ProjectBuildStartedEventTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * ProjectBuildStartedEventTest. @@ -45,9 +46,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getInstructionsReturnsBuildInstructions(): void { self::assertSame( diff --git a/tests/src/Exception/FilesystemFailureExceptionTest.php b/tests/src/Exception/FilesystemFailureExceptionTest.php index 888ff80a..a0a432be 100644 --- a/tests/src/Exception/FilesystemFailureExceptionTest.php +++ b/tests/src/Exception/FilesystemFailureExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * FilesystemFailureExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class FilesystemFailureExceptionTest extends TestCase +final class FilesystemFailureExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forUnresolvableWorkingDirectoryReturnsExceptionForUnresolvableWorkingDirectory(): void { $actual = Src\Exception\FilesystemFailureException::forUnresolvableWorkingDirectory(); diff --git a/tests/src/Exception/HttpExceptionTest.php b/tests/src/Exception/HttpExceptionTest.php index 999b7285..2e25a13f 100644 --- a/tests/src/Exception/HttpExceptionTest.php +++ b/tests/src/Exception/HttpExceptionTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Nyholm\Psr7; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * HttpExceptionTest. @@ -33,11 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class HttpExceptionTest extends TestCase +final class HttpExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forInvalidResponseReturnsExceptionForInvalidResponse(): void { $request = new Psr7\Request('GET', 'https://www.example.com'); diff --git a/tests/src/Exception/IOExceptionTest.php b/tests/src/Exception/IOExceptionTest.php index e40afd43..2b2679a3 100644 --- a/tests/src/Exception/IOExceptionTest.php +++ b/tests/src/Exception/IOExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * IOExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class IOExceptionTest extends TestCase +final class IOExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forMissingFileReturnsExceptionForMissingFile(): void { $actual = Src\Exception\IOException::forMissingFile('foo'); diff --git a/tests/src/Exception/InvalidConfigurationExceptionTest.php b/tests/src/Exception/InvalidConfigurationExceptionTest.php index 4b876597..8714e639 100644 --- a/tests/src/Exception/InvalidConfigurationExceptionTest.php +++ b/tests/src/Exception/InvalidConfigurationExceptionTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Opis\JsonSchema; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use function dirname; @@ -35,11 +35,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class InvalidConfigurationExceptionTest extends TestCase +final class InvalidConfigurationExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function createReturnsExceptionForInvalidConfiguration(): void { $actual = Src\Exception\InvalidConfigurationException::create('foo'); @@ -48,9 +46,7 @@ public function createReturnsExceptionForInvalidConfiguration(): void self::assertSame(1652952150, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forAmbiguousFilesReturnsExceptionForAmbiguousFiles(): void { $actual = Src\Exception\InvalidConfigurationException::forAmbiguousFiles('foo', 'baz'); @@ -62,9 +58,7 @@ public function forAmbiguousFilesReturnsExceptionForAmbiguousFiles(): void self::assertSame(1652950002, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forFileReturnsExceptionForFile(): void { $actual = Src\Exception\InvalidConfigurationException::forFile('foo'); @@ -73,9 +67,7 @@ public function forFileReturnsExceptionForFile(): void self::assertSame(1652950625, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forSourceReturnsExceptionForSource(): void { $actual = Src\Exception\InvalidConfigurationException::forSource('foo'); @@ -84,9 +76,7 @@ public function forSourceReturnsExceptionForSource(): void self::assertSame(1653058480, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forConflictingPropertiesReturnsExceptionForConflictingProperties(): void { $actual = Src\Exception\InvalidConfigurationException::forConflictingProperties('foo', 'baz', 'boo'); @@ -95,9 +85,7 @@ public function forConflictingPropertiesReturnsExceptionForConflictingProperties self::assertSame(1652956541, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forValidationErrorsReturnsExceptionWithoutValidationErrors(): void { $actual = Src\Exception\InvalidConfigurationException::forValidationErrors(null); @@ -106,9 +94,7 @@ public function forValidationErrorsReturnsExceptionWithoutValidationErrors(): vo self::assertSame(1653303396, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forValidationErrorsReturnsExceptionForGivenValidationErrors(): void { $validationErrors = $this->generateValidationErrors(); @@ -123,9 +109,7 @@ public function forValidationErrorsReturnsExceptionForGivenValidationErrors(): v self::assertSame(1653303396, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forUnknownFileReturnsExceptionForUnknownFile(): void { $actual = Src\Exception\InvalidConfigurationException::forUnknownFile('foo'); @@ -134,9 +118,7 @@ public function forUnknownFileReturnsExceptionForUnknownFile(): void self::assertSame(1653424186, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forUnknownTemplateSourceReturnsExceptionForUnknownTemplateSource(): void { $actual = Src\Exception\InvalidConfigurationException::forUnknownTemplateSource('foo'); @@ -145,9 +127,7 @@ public function forUnknownTemplateSourceReturnsExceptionForUnknownTemplateSource self::assertSame(1673458682, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forMissingManifestFileReturnsExceptionForMissingManifestFile(): void { $actual = Src\Exception\InvalidConfigurationException::forMissingManifestFile('foo'); diff --git a/tests/src/Exception/InvalidResourceExceptionTest.php b/tests/src/Exception/InvalidResourceExceptionTest.php index a3028f68..f48564e1 100644 --- a/tests/src/Exception/InvalidResourceExceptionTest.php +++ b/tests/src/Exception/InvalidResourceExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * InvalidResourceExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class InvalidResourceExceptionTest extends TestCase +final class InvalidResourceExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function createReturnsExceptionForInvalidResource(): void { $actual = Src\Exception\InvalidResourceException::create('foo'); diff --git a/tests/src/Exception/InvalidTemplateSourceExceptionTest.php b/tests/src/Exception/InvalidTemplateSourceExceptionTest.php index 44f38bb5..d7a78235 100644 --- a/tests/src/Exception/InvalidTemplateSourceExceptionTest.php +++ b/tests/src/Exception/InvalidTemplateSourceExceptionTest.php @@ -26,7 +26,7 @@ use Composer\Package; use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * InvalidTemplateSourceExceptionTest. @@ -34,11 +34,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class InvalidTemplateSourceExceptionTest extends TestCase +final class InvalidTemplateSourceExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forProviderReturnsExceptionForProvider(): void { $actual = Src\Exception\InvalidTemplateSourceException::forProvider(new Tests\Fixtures\DummyProvider()); @@ -47,9 +45,7 @@ public function forProviderReturnsExceptionForProvider(): void self::assertSame(1664557140, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forFailedInstallationReturnsExceptionForFailedInstallation(): void { $actual = Src\Exception\InvalidTemplateSourceException::forFailedInstallation($this->createTemplateSource()); @@ -61,9 +57,7 @@ public function forFailedInstallationReturnsExceptionForFailedInstallation(): vo self::assertSame(1664557307, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forInvalidPackageVersionConstraintReturnsExceptionForInvalidPackageVersionConstraint(): void { $actual = Src\Exception\InvalidTemplateSourceException::forInvalidPackageVersionConstraint( diff --git a/tests/src/Exception/MisconfiguredValidatorExceptionTest.php b/tests/src/Exception/MisconfiguredValidatorExceptionTest.php index bcf1d910..361b4a6c 100644 --- a/tests/src/Exception/MisconfiguredValidatorExceptionTest.php +++ b/tests/src/Exception/MisconfiguredValidatorExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * MisconfiguredValidatorExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class MisconfiguredValidatorExceptionTest extends TestCase +final class MisconfiguredValidatorExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forUnexpectedOptionReturnsExceptionForUnexpectedOption(): void { $actual = Src\Exception\MisconfiguredValidatorException::forUnexpectedOption('foo', 'baz'); @@ -44,4 +42,16 @@ public function forUnexpectedOptionReturnsExceptionForUnexpectedOption(): void self::assertSame('The validator option "baz" of validator "foo" is invalid.', $actual->getMessage()); self::assertSame(1673886742, $actual->getCode()); } + + #[Framework\Attributes\Test] + public function forUnexpectedOptionsReturnsExceptionForUnexpectedOptions(): void + { + $actual = Src\Exception\MisconfiguredValidatorException::forUnexpectedOptions('foo', ['baz', 'boo', 'dummy']); + + self::assertSame( + 'The validator options "baz", "boo" and "dummy" of validator "foo" are invalid.', + $actual->getMessage(), + ); + self::assertSame(1679253412, $actual->getCode()); + } } diff --git a/tests/src/Exception/ShouldNotHappenExceptionTest.php b/tests/src/Exception/ShouldNotHappenExceptionTest.php index 157f51b9..26c28e63 100644 --- a/tests/src/Exception/ShouldNotHappenExceptionTest.php +++ b/tests/src/Exception/ShouldNotHappenExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use function sprintf; @@ -34,11 +34,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ShouldNotHappenExceptionTest extends TestCase +final class ShouldNotHappenExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function createReturnsExceptionWithBacktrace(): void { $line = __LINE__ + 1; diff --git a/tests/src/Exception/StepFailureExceptionTest.php b/tests/src/Exception/StepFailureExceptionTest.php index ce907c0b..c3876792 100644 --- a/tests/src/Exception/StepFailureExceptionTest.php +++ b/tests/src/Exception/StepFailureExceptionTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Exception; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * StepFailureExceptionTest. @@ -33,11 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class StepFailureExceptionTest extends TestCase +final class StepFailureExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function createReturnsExceptionOnStepFailure(): void { $previous = new Exception(); diff --git a/tests/src/Exception/StringConversionExceptionTest.php b/tests/src/Exception/StringConversionExceptionTest.php index 51f3dea9..0cd1b878 100644 --- a/tests/src/Exception/StringConversionExceptionTest.php +++ b/tests/src/Exception/StringConversionExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * StringConversionExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class StringConversionExceptionTest extends TestCase +final class StringConversionExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forUnmatchedStringReturnsExceptionForUnmatchedString(): void { $actual = Src\Exception\StringConversionException::forUnmatchedString('foo'); diff --git a/tests/src/Exception/TemplateRenderingExceptionTest.php b/tests/src/Exception/TemplateRenderingExceptionTest.php index 1be30df5..1d0437cc 100644 --- a/tests/src/Exception/TemplateRenderingExceptionTest.php +++ b/tests/src/Exception/TemplateRenderingExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * TemplateRenderingExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class TemplateRenderingExceptionTest extends TestCase +final class TemplateRenderingExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forMissingTemplateReturnsExceptionForMissingTemplate(): void { $actual = Src\Exception\TemplateRenderingException::forMissingTemplate('foo'); @@ -45,9 +43,7 @@ public function forMissingTemplateReturnsExceptionForMissingTemplate(): void self::assertSame(1653901911, $actual->getCode()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function forUndefinedTemplateReturnsExceptionForUndefinedTemplate(): void { $actual = Src\Exception\TemplateRenderingException::forUndefinedTemplate(); diff --git a/tests/src/Exception/UnsupportedEnvironmentExceptionTest.php b/tests/src/Exception/UnsupportedEnvironmentExceptionTest.php index 271c73c3..e84c6401 100644 --- a/tests/src/Exception/UnsupportedEnvironmentExceptionTest.php +++ b/tests/src/Exception/UnsupportedEnvironmentExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * UnsupportedEnvironmentExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class UnsupportedEnvironmentExceptionTest extends TestCase +final class UnsupportedEnvironmentExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function forOutdatedComposerInstallationReturnsExceptionForOutdatedComposerInstallation(): void { $actual = Src\Exception\UnsupportedEnvironmentException::forOutdatedComposerInstallation(); diff --git a/tests/src/Exception/UnsupportedTypeExceptionTest.php b/tests/src/Exception/UnsupportedTypeExceptionTest.php index ca344810..f0093159 100644 --- a/tests/src/Exception/UnsupportedTypeExceptionTest.php +++ b/tests/src/Exception/UnsupportedTypeExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * UnsupportedTypeExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class UnsupportedTypeExceptionTest extends TestCase +final class UnsupportedTypeExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function createReturnsExceptionForUnsupportedType(): void { $actual = Src\Exception\UnsupportedTypeException::create('foo'); diff --git a/tests/src/Exception/ValidationExceptionTest.php b/tests/src/Exception/ValidationExceptionTest.php index 297e5629..6fb3f9cc 100644 --- a/tests/src/Exception/ValidationExceptionTest.php +++ b/tests/src/Exception/ValidationExceptionTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Exception; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * ValidationExceptionTest. @@ -32,11 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ValidationExceptionTest extends TestCase +final class ValidationExceptionTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function createReturnsExceptionForValidation(): void { $actual = Src\Exception\ValidationException::create('foo'); diff --git a/tests/src/Fixtures/Templates/json-template/config.json b/tests/src/Fixtures/Templates/json-template/config.json index 4d9c20d3..44fba269 100644 --- a/tests/src/Fixtures/Templates/json-template/config.json +++ b/tests/src/Fixtures/Templates/json-template/config.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/CPS-IT/project-builder/main/resources/config.schema.json", "name": "Json", "steps": [ { diff --git a/tests/src/Fixtures/Templates/yaml-template/config.yaml b/tests/src/Fixtures/Templates/yaml-template/config.yaml index adbf93da..fade1ecf 100644 --- a/tests/src/Fixtures/Templates/yaml-template/config.yaml +++ b/tests/src/Fixtures/Templates/yaml-template/config.yaml @@ -1,3 +1,5 @@ +$schema: https://raw.githubusercontent.com/CPS-IT/project-builder/main/resources/config.schema.json + name: Yaml steps: diff --git a/tests/src/Helper/ArrayHelperTest.php b/tests/src/Helper/ArrayHelperTest.php index 74e6612e..6bfdc17f 100644 --- a/tests/src/Helper/ArrayHelperTest.php +++ b/tests/src/Helper/ArrayHelperTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Helper; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use stdClass; /** @@ -33,11 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ArrayHelperTest extends TestCase +final class ArrayHelperTest extends Framework\TestCase { - /** - * @test - */ + #[Framework\Attributes\Test] public function getValueByPathReturnsValueAtGivenPath(): void { $object = new stdClass(); @@ -61,9 +59,7 @@ public function getValueByPathReturnsValueAtGivenPath(): void self::assertNull(Src\Helper\ArrayHelper::getValueByPath($subject, 'foo.baz.boo')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setValueByPathSetsValueAtGivenPath(): void { $subject = [ diff --git a/tests/src/Helper/FilesystemHelperTest.php b/tests/src/Helper/FilesystemHelperTest.php index 3a4999cf..7c7235a7 100644 --- a/tests/src/Helper/FilesystemHelperTest.php +++ b/tests/src/Helper/FilesystemHelperTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use Symfony\Component\Filesystem; use function chdir; @@ -38,7 +38,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class FilesystemHelperTest extends TestCase +final class FilesystemHelperTest extends Framework\TestCase { private Filesystem\Filesystem $filesystem; @@ -47,9 +47,7 @@ protected function setUp(): void $this->filesystem = new Filesystem\Filesystem(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createFileObjectReturnsFileObjectForGivenFile(): void { $baseDir = __DIR__; @@ -62,28 +60,24 @@ public function createFileObjectReturnsFileObjectForGivenFile(): void self::assertSame($baseDir.'/'.$relativePathname, $actual->getPathname()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { + $prefix = sys_get_temp_dir(); $actual = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); + self::assertNotEmpty($prefix); self::assertDirectoryDoesNotExist($actual); - self::assertStringStartsWith(sys_get_temp_dir(), $actual); + self::assertStringStartsWith($prefix, $actual); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPackageDirectoryReturnsPackagePathFromComposerPackageArtifact(): void { self::assertSame(dirname(__DIR__, 3), Src\Helper\FilesystemHelper::getPackageDirectory()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getWorkingDirectoryReturnsCurrentWorkingDirectory(): void { $cwd = dirname(__DIR__, 3); @@ -97,17 +91,13 @@ public function getWorkingDirectoryReturnsCurrentWorkingDirectory(): void chdir($cwd); } - /** - * @test - */ + #[Framework\Attributes\Test] public function resolveRelativePathReturnsAbsolutePathIfGivenPathIsAbsolute(): void { self::assertSame('/foo', Src\Helper\FilesystemHelper::resolveRelativePath('/foo')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function resolveRelativePathPrependsProjectRootPath(): void { $currentWorkingDirectory = getcwd(); @@ -123,9 +113,7 @@ public function resolveRelativePathPrependsProjectRootPath(): void chdir($currentWorkingDirectory); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isDirectoryEmptyReturnsTrueIfDirectoryDoesNotExist(): void { $directory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -134,9 +122,7 @@ public function isDirectoryEmptyReturnsTrueIfDirectoryDoesNotExist(): void self::assertTrue(Src\Helper\FilesystemHelper::isDirectoryEmpty($directory)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isDirectoryEmptyReturnsTrueIfDirectoryExistsAndIsEmpty(): void { $directory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -149,11 +135,8 @@ public function isDirectoryEmptyReturnsTrueIfDirectoryExistsAndIsEmpty(): void $this->filesystem->remove($directory); } - /** - * @test - * - * @dataProvider isDirectoryEmptyReturnsFalseIfDirectoryHasFilesDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('isDirectoryEmptyReturnsFalseIfDirectoryHasFilesDataProvider')] public function isDirectoryEmptyReturnsFalseIfDirectoryHasFiles(string $filename): void { $directory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -168,11 +151,8 @@ public function isDirectoryEmptyReturnsFalseIfDirectoryHasFiles(string $filename $this->filesystem->remove($directory); } - /** - * @test - * - * @dataProvider isDirectoryEmptyReturnsFalseIfDirectoryHasDirectoriesDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('isDirectoryEmptyReturnsFalseIfDirectoryHasDirectoriesDataProvider')] public function isDirectoryEmptyReturnsFalseIfDirectoryHasDirectories(string $dirname): void { $directory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -188,7 +168,7 @@ public function isDirectoryEmptyReturnsFalseIfDirectoryHasDirectories(string $di /** * @return Generator */ - public function isDirectoryEmptyReturnsFalseIfDirectoryHasFilesDataProvider(): Generator + public static function isDirectoryEmptyReturnsFalseIfDirectoryHasFilesDataProvider(): Generator { yield 'normal file' => ['foo']; yield 'dotfile' => ['.foo']; @@ -197,7 +177,7 @@ public function isDirectoryEmptyReturnsFalseIfDirectoryHasFilesDataProvider(): G /** * @return Generator */ - public function isDirectoryEmptyReturnsFalseIfDirectoryHasDirectoriesDataProvider(): Generator + public static function isDirectoryEmptyReturnsFalseIfDirectoryHasDirectoriesDataProvider(): Generator { yield 'normal directory' => ['foo']; yield 'dot-directory' => ['.foo']; diff --git a/tests/src/Helper/StringHelperTest.php b/tests/src/Helper/StringHelperTest.php index 9ee0adf5..c26cbc9b 100644 --- a/tests/src/Helper/StringHelperTest.php +++ b/tests/src/Helper/StringHelperTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use UnhandledMatchError; /** @@ -34,23 +34,19 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class StringHelperTest extends TestCase +final class StringHelperTest extends Framework\TestCase { /** - * @test - * * @param value-of $case - * - * @dataProvider convertCaseConvertsStringToGivenCaseDataProvider */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('convertCaseConvertsStringToGivenCaseDataProvider')] public function convertCaseConvertsStringToGivenCase(string $string, string $case, string $expected): void { self::assertSame($expected, Src\Helper\StringHelper::convertCase($string, $case)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function convertCaseThrowsExceptionWhenConvertingToUnsupportedCase(): void { $this->expectException(UnhandledMatchError::class); @@ -60,12 +56,10 @@ public function convertCaseThrowsExceptionWhenConvertingToUnsupportedCase(): voi } /** - * @test - * - * @dataProvider interpolateInterpolatedGivenStringWithKeyValuePairsDataProvider - * * @param array $replacePairs */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('interpolateInterpolatedGivenStringWithKeyValuePairsDataProvider')] public function interpolateInterpolatedGivenStringWithKeyValuePairs(string $string, array $replacePairs, string $expected): void { self::assertSame($expected, Src\Helper\StringHelper::interpolate($string, $replacePairs)); @@ -74,7 +68,7 @@ public function interpolateInterpolatedGivenStringWithKeyValuePairs(string $stri /** * @return Generator, string}> */ - public function convertCaseConvertsStringToGivenCaseDataProvider(): Generator + public static function convertCaseConvertsStringToGivenCaseDataProvider(): Generator { yield 'lowercase' => ['foo_Bar-123 helloWorld', Src\StringCase::Lower->value, 'foo_bar-123 helloworld']; yield 'uppercase' => ['foo_Bar-123 helloWorld', Src\StringCase::Upper->value, 'FOO_BAR-123 HELLOWORLD']; @@ -86,7 +80,7 @@ public function convertCaseConvertsStringToGivenCaseDataProvider(): Generator /** * @return Generator, string}> */ - public function interpolateInterpolatedGivenStringWithKeyValuePairsDataProvider(): Generator + public static function interpolateInterpolatedGivenStringWithKeyValuePairsDataProvider(): Generator { yield 'no placeholders' => ['foo', [], 'foo']; yield 'valid placeholder' => ['foo{bar}', ['bar' => 'foo'], 'foofoo']; diff --git a/tests/src/IO/InputReaderTest.php b/tests/src/IO/InputReaderTest.php index 4787946d..a35826a4 100644 --- a/tests/src/IO/InputReaderTest.php +++ b/tests/src/IO/InputReaderTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * InputReaderTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = new Src\IO\InputReader(self::$io); } - /** - * @test - */ + #[Framework\Attributes\Test] public function staticValueReturnsUserInput(): void { self::$io->setUserInputs(['Bob']); @@ -52,17 +51,13 @@ public function staticValueReturnsUserInput(): void self::assertStringContainsString('What\'s your name? (optional) [Alice]', self::$io->getOutput()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function staticValueReturnsDefaultValue(): void { self::assertSame('Alice', $this->subject->staticValue('What\'s your name?', 'Alice')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function hiddenValueHidesUserInput(): void { self::$io->setUserInputs(['s3cr3t']); diff --git a/tests/src/IO/MessengerTest.php b/tests/src/IO/MessengerTest.php index 23d237e0..d846126a 100644 --- a/tests/src/IO/MessengerTest.php +++ b/tests/src/IO/MessengerTest.php @@ -28,6 +28,7 @@ use CPSIT\ProjectBuilder\Tests; use Exception; use Generator; +use PHPUnit\Framework; use Symfony\Component\Console; use Symfony\Component\Filesystem; @@ -48,9 +49,7 @@ protected function setUp(): void $this->subject = self::$container->get('app.messenger'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function selectProviderCanHandlePackagistProvider(): void { $packagistProvider = new Src\Template\Provider\PackagistProvider( @@ -63,9 +62,7 @@ public function selectProviderCanHandlePackagistProvider(): void self::assertSame($packagistProvider, $this->subject->selectProvider([$packagistProvider])); } - /** - * @test - */ + #[Framework\Attributes\Test] public function selectProviderCanHandleCustomComposerProvider(): void { $customProvider = new Src\Template\Provider\ComposerProvider( @@ -79,9 +76,7 @@ public function selectProviderCanHandleCustomComposerProvider(): void self::assertSame('https://www.example.com', $customProvider->getUrl()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplateSources(): void { $provider = new Tests\Fixtures\DummyProvider(); @@ -91,11 +86,8 @@ public function selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplat $this->subject->selectTemplateSource($provider); } - /** - * @test - * - * @dataProvider selectTemplateSourceReturnsSelectedTemplateSourceDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('selectTemplateSourceReturnsSelectedTemplateSourceDataProvider')] public function selectTemplateSourceReturnsSelectedTemplateSource( Package\PackageInterface $package, string $expected, @@ -110,11 +102,8 @@ public function selectTemplateSourceReturnsSelectedTemplateSource( self::assertStringContainsString($expected, self::$io->getOutput()); } - /** - * @test - * - * @dataProvider confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider')] public function confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult(string $input, bool $expected): void { $exception = new Exception('Something went wrong.'); @@ -134,9 +123,7 @@ public function confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult(st ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isVerboseReturnsTrueIfVerbosityLevelIsVerbose(): void { self::assertFalse($this->subject->isVerbose()); @@ -146,9 +133,7 @@ public function isVerboseReturnsTrueIfVerbosityLevelIsVerbose(): void self::assertTrue($this->subject->isVerbose()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isVeryVerboseReturnsTrueIfVerbosityLevelIsVeryVerbose(): void { self::assertFalse($this->subject->isVeryVerbose()); @@ -158,9 +143,7 @@ public function isVeryVerboseReturnsTrueIfVerbosityLevelIsVeryVerbose(): void self::assertTrue($this->subject->isVeryVerbose()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function isDebugReturnsTrueIfVerbosityLevelIsDebug(): void { self::assertFalse($this->subject->isDebug()); @@ -173,7 +156,7 @@ public function isDebugReturnsTrueIfVerbosityLevelIsDebug(): void /** * @return Generator */ - public function selectTemplateSourceReturnsSelectedTemplateSourceDataProvider(): Generator + public static function selectTemplateSourceReturnsSelectedTemplateSourceDataProvider(): Generator { $package = new Package\Package('foo/baz', '1.0.0', '1.0.0'); @@ -191,7 +174,7 @@ public function selectTemplateSourceReturnsSelectedTemplateSourceDataProvider(): /** * @return Generator */ - public function confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider(): Generator + public static function confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider(): Generator { yield 'default' => ['', true]; yield 'yes' => ['yes', true]; diff --git a/tests/src/IO/Validator/AbstractValidatorTest.php b/tests/src/IO/Validator/AbstractValidatorTest.php new file mode 100644 index 00000000..786f8416 --- /dev/null +++ b/tests/src/IO/Validator/AbstractValidatorTest.php @@ -0,0 +1,53 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +namespace CPSIT\ProjectBuilder\Tests\IO\Validator; + +use CPSIT\ProjectBuilder as Src; +use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; + +/** + * AbstractValidatorTest. + * + * @author Elias Häußler + * @license GPL-3.0-or-later + */ +final class AbstractValidatorTest extends Framework\TestCase +{ + #[Framework\Attributes\Test] + public function constructorThrowsExceptionIfInvalidOptionsAreGiven(): void + { + $this->expectExceptionObject( + Src\Exception\MisconfiguredValidatorException::forUnexpectedOptions( + Tests\Fixtures\ModifyingValidator::getType(), + ['foo', 'baz'], + ), + ); + + new Tests\Fixtures\ModifyingValidator([ + 'foo' => true, + 'baz' => false, + ]); + } +} diff --git a/tests/src/IO/Validator/CallbackValidatorTest.php b/tests/src/IO/Validator/CallbackValidatorTest.php index 6f0f7f4a..80c99221 100644 --- a/tests/src/IO/Validator/CallbackValidatorTest.php +++ b/tests/src/IO/Validator/CallbackValidatorTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * CallbackValidatorTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class CallbackValidatorTest extends TestCase +final class CallbackValidatorTest extends Framework\TestCase { private Src\IO\Validator\CallbackValidator $subject; @@ -42,9 +42,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\CallbackValidator(['callback' => $this->validate(...)]); } - /** - * @test - */ + #[Framework\Attributes\Test] public function constructorThrowsExceptionIfNoCallbackIsGiven(): void { $this->expectExceptionObject( @@ -54,9 +52,7 @@ public function constructorThrowsExceptionIfNoCallbackIsGiven(): void new Src\IO\Validator\CallbackValidator(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function constructorThrowsExceptionIfInvalidCallbackIsGiven(): void { $this->expectExceptionObject( @@ -67,11 +63,8 @@ public function constructorThrowsExceptionIfInvalidCallbackIsGiven(): void new Src\IO\Validator\CallbackValidator(['callback' => 'foo']); } - /** - * @test - * - * @dataProvider invokeCallsConfiguredCallbackDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeCallsConfiguredCallbackDataProvider')] public function invokeCallsConfiguredCallback(?string $input, ?string $expected): void { $actual = ($this->subject)($input); @@ -82,7 +75,7 @@ public function invokeCallsConfiguredCallback(?string $input, ?string $expected) /** * @return Generator */ - public function invokeCallsConfiguredCallbackDataProvider(): Generator + public static function invokeCallsConfiguredCallbackDataProvider(): Generator { yield 'null' => [null, null]; yield 'string' => ['string', 'input is string']; diff --git a/tests/src/IO/Validator/ChainedValidatorTest.php b/tests/src/IO/Validator/ChainedValidatorTest.php index 923f9746..7ce4aab4 100644 --- a/tests/src/IO/Validator/ChainedValidatorTest.php +++ b/tests/src/IO/Validator/ChainedValidatorTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * ChainedValidatorTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ChainedValidatorTest extends TestCase +final class ChainedValidatorTest extends Framework\TestCase { private Src\IO\Validator\ChainedValidator $subject; @@ -46,9 +46,7 @@ protected function setUp(): void ]); } - /** - * @test - */ + #[Framework\Attributes\Test] public function constructorAddsGivenValidators(): void { $emailValidator = new Src\IO\Validator\EmailValidator(); @@ -60,9 +58,7 @@ public function constructorAddsGivenValidators(): void self::assertFalse($this->subject->has($urlValidator)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeInvokesAllValidators(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -72,9 +68,7 @@ public function invokeInvokesAllValidators(): void ($this->subject)(null); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeInvokesAllValidatorsAndReturnsModifiedInput(): void { $actual = ($this->subject)('foo@bar.de'); @@ -82,9 +76,7 @@ public function invokeInvokesAllValidatorsAndReturnsModifiedInput(): void self::assertSame('FOO@BAR.DE', $actual); } - /** - * @test - */ + #[Framework\Attributes\Test] public function removeRemovesValidator(): void { $validator = new Src\IO\Validator\EmailValidator(); @@ -93,17 +85,13 @@ public function removeRemovesValidator(): void self::assertFalse($this->subject->remove($validator)->has($validator)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTypeReturnsType(): void { self::assertSame('chained', $this->subject::getType()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function supportsReturnsFalse(): void { self::assertFalse($this->subject::supports('email')); diff --git a/tests/src/IO/Validator/EmailValidatorTest.php b/tests/src/IO/Validator/EmailValidatorTest.php index 56b042d4..f158a5d9 100644 --- a/tests/src/IO/Validator/EmailValidatorTest.php +++ b/tests/src/IO/Validator/EmailValidatorTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\IO\Validator; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * EmailValidatorTest. @@ -32,7 +32,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class EmailValidatorTest extends TestCase +final class EmailValidatorTest extends Framework\TestCase { private Src\IO\Validator\EmailValidator $subject; @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\EmailValidator(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsNullOnNullInput(): void { $actual = ($this->subject)(null); @@ -51,9 +49,7 @@ public function invokeReturnsNullOnNullInput(): void self::assertNull($actual); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -63,9 +59,7 @@ public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void ($this->subject)('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsGivenInputIfGivenInputIsValid(): void { $actual = ($this->subject)('foo@bar.de'); diff --git a/tests/src/IO/Validator/NotEmptyValidatorTest.php b/tests/src/IO/Validator/NotEmptyValidatorTest.php index db10d18c..d600ec16 100644 --- a/tests/src/IO/Validator/NotEmptyValidatorTest.php +++ b/tests/src/IO/Validator/NotEmptyValidatorTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * NotEmptyValidatorTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class NotEmptyValidatorTest extends TestCase +final class NotEmptyValidatorTest extends Framework\TestCase { private Src\IO\Validator\NotEmptyValidator $subject; @@ -42,11 +42,8 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\NotEmptyValidator(); } - /** - * @test - * - * @dataProvider invokeThrowsExceptionIfGivenInputIsEmptyDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeThrowsExceptionIfGivenInputIsEmptyDataProvider')] public function invokeThrowsExceptionIfGivenInputIsEmpty(?string $input): void { $this->expectException(Src\Exception\ValidationException::class); @@ -56,9 +53,7 @@ public function invokeThrowsExceptionIfGivenInputIsEmpty(?string $input): void ($this->subject)($input); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsEnabled(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -69,9 +64,7 @@ public function invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIs $subject(' '); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsNotEnabled(): void { $actual = ($this->subject)(' '); @@ -79,9 +72,7 @@ public function invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictC self::assertSame(' ', $actual); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsGivenInputIfGivenInputIsValid(): void { $actual = ($this->subject)('foo'); @@ -92,7 +83,7 @@ public function invokeReturnsGivenInputIfGivenInputIsValid(): void /** * @return Generator */ - public function invokeThrowsExceptionIfGivenInputIsEmptyDataProvider(): Generator + public static function invokeThrowsExceptionIfGivenInputIsEmptyDataProvider(): Generator { yield 'null' => [null]; yield 'empty string' => ['']; diff --git a/tests/src/IO/Validator/UrlValidatorTest.php b/tests/src/IO/Validator/UrlValidatorTest.php index 8764f9cd..f3fb8797 100644 --- a/tests/src/IO/Validator/UrlValidatorTest.php +++ b/tests/src/IO/Validator/UrlValidatorTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\IO\Validator; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * UrlValidatorTest. @@ -32,7 +32,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class UrlValidatorTest extends TestCase +final class UrlValidatorTest extends Framework\TestCase { private Src\IO\Validator\UrlValidator $subject; @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\UrlValidator(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsNullOnNullInput(): void { $actual = ($this->subject)(null); @@ -51,9 +49,7 @@ public function invokeReturnsNullOnNullInput(): void self::assertNull($actual); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -63,9 +59,7 @@ public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void ($this->subject)('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsGivenInputIfGivenInputIsValid(): void { $actual = ($this->subject)('https://www.example.com'); diff --git a/tests/src/IO/Validator/ValidatorFactoryTest.php b/tests/src/IO/Validator/ValidatorFactoryTest.php index 44655ecd..a4165957 100644 --- a/tests/src/IO/Validator/ValidatorFactoryTest.php +++ b/tests/src/IO/Validator/ValidatorFactoryTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * ValidatorFactoryTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\IO\Validator\ValidatorFactory::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getThrowsExceptionIfGivenTypeIsNotSupported(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -55,9 +54,7 @@ public function getThrowsExceptionIfGivenTypeIsNotSupported(): void $this->subject->get($validator); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getReturnsValidatorForGivenType(): void { $validator = new Src\Builder\Config\ValueObject\PropertyValidator('email'); @@ -65,9 +62,7 @@ public function getReturnsValidatorForGivenType(): void self::assertInstanceOf(Src\IO\Validator\EmailValidator::class, $this->subject->get($validator)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getAllReturnsChainedValidator(): void { $emailValidator = new Src\Builder\Config\ValueObject\PropertyValidator('email'); diff --git a/tests/src/Naming/NameVariantBuilderTest.php b/tests/src/Naming/NameVariantBuilderTest.php index 1d068fe0..bf8f4cf3 100644 --- a/tests/src/Naming/NameVariantBuilderTest.php +++ b/tests/src/Naming/NameVariantBuilderTest.php @@ -26,6 +26,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use Generator; +use PHPUnit\Framework; use UnhandledMatchError; use Webmozart\Assert; @@ -49,9 +50,7 @@ protected function setUp(): void $this->subject = new Src\Naming\NameVariantBuilder($this->instructions); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createVariantThrowsExceptionIfGivenVariantIsUnsupported(): void { $this->expectException(UnhandledMatchError::class); @@ -60,9 +59,7 @@ public function createVariantThrowsExceptionIfGivenVariantIsUnsupported(): void $this->subject->createVariant('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -71,11 +68,8 @@ public function createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable(): $this->subject->createShortVariant(); } - /** - * @test - * - * @dataProvider createShortVariantReturnsShortVariantDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('createShortVariantReturnsShortVariantDataProvider')] public function createShortVariantReturnsShortVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -86,9 +80,7 @@ public function createShortVariantReturnsShortVariant(string $customerName, ?str self::assertSame($expected, $this->subject->createShortVariant()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createShortVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project.customer_name', 'foo bar'); @@ -96,9 +88,7 @@ public function createShortVariantRespectsGivenStringCase(): void self::assertSame('FooBar', $this->subject->createShortVariant(Src\StringCase::UpperCamel->value)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -107,11 +97,8 @@ public function createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvail $this->subject->createAbbreviationVariant(); } - /** - * @test - * - * @dataProvider createAbbreviationVariantReturnsAbbreviationVariantDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('createAbbreviationVariantReturnsAbbreviationVariantDataProvider')] public function createAbbreviationVariantReturnsAbbreviationVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -122,9 +109,7 @@ public function createAbbreviationVariantReturnsAbbreviationVariant(string $cust self::assertSame($expected, $this->subject->createAbbreviationVariant()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createAbbreviationVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project.customer_abbreviation', 'foo bar'); @@ -132,9 +117,7 @@ public function createAbbreviationVariantRespectsGivenStringCase(): void self::assertSame('FooBar', $this->subject->createAbbreviationVariant(Src\StringCase::UpperCamel->value)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -143,11 +126,8 @@ public function createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable(): $this->subject->createFullVariant(); } - /** - * @test - * - * @dataProvider createFullVariantReturnsFullVariantDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('createFullVariantReturnsFullVariantDataProvider')] public function createFullVariantReturnsFullVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -158,9 +138,7 @@ public function createFullVariantReturnsFullVariant(string $customerName, ?strin self::assertSame($expected, $this->subject->createFullVariant()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createFullVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project', [ @@ -171,11 +149,8 @@ public function createFullVariantRespectsGivenStringCase(): void self::assertSame('FooBarBar', $this->subject->createFullVariant(Src\StringCase::UpperCamel->value)); } - /** - * @test - * - * @dataProvider isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] public function isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault(?string $projectName, bool $expected): void { self::assertSame($expected, $this->subject::isDefaultProjectName($projectName)); @@ -184,7 +159,7 @@ public function isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault(?s /** * @return Generator */ - public function createShortVariantReturnsShortVariantDataProvider(): Generator + public static function createShortVariantReturnsShortVariantDataProvider(): Generator { yield 'no project name' => ['foo', null, 'foo']; yield 'default project name' => ['foo', 'basic', 'foo']; @@ -194,7 +169,7 @@ public function createShortVariantReturnsShortVariantDataProvider(): Generator /** * @return Generator */ - public function createAbbreviationVariantReturnsAbbreviationVariantDataProvider(): Generator + public static function createAbbreviationVariantReturnsAbbreviationVariantDataProvider(): Generator { yield 'no project name' => ['foo', null, 'foo']; yield 'default project name' => ['foo', 'basic', 'foo']; @@ -204,7 +179,7 @@ public function createAbbreviationVariantReturnsAbbreviationVariantDataProvider( /** * @return Generator */ - public function createFullVariantReturnsFullVariantDataProvider(): Generator + public static function createFullVariantReturnsFullVariantDataProvider(): Generator { yield 'no project name' => ['foo', null, 'Foo']; yield 'default project name' => ['foo', 'basic', 'Foo']; @@ -214,7 +189,7 @@ public function createFullVariantReturnsFullVariantDataProvider(): Generator /** * @return Generator */ - public function isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider(): Generator + public static function isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider(): Generator { yield 'null' => [null, true]; yield 'basic' => ['basic', true]; diff --git a/tests/src/Resource/Http/PhpApiClientTest.php b/tests/src/Resource/Http/PhpApiClientTest.php index 29fbabe2..40390c5d 100644 --- a/tests/src/Resource/Http/PhpApiClientTest.php +++ b/tests/src/Resource/Http/PhpApiClientTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * PhpApiClientTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Resource\Http\PhpApiClient::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getLatestStableVersionThrowsExceptionOnInvalidResponse(): void { self::$mockHandler->append(self::createErroneousResponse()); @@ -55,9 +54,7 @@ public function getLatestStableVersionThrowsExceptionOnInvalidResponse(): void $this->subject->getLatestStableVersion('8.0'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getLatestStableVersionReturnsLatestStableVersionOfGivenBranch(): void { self::$mockHandler->append(self::createJsonResponse(['version' => '8.0.10'])); @@ -65,9 +62,7 @@ public function getLatestStableVersionReturnsLatestStableVersionOfGivenBranch(): self::assertSame('8.0.10', $this->subject->getLatestStableVersion('8.0')); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getLatestStableVersionFallsBackToDotZeroReleaseIfResponseIsErroneous(): void { self::$mockHandler->append(self::createJsonResponse(['error' => 'Unknown version'])); diff --git a/tests/src/Resource/Local/ComposerTest.php b/tests/src/Resource/Local/ComposerTest.php index 8492baa2..04ae8a1e 100644 --- a/tests/src/Resource/Local/ComposerTest.php +++ b/tests/src/Resource/Local/ComposerTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Symfony\Component\Console; use function dirname; @@ -48,9 +49,7 @@ protected function setUp(): void $this->composerJson = dirname(__DIR__, 2).'/Fixtures/Templates/yaml-template/composer.json'; } - /** - * @test - */ + #[Framework\Attributes\Test] public function installThrowsExceptionIfGivenFileDoesNotExist(): void { $this->expectException(Src\Exception\IOException::class); @@ -60,9 +59,7 @@ public function installThrowsExceptionIfGivenFileDoesNotExist(): void $this->subject->install('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installInstallsComposerDependenciesFromGivenFile(): void { $output = new Console\Output\BufferedOutput(); @@ -75,9 +72,7 @@ public function installInstallsComposerDependenciesFromGivenFile(): void self::assertStringNotContainsString('phpunit', $actualOutput); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installInstallsAllComposerDependenciesIncludingDevDependencies(): void { $output = new Console\Output\BufferedOutput(); @@ -90,9 +85,7 @@ public function installInstallsAllComposerDependenciesIncludingDevDependencies() self::assertStringContainsString('Installing phpunit/phpunit', $actualOutput); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installRestoresInitialComposerEnvironmentVariable(): void { putenv('COMPOSER=foo'); diff --git a/tests/src/Resource/Local/GitTest.php b/tests/src/Resource/Local/GitTest.php index 62bdec6e..8785a3e6 100644 --- a/tests/src/Resource/Local/GitTest.php +++ b/tests/src/Resource/Local/GitTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * GitTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class GitTest extends TestCase +final class GitTest extends Framework\TestCase { private Tests\Fixtures\DummyRunner $runner; private Src\Resource\Local\Git $subject; @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = new Src\Resource\Local\Git($this->runner); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getAuthorNameReturnsGitUserNameConfig(): void { $this->runner->expectedResults[] = ['Alice']; @@ -54,9 +52,7 @@ public function getAuthorNameReturnsGitUserNameConfig(): void self::assertSame('Alice', $this->subject->getAuthorName()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getAuthorNameFallsBackToGitAuthorNameConfig(): void { $this->runner->expectedResults[] = ['', 1]; @@ -65,9 +61,7 @@ public function getAuthorNameFallsBackToGitAuthorNameConfig(): void self::assertSame('Bob', $this->subject->getAuthorName()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getAuthorEmailReturnsGitUserEmailConfig(): void { $this->runner->expectedResults[] = ['foo@bar.de']; @@ -75,9 +69,7 @@ public function getAuthorEmailReturnsGitUserEmailConfig(): void self::assertSame('foo@bar.de', $this->subject->getAuthorEmail()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getAuthorEmailFallsBackToGitAuthorEmailConfig(): void { $this->runner->expectedResults[] = ['', 1]; diff --git a/tests/src/Resource/Local/ProcessedFileTest.php b/tests/src/Resource/Local/ProcessedFileTest.php index db73c17b..0a9c6cc7 100644 --- a/tests/src/Resource/Local/ProcessedFileTest.php +++ b/tests/src/Resource/Local/ProcessedFileTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Resource\Local; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use Symfony\Component\Finder; /** @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ProcessedFileTest extends TestCase +final class ProcessedFileTest extends Framework\TestCase { private Finder\SplFileInfo $originalFile; private Finder\SplFileInfo $targetFile; @@ -46,17 +46,13 @@ protected function setUp(): void $this->subject = new Src\Resource\Local\ProcessedFile($this->originalFile, $this->targetFile); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getOriginalFileReturnsOriginalFile(): void { self::assertSame($this->originalFile, $this->subject->getOriginalFile()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getTargetFileReturnsTargetFile(): void { self::assertSame($this->targetFile, $this->subject->getTargetFile()); diff --git a/tests/src/Template/Provider/BaseProviderTest.php b/tests/src/Template/Provider/BaseProviderTest.php index f623638e..97e3ec53 100644 --- a/tests/src/Template/Provider/BaseProviderTest.php +++ b/tests/src/Template/Provider/BaseProviderTest.php @@ -31,6 +31,7 @@ use CPSIT\ProjectBuilder\Tests; use donatj\MockWebServer; use Generator; +use PHPUnit\Framework; use Symfony\Component\Filesystem; use function array_map; @@ -64,13 +65,11 @@ protected function setUp(): void } /** - * @test - * - * @dataProvider listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider - * * @param list $packages * @param list $expected */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider')] public function listTemplateSourcesListsAllAvailableTemplateSources(array $packages, array $expected): void { $this->subject->packages = $packages; @@ -83,12 +82,10 @@ public function listTemplateSourcesListsAllAvailableTemplateSources(array $packa self::assertEquals($expectedTemplateSources, $this->subject->listTemplateSources()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installTemplateSourceThrowsExceptionIfInstallationFails(): void { - $package = $this->createPackage('foo/baz'); + $package = self::createPackage('foo/baz'); $package->setRequires([ 'foo/boo' => new Package\Link( 'foo/boo', @@ -109,12 +106,10 @@ public function installTemplateSourceThrowsExceptionIfInstallationFails(): void $this->subject->installTemplateSource($templateSource); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installTemplateSourceThrowsExceptionIfInstallationFailsWithGivenConstraint(): void { - $package = $this->createPackage('foo/baz'); + $package = self::createPackage('foo/baz'); $templateSource = new Src\Template\TemplateSource($this->subject, $package); self::$io->setUserInputs(['']); @@ -124,12 +119,10 @@ public function installTemplateSourceThrowsExceptionIfInstallationFailsWithGiven $this->subject->installTemplateSource($templateSource); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid(): void { - $package = $this->createPackageFromTemplateFixture(); + $package = self::createPackageFromTemplateFixture(); $templateSource = new Src\Template\TemplateSource($this->subject, $package); $this->subject->packages = [$package]; @@ -146,12 +139,10 @@ public function installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid(): vo ); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installTemplateSourceFailsIfGivenConstraintCannotBeResolved(): void { - $package = $this->createPackageFromTemplateFixture(); + $package = self::createPackageFromTemplateFixture(); $templateSource = new Src\Template\TemplateSource($this->subject, $package); $this->subject->packages = [$package]; @@ -167,12 +158,10 @@ public function installTemplateSourceFailsIfGivenConstraintCannotBeResolved(): v $this->subject->installTemplateSource($templateSource); } - /** - * @test - */ + #[Framework\Attributes\Test] public function installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallationFailsWithGivenConstraint(): void { - $package = $this->createPackageFromTemplateFixture(); + $package = self::createPackageFromTemplateFixture(); $templateSource = new Src\Template\TemplateSource($this->subject, $package); $this->subject->packages = [$package]; @@ -192,12 +181,10 @@ public function installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallati } /** - * @test - * - * @dataProvider installTemplateSourceInstallsComposerPackageDataProvider - * * @param non-empty-list $packages */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('installTemplateSourceInstallsComposerPackageDataProvider')] public function installTemplateSourceInstallsComposerPackage( array $packages, string $constraint, @@ -216,9 +203,7 @@ public function installTemplateSourceInstallsComposerPackage( self::assertStringContainsString($expected, self::$io->getOutput()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void { $actual = $this->subject->testCreateRepository(); @@ -230,7 +215,7 @@ public function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): voi /** * @return Generator, list}> */ - public function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider(): Generator + public static function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider(): Generator { yield 'no packages' => [ [], @@ -238,17 +223,17 @@ public function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider( ]; yield 'unsupported packages only' => [ [ - $this->createPackage('foo/baz-1', 'library'), - $this->createPackage('foo/baz-2', 'library'), - $this->createPackage('foo/baz-3', 'library'), + self::createPackage('foo/baz-1', 'library'), + self::createPackage('foo/baz-2', 'library'), + self::createPackage('foo/baz-3', 'library'), ], [], ]; yield 'unsupported and supported packages' => [ [ - $this->createPackage('foo/baz-1', 'library'), - $package1 = $this->createPackage('foo/baz-2'), - $package2 = $this->createPackage('foo/baz-3'), + self::createPackage('foo/baz-1', 'library'), + $package1 = self::createPackage('foo/baz-2'), + $package2 = self::createPackage('foo/baz-3'), ], [ $package1, @@ -260,34 +245,34 @@ public function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider( /** * @return Generator, string, non-empty-string}> */ - public function installTemplateSourceInstallsComposerPackageDataProvider(): Generator + public static function installTemplateSourceInstallsComposerPackageDataProvider(): Generator { yield 'no constraint' => [ - [$this->createPackageFromTemplateFixture()], + [self::createPackageFromTemplateFixture()], '', 'Installing project template (1.0.0)... Done', ]; yield 'constraint with one package' => [ - [$this->createPackageFromTemplateFixture(prettyVersion: '1.1.0')], + [self::createPackageFromTemplateFixture(prettyVersion: '1.1.0')], '^1.0', 'Installing project template (1.1.0)... Done', ]; yield 'constraint with multiple packages' => [ [ - $this->createPackageFromTemplateFixture(prettyVersion: '2.0.0'), - $this->createPackageFromTemplateFixture(prettyVersion: '1.2.0'), - $this->createPackageFromTemplateFixture(prettyVersion: '1.1.23'), - $this->createPackageFromTemplateFixture(prettyVersion: '1.1.0'), - $this->createPackageFromTemplateFixture(), + self::createPackageFromTemplateFixture(prettyVersion: '2.0.0'), + self::createPackageFromTemplateFixture(prettyVersion: '1.2.0'), + self::createPackageFromTemplateFixture(prettyVersion: '1.1.23'), + self::createPackageFromTemplateFixture(prettyVersion: '1.1.0'), + self::createPackageFromTemplateFixture(), ], '~1.1.0', 'Installing project template (1.1.23)... Done', ]; } - private function createPackage( + private static function createPackage( string $name, string $type = 'project-builder-template', string $prettyVersion = '1.0.0', @@ -300,7 +285,7 @@ private function createPackage( return $package; } - private function createPackageFromTemplateFixture( + private static function createPackageFromTemplateFixture( string $templateName = 'json-template', string $prettyVersion = '1.0.0', ): Package\Package { @@ -309,7 +294,7 @@ private function createPackageFromTemplateFixture( self::assertDirectoryExists($fixturePath); $composerJson = Src\Resource\Local\Composer::createComposer($fixturePath); - $package = $this->createPackage($composerJson->getPackage()->getName(), prettyVersion: $prettyVersion); + $package = self::createPackage($composerJson->getPackage()->getName(), prettyVersion: $prettyVersion); $package->setDistType('path'); $package->setDistUrl($fixturePath); diff --git a/tests/src/Template/Provider/ComposerProviderTest.php b/tests/src/Template/Provider/ComposerProviderTest.php index e1fb2fde..c7e4c2ce 100644 --- a/tests/src/Template/Provider/ComposerProviderTest.php +++ b/tests/src/Template/Provider/ComposerProviderTest.php @@ -26,6 +26,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use donatj\MockWebServer; +use PHPUnit\Framework; use ReflectionObject; use Symfony\Component\Filesystem; @@ -53,9 +54,7 @@ protected function setUp(): void $this->acceptInsecureConnections(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function requestCustomOptionsAsksAndAppliesBaseUrl(): void { self::$io->setUserInputs(['https://example.com']); @@ -65,9 +64,7 @@ public function requestCustomOptionsAsksAndAppliesBaseUrl(): void self::assertSame('https://example.com', $this->subject->getUrl()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void { $this->expectExceptionObject(Src\Exception\InvalidResourceException::create('url')); @@ -75,9 +72,7 @@ public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void $this->subject->getUrl(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setUrlAppliesGivenUrl(): void { $this->subject->setUrl('https://example.org'); @@ -85,9 +80,7 @@ public function setUrlAppliesGivenUrl(): void self::assertSame('https://example.org', $this->subject->getUrl()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function listTemplateSourcesConnectsToComposerHostToFetchAvailablePackages(): void { $serverUrl = sprintf('http://%s:%s', $this->server->getHost(), $this->server->getPort()); diff --git a/tests/src/Template/Provider/ProviderFactoryTest.php b/tests/src/Template/Provider/ProviderFactoryTest.php index efe4616a..d6c1ea01 100644 --- a/tests/src/Template/Provider/ProviderFactoryTest.php +++ b/tests/src/Template/Provider/ProviderFactoryTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; /** * ProviderFactoryTest. @@ -41,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Template\Provider\ProviderFactory::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -53,9 +52,7 @@ public function getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable(): void $this->subject->get('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getReturnsProviderOfGivenType(): void { self::assertInstanceOf( diff --git a/tests/src/Template/Provider/VcsProviderTest.php b/tests/src/Template/Provider/VcsProviderTest.php index 29fc9d66..9cd3e655 100644 --- a/tests/src/Template/Provider/VcsProviderTest.php +++ b/tests/src/Template/Provider/VcsProviderTest.php @@ -27,6 +27,7 @@ use Composer\Json; use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use ReflectionObject; use ReflectionProperty; use SebastianFeldmann\Cli; @@ -61,9 +62,7 @@ protected function setUp(): void $this->acceptInsecureConnections(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function requestCustomOptionsAsksAndAppliesBaseUrl(): void { self::$io->setUserInputs(['https://example.com']); @@ -73,40 +72,7 @@ public function requestCustomOptionsAsksAndAppliesBaseUrl(): void self::assertSame('https://example.com', $this->subject->getUrl()); } - /** - * @test - */ - public function requestCustomOptionsAsksForAdditionalTransitiveRepositories(): void - { - self::$io->setUserInputs([ - 'https://example.com', - 'yes', - 'vcs', - 'https://example-2.com', - 'yes', - 'composer', - 'https://example-3.com', - ]); - - $this->subject->requestCustomOptions(self::$container->get('app.messenger')); - - $output = self::$io->getOutput(); - $repositories = $this->fetchConfiguredRepositoriesViaReflection(); - - self::assertSame( - [ - ['type' => 'vcs', 'url' => 'https://example-2.com'], - ['type' => 'composer', 'url' => 'https://example-3.com'], - ], - $repositories, - ); - self::assertStringContainsString('Does the repository require additional transitive repositories?', $output); - self::assertStringContainsString('Repository added.', $output); - } - - /** - * @test - */ + #[Framework\Attributes\Test] public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void { $this->expectExceptionObject(Src\Exception\InvalidResourceException::create('url')); @@ -114,9 +80,7 @@ public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void $this->subject->getUrl(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setUrlAppliesGivenUrl(): void { $this->subject->setUrl('https://example.org'); @@ -124,20 +88,12 @@ public function setUrlAppliesGivenUrl(): void self::assertSame('https://example.org', $this->subject->getUrl()); } - /** - * @test - */ - public function listTemplateSourcesRespectsAllConfiguredRepositories(): void + #[Framework\Attributes\Test] + public function listTemplateSourcesListsTemplatesFromConfiguredRepository(): void { $repoA = $this->initializeGitRepository('test/repo-a', ['test/repo-b' => '*']); - $repoB = $this->initializeGitRepository('test/repo-b'); - self::$io->setUserInputs([ - $repoA, - 'yes', - 'vcs', - $repoB, - ]); + self::$io->setUserInputs([$repoA]); $this->subject->requestCustomOptions(self::$container->get('app.messenger')); @@ -148,19 +104,17 @@ public function listTemplateSourcesRespectsAllConfiguredRepositories(): void self::assertArrayHasKey('test/repo-b', $actual[0]->getPackage()->getRequires()); $this->filesystem->remove($repoA); - $this->filesystem->remove($repoB); } - /** - * @test - */ - public function installTemplateSourceRespectsAllConfiguredRepositories(): void + #[Framework\Attributes\Test] + public function installTemplateSourceAsksForAdditionalRepositories(): void { $repoA = $this->initializeGitRepository('test/repo-a', ['test/repo-b' => '*']); $repoB = $this->initializeGitRepository('test/repo-b'); self::$io->setUserInputs([ $repoA, + '', 'yes', 'vcs', $repoB, @@ -180,6 +134,19 @@ public function installTemplateSourceRespectsAllConfiguredRepositories(): void self::assertDirectoryExists($this->rootPath.'/.build/templates/repo-a'); self::assertDirectoryExists($this->rootPath.'/.build/templates/repo-b'); + $output = self::$io->getOutput(); + $repositories = $this->fetchConfiguredRepositoriesViaReflection(); + + self::assertSame( + [ + ['type' => 'vcs', 'url' => $repoB], + ], + $repositories, + ); + self::assertStringContainsString('Unable to install test/repo-a.', $output); + self::assertStringContainsString('Are additional transitive packages required?', $output); + self::assertStringContainsString('Package added.', $output); + $this->filesystem->remove($repoA); $this->filesystem->remove($repoB); $this->filesystem->remove($this->rootPath.'/.build/templates/repo-a'); diff --git a/tests/src/Template/TemplateSourceTest.php b/tests/src/Template/TemplateSourceTest.php index 55404537..f51a67f4 100644 --- a/tests/src/Template/TemplateSourceTest.php +++ b/tests/src/Template/TemplateSourceTest.php @@ -27,7 +27,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * TemplateSourceTest. @@ -35,7 +35,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class TemplateSourceTest extends TestCase +final class TemplateSourceTest extends Framework\TestCase { private Tests\Fixtures\DummyProvider $provider; private Package\PackageInterface $package; @@ -48,25 +48,19 @@ protected function setUp(): void $this->subject = new Src\Template\TemplateSource($this->provider, $this->package); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getProviderReturnsProvider(): void { self::assertSame($this->provider, $this->subject->getProvider()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function getPackageReturnsPackage(): void { self::assertSame($this->package, $this->subject->getPackage()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function setPackageAppliesGivenPackage(): void { $newPackage = clone $this->package; @@ -74,19 +68,14 @@ public function setPackageAppliesGivenPackage(): void self::assertSame($newPackage, $this->subject->setPackage($newPackage)->getPackage()); } - /** - * @test - */ + #[Framework\Attributes\Test] public function shouldUseDynamicVersionConstraintReturnsFalseInitially(): void { self::assertFalse($this->subject->shouldUseDynamicVersionConstraint()); } - /** - * @test - * - * @dataProvider useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider')] public function useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraint( bool $useDynamicVersionConstraint, bool $expected, @@ -99,7 +88,7 @@ public function useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionCons /** * @return Generator */ - public function useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider(): Generator + public static function useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider(): Generator { yield 'true' => [true, true]; yield 'false' => [false, false]; diff --git a/tests/src/Twig/Filter/ConvertCaseFilterTest.php b/tests/src/Twig/Filter/ConvertCaseFilterTest.php index 037116f7..01ee0b4c 100644 --- a/tests/src/Twig/Filter/ConvertCaseFilterTest.php +++ b/tests/src/Twig/Filter/ConvertCaseFilterTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Twig\Filter; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use Webmozart\Assert; /** @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ConvertCaseFilterTest extends TestCase +final class ConvertCaseFilterTest extends Framework\TestCase { private Src\Twig\Filter\ConvertCaseFilter $subject; @@ -42,9 +42,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Filter\ConvertCaseFilter(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -53,9 +51,7 @@ public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void ($this->subject)(null); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenCaseIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -64,9 +60,7 @@ public function invokeThrowsAssertionErrorIfGivenCaseIsNotAString(): void ($this->subject)('foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsCaseConvertedString(): void { $actual = ($this->subject)('foo', Src\StringCase::Upper->value); diff --git a/tests/src/Twig/Filter/SlugifyFilterTest.php b/tests/src/Twig/Filter/SlugifyFilterTest.php index c0a6c200..72beef00 100644 --- a/tests/src/Twig/Filter/SlugifyFilterTest.php +++ b/tests/src/Twig/Filter/SlugifyFilterTest.php @@ -26,6 +26,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use Generator; +use PHPUnit\Framework; use Webmozart\Assert; use function error_reporting; @@ -46,9 +47,7 @@ protected function setUp(): void error_reporting(E_WARNING); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -57,11 +56,8 @@ public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void ($this->subject)(null); } - /** - * @test - * - * @dataProvider invokeReturnsSlugForGivenInputDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsSlugForGivenInputDataProvider')] public function invokeReturnsSlugForGivenInput(?string $separator, string $expected): void { $actual = ($this->subject)('foo bar', $separator); @@ -72,7 +68,7 @@ public function invokeReturnsSlugForGivenInput(?string $separator, string $expec /** * @return Generator */ - public function invokeReturnsSlugForGivenInputDataProvider(): Generator + public static function invokeReturnsSlugForGivenInputDataProvider(): Generator { yield 'default separator' => [null, 'foo-bar']; yield 'custom separator' => ['_', 'foo_bar']; diff --git a/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php b/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php index 1b6f8e5e..c39960c7 100644 --- a/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php +++ b/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * DefaultAuthorEmailFunctionTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class DefaultAuthorEmailFunctionTest extends TestCase +final class DefaultAuthorEmailFunctionTest extends Framework\TestCase { private Tests\Fixtures\DummyRunner $runner; private Src\Twig\Func\DefaultAuthorEmailFunction $subject; @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultAuthorEmailFunction(new Src\Resource\Local\Git($this->runner)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsAuthorEmailFromGit(): void { $this->runner->expectedResults[] = ['foo@bar.de']; diff --git a/tests/src/Twig/Func/DefaultAuthorNameFunctionTest.php b/tests/src/Twig/Func/DefaultAuthorNameFunctionTest.php index a4ce7e88..7affc89f 100644 --- a/tests/src/Twig/Func/DefaultAuthorNameFunctionTest.php +++ b/tests/src/Twig/Func/DefaultAuthorNameFunctionTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * DefaultAuthorNameFunctionTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class DefaultAuthorNameFunctionTest extends TestCase +final class DefaultAuthorNameFunctionTest extends Framework\TestCase { private Tests\Fixtures\DummyRunner $runner; private Src\Twig\Func\DefaultAuthorNameFunction $subject; @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultAuthorNameFunction(new Src\Resource\Local\Git($this->runner)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsAuthorNameFromGit(): void { $this->runner->expectedResults[] = ['Foo Bar']; diff --git a/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php b/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php index e56f49d6..67abfacc 100644 --- a/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php +++ b/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * DefaultProjectNameFunctionTest. @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class DefaultProjectNameFunctionTest extends TestCase +final class DefaultProjectNameFunctionTest extends Framework\TestCase { private Src\Twig\Func\DefaultProjectNameFunction $subject; @@ -42,11 +42,8 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultProjectNameFunction(); } - /** - * @test - * - * @dataProvider invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] public function invokeReturnsTrueIfGivenProjectNameIsTheDefault(?string $projectName, bool $expected): void { $actual = ($this->subject)($projectName); @@ -57,7 +54,7 @@ public function invokeReturnsTrueIfGivenProjectNameIsTheDefault(?string $project /** * @return Generator */ - public function invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider(): Generator + public static function invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider(): Generator { yield 'null' => [null, true]; yield 'basic' => ['basic', true]; diff --git a/tests/src/Twig/Func/NameVariantFunctionTest.php b/tests/src/Twig/Func/NameVariantFunctionTest.php index 8b69232a..c07c774d 100644 --- a/tests/src/Twig/Func/NameVariantFunctionTest.php +++ b/tests/src/Twig/Func/NameVariantFunctionTest.php @@ -26,6 +26,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; use Generator; +use PHPUnit\Framework; use Webmozart\Assert; /** @@ -43,9 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\NameVariantFunction(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenVariantIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -54,9 +53,7 @@ public function invokeThrowsExceptionIfGivenVariantIsNull(): void ($this->subject)(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructions(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -67,13 +64,11 @@ public function invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructio } /** - * @test - * - * @dataProvider invokeReturnsNameVariantDataProvider - * * @param value-of $variant * @param value-of|null $case */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsNameVariantDataProvider')] public function invokeReturnsNameVariant(string $variant, ?string $case, ?string $expected): void { $instructions = new Src\Builder\BuildInstructions( @@ -94,7 +89,7 @@ public function invokeReturnsNameVariant(string $variant, ?string $case, ?string /** * @return Generator, value-of|null, string}> */ - public function invokeReturnsNameVariantDataProvider(): Generator + public static function invokeReturnsNameVariantDataProvider(): Generator { yield 'abbreviation' => [Src\Naming\NameVariant::Abbreviation->value, null, 'bar']; yield 'short name' => [Src\Naming\NameVariant::ShortName->value, null, 'bar']; diff --git a/tests/src/Twig/Func/PhpVersionFunctionTest.php b/tests/src/Twig/Func/PhpVersionFunctionTest.php index ee64126b..ccc29914 100644 --- a/tests/src/Twig/Func/PhpVersionFunctionTest.php +++ b/tests/src/Twig/Func/PhpVersionFunctionTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use Webmozart\Assert; /** @@ -42,9 +43,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Twig\Func\PhpVersionFunction::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenBranchIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -53,9 +52,7 @@ public function invokeThrowsExceptionIfGivenBranchIsNull(): void ($this->subject)(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsAndCachesLatestStableVersionOfGivenBranch(): void { self::$mockHandler->append(self::createJsonResponse(['version' => '8.0.10'])); diff --git a/tests/src/Twig/Func/ResolveIpFunctionTest.php b/tests/src/Twig/Func/ResolveIpFunctionTest.php index 76657acb..d7b855b9 100644 --- a/tests/src/Twig/Func/ResolveIpFunctionTest.php +++ b/tests/src/Twig/Func/ResolveIpFunctionTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use Generator; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use Webmozart\Assert; /** @@ -34,7 +34,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ResolveIpFunctionTest extends TestCase +final class ResolveIpFunctionTest extends Framework\TestCase { private Src\Twig\Func\ResolveIpFunction $subject; @@ -43,9 +43,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\ResolveIpFunction(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenHostnameIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -54,9 +52,7 @@ public function invokeThrowsExceptionIfGivenHostnameIsNull(): void ($this->subject)(); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsNullIfUrlCannotBeResolved(): void { $actual = ($this->subject)('https://'); @@ -64,9 +60,7 @@ public function invokeReturnsNullIfUrlCannotBeResolved(): void self::assertNull($actual); } - /** - * @test - */ + #[Framework\Attributes\Test] public function invokeReturnsNullIfIpAddressCannotBeResolved(): void { $actual = ($this->subject)('foo.bar'); @@ -74,11 +68,8 @@ public function invokeReturnsNullIfIpAddressCannotBeResolved(): void self::assertNull($actual); } - /** - * @test - * - * @dataProvider invokeReturnsResolvedIpAddressDataProvider - */ + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsResolvedIpAddressDataProvider')] public function invokeReturnsResolvedIpAddress(string $hostname): void { $actual = ($this->subject)($hostname); @@ -90,7 +81,7 @@ public function invokeReturnsResolvedIpAddress(string $hostname): void /** * @return Generator */ - public function invokeReturnsResolvedIpAddressDataProvider(): Generator + public static function invokeReturnsResolvedIpAddressDataProvider(): Generator { yield 'hostname' => ['www.example.com']; yield 'url' => ['https://www.example.com']; diff --git a/tests/src/Twig/RendererTest.php b/tests/src/Twig/RendererTest.php index f2e71cdc..f0dd4a99 100644 --- a/tests/src/Twig/RendererTest.php +++ b/tests/src/Twig/RendererTest.php @@ -25,6 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; +use PHPUnit\Framework; use function dirname; use function json_decode; @@ -54,9 +55,7 @@ protected function setUp(): void $this->eventListener = self::$container->get(Tests\Fixtures\DummyTemplateRenderingEventListener::class); } - /** - * @test - */ + #[Framework\Attributes\Test] public function renderThrowsExceptionIfNoTemplateIsDefined(): void { $this->expectException(Src\Exception\TemplateRenderingException::class); @@ -66,9 +65,7 @@ public function renderThrowsExceptionIfNoTemplateIsDefined(): void $this->subject->render($this->instructions); } - /** - * @test - */ + #[Framework\Attributes\Test] public function renderThrowsExceptionIfTemplateIsMissing(): void { $this->expectException(Src\Exception\TemplateRenderingException::class); @@ -78,9 +75,7 @@ public function renderThrowsExceptionIfTemplateIsMissing(): void $this->subject->render($this->instructions, 'foo'); } - /** - * @test - */ + #[Framework\Attributes\Test] public function renderWithConfiguredFilesystemLoaderRendersTemplate(): void { self::assertFalse($this->eventListener->dispatched); @@ -91,9 +86,7 @@ public function renderWithConfiguredFilesystemLoaderRendersTemplate(): void self::assertTrue($this->eventListener->dispatched); } - /** - * @test - */ + #[Framework\Attributes\Test] public function renderWithConfiguredArrayLoaderRendersTemplate(): void { $subject = $this->subject->withDefaultTemplate('Hello {{ name }}!'); @@ -106,9 +99,7 @@ public function renderWithConfiguredArrayLoaderRendersTemplate(): void self::assertTrue($this->eventListener->dispatched); } - /** - * @test - */ + #[Framework\Attributes\Test] public function renderMergesBuildInstructionsAndAdditionalVariables(): void { $this->instructions->addTemplateVariable('foo', 'foo'); @@ -128,9 +119,7 @@ public function renderMergesBuildInstructionsAndAdditionalVariables(): void self::assertSame($expected, json_decode($actual, true, 512, JSON_THROW_ON_ERROR)); } - /** - * @test - */ + #[Framework\Attributes\Test] public function renderRespectsVariablesModifiedThroughDispatchedEvent(): void { $subject = $this->subject->withDefaultTemplate('Hello {{ name }}!'); @@ -147,9 +136,7 @@ public function renderRespectsVariablesModifiedThroughDispatchedEvent(): void self::assertTrue($this->eventListener->dispatched); } - /** - * @test - */ + #[Framework\Attributes\Test] public function canRenderReturnsChecksWhetherGivenTemplateCanBeRendered(): void { self::assertTrue($this->subject->canRender('dummy.twig'));