From d3ea24ed3ca290c40c912108ddf36ca6c6e33379 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Wed, 22 Feb 2023 14:02:47 +0100 Subject: [PATCH 01/42] [FEATURE] Increase step description verbosity --- src/IO/Messenger.php | 16 +++++++++++++++- src/Template/Provider/BaseProvider.php | 22 +++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/IO/Messenger.php b/src/IO/Messenger.php index 8c252f12..23100d38 100644 --- a/src/IO/Messenger.php +++ b/src/IO/Messenger.php @@ -79,10 +79,15 @@ public function clearScreen(): void public function welcome(): void { $this->getIO()->write([ - ''.Emoji::SPARKLES.' Welcome to the CPS Project Builder!', + ''.Emoji::SPARKLES.' Welcome to the CPS Project Builder!', '======================================', ]); $this->newLine(); + + $this->comment( + ' +The Project Builder helps you create Composer based projects with specific \'templates\'. Such a template itself holds all project related information such a Composer dependencies and configuration.', + ); } public function section(string $name): void @@ -100,6 +105,7 @@ public function section(string $name): void public function comment(string $comment): void { $this->write(''.$comment.''); + $this->newLine(); } /** @@ -153,6 +159,14 @@ public function selectTemplateSource(Template\Provider\ProviderInterface $provid throw Exception\InvalidTemplateSourceException::forProvider($provider); } + $this->comment( + sprintf( + 'Here is a list of templates we found on %s. +Select one that best suits your project or select a different repository provider.', + preg_replace('(^https?://)', '', $provider->getUrl()), + ), + ); + $labels = array_map([$this, 'decorateTemplateSource'], $templateSources); $labels[] = 'Try another template provider.'; diff --git a/src/Template/Provider/BaseProvider.php b/src/Template/Provider/BaseProvider.php index 2ccb8a67..cb0db890 100644 --- a/src/Template/Provider/BaseProvider.php +++ b/src/Template/Provider/BaseProvider.php @@ -158,8 +158,28 @@ protected function requestPackageVersionConstraint(Template\TemplateSource $temp $inputReader = $this->messenger->createInputReader(); $repository = $templateSource->getPackage()->getRepository() ?? $this->createRepository(); + $this->messenger->writeWithEmoji( + IO\Emoji::WHITE_HEAVY_CHECK_MARK, + sprintf( + 'Well done! You\'ve selected %s.', + $templateSource->getPackage()->getName(), + ), + ); + + $this->messenger->newLine(); + + $this->messenger->comment( + sprintf( + 'Do you require a specific version of %s? +If so you may specify it here. Leave this empty we\'ll just grab the latest stable version.', + $templateSource->getPackage()->getName(), + ), + ); + + $this->messenger->comment('Example: \'0.2.0\' or \'dev-feature/xyz\''); + $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'], ]), From 8cf80f24796cf348504afab39f7e678528304926 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Wed, 22 Feb 2023 14:50:41 +0100 Subject: [PATCH 02/42] [TASK] Increase legibility --- src/IO/Messenger.php | 1 - src/Template/Provider/BaseProvider.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/IO/Messenger.php b/src/IO/Messenger.php index 23100d38..46ffb6ca 100644 --- a/src/IO/Messenger.php +++ b/src/IO/Messenger.php @@ -83,7 +83,6 @@ public function welcome(): void '======================================', ]); $this->newLine(); - $this->comment( ' The Project Builder helps you create Composer based projects with specific \'templates\'. Such a template itself holds all project related information such a Composer dependencies and configuration.', diff --git a/src/Template/Provider/BaseProvider.php b/src/Template/Provider/BaseProvider.php index cb0db890..2be17476 100644 --- a/src/Template/Provider/BaseProvider.php +++ b/src/Template/Provider/BaseProvider.php @@ -171,7 +171,7 @@ protected function requestPackageVersionConstraint(Template\TemplateSource $temp $this->messenger->comment( sprintf( 'Do you require a specific version of %s? -If so you may specify it here. Leave this empty we\'ll just grab the latest stable version.', +If so, you may specify it here. Leave this empty we\'ll just grab the latest stable version.', $templateSource->getPackage()->getName(), ), ); From c90f61bc5a68f4ac15d8cf5a324dc6e9faa3022b Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 23 Feb 2023 13:54:52 +0100 Subject: [PATCH 03/42] [TASK] Clarify input options for providers --- src/IO/Messenger.php | 25 ++++++++++------------ src/Template/Provider/BaseProvider.php | 2 +- src/Template/Provider/ComposerProvider.php | 2 +- src/Template/Provider/VcsProvider.php | 2 +- tests/src/Console/ApplicationTest.php | 4 ++-- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/IO/Messenger.php b/src/IO/Messenger.php index 3fc90239..956534d7 100644 --- a/src/IO/Messenger.php +++ b/src/IO/Messenger.php @@ -79,13 +79,18 @@ public function clearScreen(): void public function welcome(): void { $this->getIO()->write([ - ''.Emoji::SPARKLES.' Welcome to the Project Builder!', - '======================================', + ''.Emoji::SPARKLES.' Welcome to the Project Builder!', + '==================================', ]); $this->newLine(); $this->comment( ' -The Project Builder helps you create Composer based projects with specific \'templates\'. Such a template itself holds all project related information such a Composer dependencies and configuration.', +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->comment( + 'You may find templates on public and private providers/registries such as Satis, GitLab or GitHub. +Let\'s start by looking for templates on Packagist.org:', ); } @@ -158,21 +163,13 @@ public function selectTemplateSource(Template\Provider\ProviderInterface $provid throw Exception\InvalidTemplateSourceException::forProvider($provider); } - $this->comment( - sprintf( - 'Here is a list of templates we found on %s. -Select one that best suits your project or select a different repository provider.', - preg_replace('(^https?://)', '', $provider->getUrl()), - ), - ); - $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, ); @@ -448,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/Template/Provider/BaseProvider.php b/src/Template/Provider/BaseProvider.php index e4a52a2b..1ada617b 100644 --- a/src/Template/Provider/BaseProvider.php +++ b/src/Template/Provider/BaseProvider.php @@ -161,7 +161,7 @@ protected function requestPackageVersionConstraint(Template\TemplateSource $temp $this->messenger->writeWithEmoji( IO\Emoji::WHITE_HEAVY_CHECK_MARK, sprintf( - 'Well done! You\'ve selected %s.', + 'Well done! You\'ve selected %s.', $templateSource->getPackage()->getName(), ), ); diff --git a/src/Template/Provider/ComposerProvider.php b/src/Template/Provider/ComposerProvider.php index a52a95dd..b16ea813 100644 --- a/src/Template/Provider/ComposerProvider.php +++ b/src/Template/Provider/ComposerProvider.php @@ -92,7 +92,7 @@ protected function getRepositoryType(): string public static function getName(): string { - return 'Custom Composer registry'; + return 'Custom Composer registry (e.g. Satis or GitLab registry)'; } public static function getType(): string diff --git a/src/Template/Provider/VcsProvider.php b/src/Template/Provider/VcsProvider.php index c18c2d49..16d7b54a 100644 --- a/src/Template/Provider/VcsProvider.php +++ b/src/Template/Provider/VcsProvider.php @@ -88,7 +88,7 @@ protected function getRepositoryType(): string public static function getName(): string { - return 'VCS repository'; + return 'VCS repository (e.g. GitHub or GitLab)'; } public static function getType(): string diff --git a/tests/src/Console/ApplicationTest.php b/tests/src/Console/ApplicationTest.php index e2d43c6c..dcda361c 100644 --- a/tests/src/Console/ApplicationTest.php +++ b/tests/src/Console/ApplicationTest.php @@ -143,7 +143,7 @@ public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProvide $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); } /** @@ -212,7 +212,7 @@ public function runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured(): voi $this->targetDirectory, ); - self::$io->setUserInputs(['Try another template provider.']); + self::$io->setUserInputs(['Try a different provider (e.g. Satis or GitHub)']); $subject->run(); From 845f89ac2d191f8059165f9b025afbaa37c9a7dc Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 23 Feb 2023 14:17:24 +0100 Subject: [PATCH 04/42] [TASK] Add examples to URL inputs --- src/Template/Provider/ComposerProvider.php | 4 ++-- src/Template/Provider/VcsProvider.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Template/Provider/ComposerProvider.php b/src/Template/Provider/ComposerProvider.php index b16ea813..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 (e.g. Satis or GitLab 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 16d7b54a..eb691a82 100644 --- a/src/Template/Provider/VcsProvider.php +++ b/src/Template/Provider/VcsProvider.php @@ -47,7 +47,7 @@ public function requestCustomOptions(IO\Messenger $messenger): void { $inputReader = $messenger->createInputReader(); - $this->url = $inputReader->staticValue('Repository URL', required: true); + $this->url = $inputReader->staticValue('Repository URL (e.g. https://github.com/vendor/template.git)', required: true); while ($inputReader->ask('Does the repository require additional transitive repositories?', default: false)) { $this->repositories[] = [ @@ -88,7 +88,7 @@ protected function getRepositoryType(): string public static function getName(): string { - return 'VCS repository (e.g. GitHub or GitLab)'; + return 'VCS repository (e.g. GitHub)'; } public static function getType(): string From 494bef3e30d96beeed91373d8e894ee084cd1fa8 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Wed, 1 Mar 2023 12:01:44 +0100 Subject: [PATCH 05/42] [TASK] Language washing --- src/Template/Provider/BaseProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Template/Provider/BaseProvider.php b/src/Template/Provider/BaseProvider.php index 5b3945fb..5ebcb522 100644 --- a/src/Template/Provider/BaseProvider.php +++ b/src/Template/Provider/BaseProvider.php @@ -190,7 +190,7 @@ protected function requestPackageVersionConstraint(Template\TemplateSource $temp $this->messenger->comment( sprintf( 'Do you require a specific version of %s? -If so, you may specify it here. Leave this empty we\'ll just grab the latest stable version.', +If so, you may specify it here. Leave it empty and we\'ll find a current version for you.', $templateSource->getPackage()->getName(), ), ); From 9eff49a24798fce0514da02840b33e0ac0cb475b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 19 Mar 2023 16:13:28 +0000 Subject: [PATCH 06/42] [TASK] Update PHPStan packages --- composer.lock | 87 +++++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/composer.lock b/composer.lock index d19e25c8..f3a13ba2 100644 --- a/composer.lock +++ b/composer.lock @@ -4940,16 +4940,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.10.7", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b10ceb526d9607903c5b2673f1fc8775dbe48975", + "reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975", "shasum": "" }, "require": { @@ -4978,8 +4978,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 +4998,25 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-03-16T15:24:20+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 +5044,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.10", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7" + "reference": "4cc5c6cc38e56bce7ea47c4091814e516d172dc3" }, "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/4cc5c6cc38e56bce7ea47c4091814e516d172dc3", + "reference": "4cc5c6cc38e56bce7ea47c4091814e516d172dc3", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.3" + "phpstan/phpstan": "^1.10" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -5093,31 +5096,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.10" }, - "time": "2022-12-21T15:25:00+00:00" + "time": "2023-03-02T10:25:13+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.4.5", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "361f75b06066f3fdaba87c1f57bdb1ffc28d6f1d" + "reference": "b7dd96a5503919a43b3cd06a2dced9d4252492f2" }, "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/b7dd96a5503919a43b3cd06a2dced9d4252492f2", + "reference": "b7dd96a5503919a43b3cd06a2dced9d4252492f2", "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 +5145,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.0" }, - "time": "2023-01-11T14:16:29+00:00" + "time": "2023-02-21T10:17:10+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.2.20", + "version": "1.2.23", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "d89a521e7e31822409bf37f70691f7a12a6e7d76" + "reference": "8a8d0538ca943b20beda7e9799e14fb3683262d4" }, "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/8a8d0538ca943b20beda7e9799e14fb3683262d4", + "reference": "8a8d0538ca943b20beda7e9799e14fb3683262d4", "shasum": "" }, "require": { "ext-simplexml": "*", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.1" + "phpstan/phpstan": "^1.9.4" }, "conflict": { "symfony/framework-bundle": "<3.0" @@ -5212,31 +5216,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.23" }, - "time": "2023-01-15T12:28:31+00:00" + "time": "2023-02-06T10:42:02+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,9 +5267,9 @@ "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", From 1ecf7ee3126e07ab3c566c6d23c51aacabfd0055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sun, 19 Mar 2023 20:20:27 +0100 Subject: [PATCH 07/42] [BUGFIX] Handle probably invalid validator options --- .../MisconfiguredValidatorException.php | 31 ++++++++++ src/IO/Validator/AbstractValidator.php | 11 ++++ .../MisconfiguredValidatorExceptionTest.php | 61 +++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 tests/src/Exception/MisconfiguredValidatorExceptionTest.php 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/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/tests/src/Exception/MisconfiguredValidatorExceptionTest.php b/tests/src/Exception/MisconfiguredValidatorExceptionTest.php new file mode 100644 index 00000000..bd6fa0d3 --- /dev/null +++ b/tests/src/Exception/MisconfiguredValidatorExceptionTest.php @@ -0,0 +1,61 @@ + + * + * 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\Exception; + +use CPSIT\ProjectBuilder as Src; +use PHPUnit\Framework\TestCase; + +/** + * MisconfiguredValidatorExceptionTest. + * + * @author Elias Häußler + * @license GPL-3.0-or-later + */ +final class MisconfiguredValidatorExceptionTest extends TestCase +{ + /** + * @test + */ + public function forUnexpectedOptionReturnsExceptionForUnexpectedOption(): void + { + $actual = Src\Exception\MisconfiguredValidatorException::forUnexpectedOption('foo', 'baz'); + + self::assertSame('The validator option "baz" of validator "foo" is invalid.', $actual->getMessage()); + self::assertSame(1673886742, $actual->getCode()); + } + + /** + * @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()); + } +} From 87d90d6f40aafcf173628e19d7d4f091067e1b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sun, 19 Mar 2023 20:20:36 +0100 Subject: [PATCH 08/42] [BUGFIX] Use correct type annotation --- src/IO/Validator/ValidatorFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From bb9bcf7685038a60dbcea64a8a6de995e111e626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sun, 19 Mar 2023 20:26:12 +0100 Subject: [PATCH 09/42] [TASK] Update to Rector v0.15.21 --- composer.lock | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index f3a13ba2..3fde35d3 100644 --- a/composer.lock +++ b/composer.lock @@ -5769,21 +5769,21 @@ }, { "name": "rector/rector", - "version": "0.15.17", + "version": "0.15.21", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "7f6ee7974175138864d3b50c28ea73a7b0fd4e2d" + "reference": "1cee8cc5d6d836e1bf9a3006d7b062adde3a6022" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/7f6ee7974175138864d3b50c28ea73a7b0fd4e2d", - "reference": "7f6ee7974175138864d3b50c28ea73a7b0fd4e2d", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/1cee8cc5d6d836e1bf9a3006d7b062adde3a6022", + "reference": "1cee8cc5d6d836e1bf9a3006d7b062adde3a6022", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.9.14" + "phpstan/phpstan": "^1.10.1" }, "conflict": { "rector/rector-doctrine": "*", @@ -5810,9 +5810,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.21" }, "funding": [ { @@ -5820,7 +5826,7 @@ "type": "github" } ], - "time": "2023-02-17T20:34:07+00:00" + "time": "2023-03-06T11:44:29+00:00" }, { "name": "sebastian/cli-parser", From 009c571fdcb934c4502a3fbc9d2d3abacf745d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sun, 19 Mar 2023 20:26:28 +0100 Subject: [PATCH 10/42] [TASK] Simplify types --- .../Generator/Step/Interaction/QuestionInteractionTest.php | 4 +--- .../Generator/Step/Interaction/SelectInteractionTest.php | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php b/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php index 7f31ef40..2a1c7aab 100644 --- a/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php @@ -89,9 +89,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 +101,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..41308f00 100644 --- a/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php @@ -117,12 +117,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 = []; From a67e61a786555736656e20905191627d5b0ce8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sun, 19 Mar 2023 20:31:42 +0100 Subject: [PATCH 11/42] [TASK] Add test case for invalid validator option handling --- .../IO/Validator/AbstractValidatorTest.php | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/src/IO/Validator/AbstractValidatorTest.php diff --git a/tests/src/IO/Validator/AbstractValidatorTest.php b/tests/src/IO/Validator/AbstractValidatorTest.php new file mode 100644 index 00000000..838e94ed --- /dev/null +++ b/tests/src/IO/Validator/AbstractValidatorTest.php @@ -0,0 +1,55 @@ + + * + * 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\TestCase; + +/** + * AbstractValidatorTest. + * + * @author Elias Häußler + * @license GPL-3.0-or-later + */ +final class AbstractValidatorTest extends TestCase +{ + /** + * @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, + ]); + } +} From 33ed3b19843d3e02855fd651effc4f9a3ff61e77 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 19 Mar 2023 19:36:44 +0000 Subject: [PATCH 12/42] [TASK] Update composer.lock --- composer.lock | 415 ++++++++++++++++++++++++++------------------------ 1 file changed, 212 insertions(+), 203 deletions(-) diff --git a/composer.lock b/composer.lock index 3fde35d3..f05a817b 100644 --- a/composer.lock +++ b/composer.lock @@ -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.4", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "923278ad13e1621946eb76ab2882655d2cc396a4" + "reference": "6b67eeea4d72051c369ccdbfb2423a56e2ab51a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/923278ad13e1621946eb76ab2882655d2cc396a4", - "reference": "923278ad13e1621946eb76ab2882655d2cc396a4", + "url": "https://api.github.com/repos/composer/composer/zipball/6b67eeea4d72051c369ccdbfb2423a56e2ab51a9", + "reference": "6b67eeea4d72051c369ccdbfb2423a56e2ab51a9", "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.4" }, "funding": [ { @@ -3348,7 +3277,7 @@ "type": "tidelift" } ], - "time": "2022-12-22T14:33:54+00:00" + "time": "2023-02-15T12:10:06+00:00" }, { "name": "composer/metadata-minifier", @@ -6967,20 +6896,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" }, @@ -6989,15 +6918,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": { @@ -7029,7 +6959,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": [ { @@ -7045,7 +6975,7 @@ "type": "tidelift" } ], - "time": "2023-01-11T11:50:03+00:00" + "time": "2023-02-24T10:42:00+00:00" }, { "name": "symfony/options-resolver", @@ -7439,6 +7369,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", From f97c6d650ed3885a5b6e68a19a3c19135d0f6cd9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 01:15:15 +0000 Subject: [PATCH 13/42] [TASK] Update actions/deploy-pages action to v2 --- .github/workflows/documentation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 7e63a420419ba8c9aa5e0755f8ed412bbfa86d7b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 12:28:39 +0000 Subject: [PATCH 14/42] [TASK] Update rector/rector to v0.15.22 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index f05a817b..254ee137 100644 --- a/composer.lock +++ b/composer.lock @@ -5698,16 +5698,16 @@ }, { "name": "rector/rector", - "version": "0.15.21", + "version": "0.15.22", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "1cee8cc5d6d836e1bf9a3006d7b062adde3a6022" + "reference": "5c499ec662a698d5042a3cdc936a4642ada35e19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/1cee8cc5d6d836e1bf9a3006d7b062adde3a6022", - "reference": "1cee8cc5d6d836e1bf9a3006d7b062adde3a6022", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/5c499ec662a698d5042a3cdc936a4642ada35e19", + "reference": "5c499ec662a698d5042a3cdc936a4642ada35e19", "shasum": "" }, "require": { @@ -5747,7 +5747,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.21" + "source": "https://github.com/rectorphp/rector/tree/0.15.22" }, "funding": [ { @@ -5755,7 +5755,7 @@ "type": "github" } ], - "time": "2023-03-06T11:44:29+00:00" + "time": "2023-03-22T09:37:21+00:00" }, { "name": "sebastian/cli-parser", From 2afd8b17301efb3d6e4e190ccd3e570002185d3e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 18:07:47 +0000 Subject: [PATCH 15/42] [TASK] Update rector/rector to v0.15.23 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 254ee137..9eec9e6b 100644 --- a/composer.lock +++ b/composer.lock @@ -5698,16 +5698,16 @@ }, { "name": "rector/rector", - "version": "0.15.22", + "version": "0.15.23", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "5c499ec662a698d5042a3cdc936a4642ada35e19" + "reference": "f4984ebd62b3613002869b0ddd6868261d62819e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/5c499ec662a698d5042a3cdc936a4642ada35e19", - "reference": "5c499ec662a698d5042a3cdc936a4642ada35e19", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/f4984ebd62b3613002869b0ddd6868261d62819e", + "reference": "f4984ebd62b3613002869b0ddd6868261d62819e", "shasum": "" }, "require": { @@ -5747,7 +5747,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.22" + "source": "https://github.com/rectorphp/rector/tree/0.15.23" }, "funding": [ { @@ -5755,7 +5755,7 @@ "type": "github" } ], - "time": "2023-03-22T09:37:21+00:00" + "time": "2023-03-22T15:22:45+00:00" }, { "name": "sebastian/cli-parser", From 7ef9df458d7e30ca36183953d82b8da9e4dfba89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 23 Mar 2023 15:59:29 +0100 Subject: [PATCH 16/42] [TASK] Improve user flow for adding additional VCS packages --- src/IO/Messenger.php | 18 +++--- src/Template/Provider/BaseProvider.php | 20 +++---- src/Template/Provider/VcsProvider.php | 57 +++++++++++++++--- tests/src/Console/ApplicationTest.php | 3 +- .../src/Template/Provider/VcsProviderTest.php | 58 ++++++------------- 5 files changed, 82 insertions(+), 74 deletions(-) diff --git a/src/IO/Messenger.php b/src/IO/Messenger.php index 2149cce9..5e393443 100644 --- a/src/IO/Messenger.php +++ b/src/IO/Messenger.php @@ -86,17 +86,14 @@ public function welcome(): void $this->getIO()->write([ ''.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( - ' -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->comment( - 'You may find templates on public and private providers/registries such as Satis, GitLab or GitHub. -Let\'s start by looking for templates on Packagist.org:', - ); + $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 @@ -114,7 +111,6 @@ public function section(string $name): void public function comment(string $comment): void { $this->write(''.$comment.''); - $this->newLine(); } /** @@ -169,7 +165,7 @@ public function selectTemplateSource(Template\Provider\ProviderInterface $provid } $labels = array_map($this->decorateTemplateSource(...), $templateSources); - $labels[] = 'Try a different provider (e.g. Satis or GitHub)'; + $labels[] = 'Try a different provider (e.g. Satis or GitHub)'; $defaultIdentifier = array_key_first($templateSources); diff --git a/src/Template/Provider/BaseProvider.php b/src/Template/Provider/BaseProvider.php index 5ebcb522..7a3f02ce 100644 --- a/src/Template/Provider/BaseProvider.php +++ b/src/Template/Provider/BaseProvider.php @@ -179,23 +179,19 @@ protected function requestPackageVersionConstraint(Template\TemplateSource $temp $this->messenger->writeWithEmoji( IO\Emoji::WhiteHeavyCheckMark->value, - sprintf( - 'Well done! You\'ve selected %s.', - $templateSource->getPackage()->getName(), - ), + 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( - sprintf( - 'Do you require a specific version of %s? -If so, you may specify it here. Leave it empty and we\'ll find a current version for you.', - $templateSource->getPackage()->getName(), - ), + 'If so, you may specify it here. Leave it empty and we\'ll find a current version for you.', ); - - $this->messenger->comment('Example: \'0.2.0\' or \'dev-feature/xyz\''); + $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: ', diff --git a/src/Template/Provider/VcsProvider.php b/src/Template/Provider/VcsProvider.php index 33fe0b8d..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 (e.g. https://github.com/vendor/template.git)', 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]; diff --git a/tests/src/Console/ApplicationTest.php b/tests/src/Console/ApplicationTest.php index dcda361c..5b96c9a0 100644 --- a/tests/src/Console/ApplicationTest.php +++ b/tests/src/Console/ApplicationTest.php @@ -204,6 +204,7 @@ public function runGeneratesNewProjectFromSelectedTemplate(): void */ public function runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured(): void { + $packageCount = count(self::$container->get(Src\Template\Provider\PackagistProvider::class)->listTemplateSources()); $subject = new Src\Console\Application( $this->messenger, $this->configReader, @@ -212,7 +213,7 @@ public function runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured(): voi $this->targetDirectory, ); - self::$io->setUserInputs(['Try a different provider (e.g. Satis or GitHub)']); + self::$io->setUserInputs([(string) $packageCount]); $subject->run(); diff --git a/tests/src/Template/Provider/VcsProviderTest.php b/tests/src/Template/Provider/VcsProviderTest.php index 46768c98..b92bb89b 100644 --- a/tests/src/Template/Provider/VcsProviderTest.php +++ b/tests/src/Template/Provider/VcsProviderTest.php @@ -76,37 +76,6 @@ 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 */ @@ -130,17 +99,11 @@ public function setUrlAppliesGivenUrl(): void /** * @test */ - public function listTemplateSourcesRespectsAllConfiguredRepositories(): void + 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')); @@ -151,19 +114,19 @@ 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 + 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, @@ -183,6 +146,19 @@ public function installTemplateSourceRespectsAllConfiguredRepositories(): void self::assertDirectoryExists($this->temporaryRootPath.'/.build/templates/repo-a'); self::assertDirectoryExists($this->temporaryRootPath.'/.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); } From f702005b7f9743e9059b437266558e15f3363ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 23 Mar 2023 16:06:46 +0100 Subject: [PATCH 17/42] [TASK] Make Rector happy --- tests/src/Console/ApplicationTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/src/Console/ApplicationTest.php b/tests/src/Console/ApplicationTest.php index 5b96c9a0..1117434b 100644 --- a/tests/src/Console/ApplicationTest.php +++ b/tests/src/Console/ApplicationTest.php @@ -204,7 +204,10 @@ public function runGeneratesNewProjectFromSelectedTemplate(): void */ public function runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured(): void { - $packageCount = count(self::$container->get(Src\Template\Provider\PackagistProvider::class)->listTemplateSources()); + /** @var Src\Template\Provider\PackagistProvider $packagistProvider */ + $packagistProvider = self::$container->get(Src\Template\Provider\PackagistProvider::class); + $packageCount = count($packagistProvider->listTemplateSources()); + $subject = new Src\Console\Application( $this->messenger, $this->configReader, From fd054ad6bf24418e8e7627c372fd4b9ee5574f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 23 Mar 2023 16:19:54 +0100 Subject: [PATCH 18/42] [TASK] Use different foreground color for constraint examples --- src/Template/Provider/BaseProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Template/Provider/BaseProvider.php b/src/Template/Provider/BaseProvider.php index 7a3f02ce..f1d12eb0 100644 --- a/src/Template/Provider/BaseProvider.php +++ b/src/Template/Provider/BaseProvider.php @@ -190,7 +190,7 @@ protected function requestPackageVersionConstraint(Template\TemplateSource $temp '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->comment('Example: 2.1.0 or dev-feature/xyz'); $this->messenger->newLine(); $constraint = $inputReader->staticValue( From 9e0d37ec199551d974efa3e3853db9982428aaf0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 08:17:25 +0000 Subject: [PATCH 19/42] [TASK] Update phpunit/phpunit to v10 --- composer.json | 2 +- composer.lock | 578 ++++++++++++++++++++------------------------------ 2 files changed, 226 insertions(+), 354 deletions(-) diff --git a/composer.json b/composer.json index ad82b57d..2b5e6a64 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,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 9eec9e6b..c0787c88 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": "fb7f9f6efd93ef92f282f4e53ff4d37b", + "content-hash": "0517d4351b5e1840371c05540fa43725", "packages": [ { "name": "cocur/slugify", @@ -3722,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", @@ -5202,16 +5132,16 @@ }, { "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": { @@ -5219,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", @@ -5239,7 +5169,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.0-dev" } }, "autoload": { @@ -5267,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": [ { @@ -5275,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": { @@ -5327,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": [ { @@ -5335,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": "*" @@ -5364,7 +5294,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -5390,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": [ { @@ -5398,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": { @@ -5449,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": [ { @@ -5457,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": { @@ -5508,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": [ { @@ -5516,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.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" + "reference": "07d386a11ac7094032900f07cada1c8975d16607" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/07d386a11ac7094032900f07cada1c8975d16607", + "reference": "07d386a11ac7094032900f07cada1c8975d16607", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -5543,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" @@ -5571,7 +5499,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.0-dev" } }, "autoload": { @@ -5602,7 +5530,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.16" }, "funding": [ { @@ -5618,7 +5546,7 @@ "type": "tidelift" } ], - "time": "2023-03-09T06:34:10+00:00" + "time": "2023-03-13T09:02:40+00:00" }, { "name": "react/promise", @@ -5759,28 +5687,28 @@ }, { "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": { @@ -5803,7 +5731,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": [ { @@ -5811,32 +5739,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": { @@ -5859,7 +5787,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": [ { @@ -5867,32 +5795,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": { @@ -5914,7 +5842,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": [ { @@ -5922,34 +5850,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": { @@ -5988,7 +5918,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": [ { @@ -5996,33 +5926,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": { @@ -6045,7 +5975,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": [ { @@ -6053,33 +5983,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.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "70dd1b20bc198da394ad542e988381b44e64e39f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/70dd1b20bc198da394ad542e988381b44e64e39f", + "reference": "70dd1b20bc198da394ad542e988381b44e64e39f", "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": { @@ -6111,7 +6041,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.0" }, "funding": [ { @@ -6119,27 +6049,27 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-02-03T07:00:31+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": "*" @@ -6147,7 +6077,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -6166,7 +6096,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", @@ -6174,7 +6104,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": [ { @@ -6182,34 +6112,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": { @@ -6251,7 +6181,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": [ { @@ -6259,38 +6189,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": { @@ -6315,7 +6242,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": [ { @@ -6323,33 +6250,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": { @@ -6372,7 +6299,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": [ { @@ -6380,34 +6307,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": { @@ -6429,7 +6356,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": [ { @@ -6437,32 +6364,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": { @@ -6484,7 +6411,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": [ { @@ -6492,32 +6419,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": { @@ -6547,7 +6474,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": [ { @@ -6555,87 +6482,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": { @@ -6658,7 +6530,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": [ { @@ -6666,29 +6538,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": { @@ -6711,7 +6583,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": [ { @@ -6719,7 +6591,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "seld/jsonlint", From 71b0b1a9a20175a2625d53cb0a3607209f6f657a Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 23 Mar 2023 16:54:20 +0100 Subject: [PATCH 20/42] [TASK] Migrate PHPUnit @test annotations --- tests/src/Builder/BuildInstructionsTest.php | 36 +++--------- tests/src/Builder/BuildResultTest.php | 36 +++--------- .../src/Builder/Config/ConfigFactoryTest.php | 12 +--- tests/src/Builder/Config/ConfigReaderTest.php | 28 +++------- tests/src/Builder/Config/ConfigTest.php | 36 +++--------- tests/src/Builder/Config/FileTypeTest.php | 22 ++------ .../Config/ValueObject/FileConditionTest.php | 20 ++----- .../Config/ValueObject/PropertyOptionTest.php | 8 +-- .../Config/ValueObject/PropertyTest.php | 32 +++-------- .../ValueObject/PropertyValidatorTest.php | 8 +-- .../Config/ValueObject/StepOptionsTest.php | 12 +--- .../Builder/Config/ValueObject/StepTest.php | 4 +- .../Config/ValueObject/SubPropertyTest.php | 36 +++--------- tests/src/Builder/Generator/GeneratorTest.php | 20 ++----- .../Generator/Step/CleanUpStepTest.php | 12 +--- .../Step/CollectBuildInstructionsStepTest.php | 8 +-- .../Step/DumpBuildArtifactStepTest.php | 20 ++----- .../Step/GenerateBuildArtifactStepTest.php | 13 ++--- .../InstallComposerDependenciesStepTest.php | 8 +-- .../Interaction/InteractionFactoryTest.php | 8 +-- .../Interaction/QuestionInteractionTest.php | 12 +--- .../Interaction/SelectInteractionTest.php | 20 ++----- .../Step/ProcessSharedSourceFilesStepTest.php | 8 +-- .../Step/ProcessSourceFilesStepTest.php | 14 ++--- .../Generator/Step/ShowNextStepsStepTest.php | 16 ++---- .../Generator/Step/StepFactoryTest.php | 8 +-- .../Builder/Writer/GenericFileWriterTest.php | 8 +-- .../src/Builder/Writer/JsonFileWriterTest.php | 7 +-- .../src/Builder/Writer/TemplateWriterTest.php | 8 +-- .../src/Builder/Writer/WriterFactoryTest.php | 8 +-- tests/src/Console/ApplicationTest.php | 36 +++--------- tests/src/Error/ErrorHandlerTest.php | 10 +--- .../Event/BeforeTemplateRenderedEventTest.php | 16 ++---- .../src/Event/BuildStepProcessedEventTest.php | 12 +--- .../src/Event/BuildStepRevertedEventTest.php | 8 +-- .../Event/ProjectBuildFinishedEventTest.php | 4 +- .../Event/ProjectBuildStartedEventTest.php | 4 +- .../MisconfiguredValidatorExceptionTest.php | 8 +-- tests/src/Helper/ArrayHelperTest.php | 8 +-- tests/src/Helper/FilesystemHelperTest.php | 16 ++---- tests/src/Helper/StringHelperTest.php | 16 ++---- tests/src/IO/InputReaderTest.php | 12 +--- tests/src/IO/MessengerTest.php | 26 +++------ ...Test.php => AbstractValidatorTestCase.php} | 6 +- .../IO/Validator/CallbackValidatorTest.php | 15 ++--- .../src/IO/Validator/ChainedValidatorTest.php | 24 ++------ tests/src/IO/Validator/EmailValidatorTest.php | 12 +--- .../IO/Validator/NotEmptyValidatorTest.php | 19 ++----- tests/src/IO/Validator/UrlValidatorTest.php | 12 +--- .../src/IO/Validator/ValidatorFactoryTest.php | 12 +--- tests/src/Naming/NameVariantBuilderTest.php | 56 +++++-------------- tests/src/Resource/Http/PhpApiClientTest.php | 12 +--- tests/src/Resource/Local/ComposerTest.php | 16 ++---- tests/src/Resource/Local/GitTest.php | 16 ++---- .../src/Resource/Local/ProcessedFileTest.php | 8 +-- .../Template/Provider/BaseProviderTest.php | 36 ++++-------- .../Provider/ComposerProviderTest.php | 16 ++---- .../Template/Provider/ProviderFactoryTest.php | 8 +-- .../src/Template/Provider/VcsProviderTest.php | 20 ++----- tests/src/Template/TemplateSourceTest.php | 23 ++------ .../src/Twig/Filter/ConvertCaseFilterTest.php | 12 +--- tests/src/Twig/Filter/SlugifyFilterTest.php | 11 +--- .../Func/DefaultAuthorEmailFunctionTest.php | 4 +- .../Func/DefaultAuthorNameFunctionTest.php | 4 +- .../Func/DefaultProjectNameFunctionTest.php | 7 +-- .../src/Twig/Func/NameVariantFunctionTest.php | 14 ++--- .../src/Twig/Func/PhpVersionFunctionTest.php | 8 +-- tests/src/Twig/Func/ResolveIpFunctionTest.php | 19 ++----- tests/src/Twig/RendererTest.php | 28 +++------- 69 files changed, 279 insertions(+), 803 deletions(-) rename tests/src/IO/Validator/{AbstractValidatorTest.php => AbstractValidatorTestCase.php} (94%) diff --git a/tests/src/Builder/BuildInstructionsTest.php b/tests/src/Builder/BuildInstructionsTest.php index c83a815b..3b75edd4 100644 --- a/tests/src/Builder/BuildInstructionsTest.php +++ b/tests/src/Builder/BuildInstructionsTest.php @@ -47,41 +47,31 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getConfigReturnsConfig(): void { self::assertSame(self::$container->get('app.config'), $this->subject->getConfig()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTemplateDirectoryReturnsTemplateDirectory(): void { self::assertSame(dirname(__DIR__), $this->subject->getTemplateDirectory()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getSourceDirectoryReturnsSourceDirectory(): void { self::assertSame(dirname(__DIR__).'/templates/src', $this->subject->getSourceDirectory()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getSharedSourceDirectoryReturnsSharedSourceDirectory(): void { self::assertSame(dirname(__DIR__).'/templates/shared', $this->subject->getSharedSourceDirectory()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { $actual = $this->subject->getTemporaryDirectory(); @@ -90,17 +80,13 @@ public function getTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void self::assertStringStartsWith(sys_get_temp_dir(), $actual); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTargetDirectoryReturnsTargetDirectory(): void { self::assertSame('foo', $this->subject->getTargetDirectory()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTemplateVariablesReturnsTemplateVariables(): void { self::assertSame([], $this->subject->getTemplateVariables()); @@ -110,9 +96,7 @@ public function getTemplateVariablesReturnsTemplateVariables(): void self::assertSame(['foo' => 'bar'], $this->subject->getTemplateVariables()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTemplateVariableReturnsTemplateVariableAtGivenPath(): void { self::assertNull($this->subject->getTemplateVariable('foo.bar.hello')); @@ -126,9 +110,7 @@ public function getTemplateVariableReturnsTemplateVariableAtGivenPath(): void self::assertSame('world!', $this->subject->getTemplateVariable('foo.bar.hello')); } - /** - * @test - */ + #[\PHPUnit\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..8a82b89c 100644 --- a/tests/src/Builder/BuildResultTest.php +++ b/tests/src/Builder/BuildResultTest.php @@ -51,26 +51,20 @@ protected function setUp(): void $this->subject = new Src\Builder\BuildResult($this->instructions); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getInstructionsReturnsInstructions(): void { self::assertSame($this->instructions, $this->subject->getInstructions()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function isMirroredReturnsMirrorState(): void { self::assertFalse($this->subject->isMirrored()); self::assertTrue($this->subject->setMirrored(true)->isMirrored()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getBuildArtifactReturnsBuildArtifact(): void { self::assertNull($this->subject->getBuildArtifact()); @@ -84,9 +78,7 @@ public function getBuildArtifactReturnsBuildArtifact(): void self::assertSame($buildArtifact, $this->subject->setBuildArtifact($buildArtifact)->getBuildArtifact()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getAppliedStepsReturnsAppliedSteps(): void { $step = new Tests\Fixtures\DummyStep(); @@ -98,9 +90,7 @@ public function getAppliedStepsReturnsAppliedSteps(): void self::assertSame([$step::getType() => $step], $this->subject->getAppliedSteps()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function isStepAppliedTestsWhetherStepIsApplied(): void { $step = new Tests\Fixtures\DummyStep(); @@ -117,9 +107,7 @@ public function isStepAppliedTestsWhetherStepIsApplied(): void )); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function applyStepAddsStepToAppliedSteps(): void { $step = new Tests\Fixtures\DummyStep(); @@ -131,9 +119,7 @@ public function applyStepAddsStepToAppliedSteps(): void self::assertTrue($this->subject->isStepApplied($step)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getProcessedFilesReturnsProcessedFiles(): void { self::assertSame([], $this->subject->getProcessedFiles()); @@ -151,17 +137,13 @@ public function getProcessedFilesReturnsProcessedFiles(): void self::assertSame([$barFile], $this->subject->getProcessedFiles('/bar')); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getWrittenDirectoryReturnsTemporaryDirectoryIfBuildWasNotMirrored(): void { self::assertSame($this->instructions->getTemporaryDirectory(), $this->subject->getWrittenDirectory()); } - /** - * @test - */ + #[\PHPUnit\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..66c3546e 100644 --- a/tests/src/Builder/Config/ConfigFactoryTest.php +++ b/tests/src/Builder/Config/ConfigFactoryTest.php @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = Src\Builder\Config\ConfigFactory::create(); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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..75ec18e8 100644 --- a/tests/src/Builder/Config/ConfigReaderTest.php +++ b/tests/src/Builder/Config/ConfigReaderTest.php @@ -45,9 +45,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createCreatesTemplateDirectoryIfItDoesNotExist(): void { $templateDirectory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -59,9 +57,7 @@ public function createCreatesTemplateDirectoryIfItDoesNotExist(): void self::assertDirectoryExists($templateDirectory); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function readConfigThrowsExceptionIfTemplateHasNoComposerJson(): void { $templateDirectory = dirname(__DIR__, 2).'/Fixtures'; @@ -74,9 +70,7 @@ public function readConfigThrowsExceptionIfTemplateHasNoComposerJson(): void $subject->readConfig('foo'); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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..71c1a24a 100644 --- a/tests/src/Builder/Config/ConfigTest.php +++ b/tests/src/Builder/Config/ConfigTest.php @@ -53,25 +53,19 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getIdentifierReturnsIdentifier(): void { self::assertSame('identifier', $this->subject->getIdentifier()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getNameReturnsName(): void { self::assertSame('name', $this->subject->getName()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getStepsReturnsSteps(): void { self::assertEquals( @@ -82,9 +76,7 @@ public function getStepsReturnsSteps(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getPropertiesReturnsProperties(): void { self::assertEquals( @@ -95,9 +87,7 @@ public function getPropertiesReturnsProperties(): void ); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function setDeclaringFileAppliesDeclaringFile(): void { self::assertSame('foo', $this->subject->setDeclaringFile('foo')->getDeclaringFile()); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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..da90afe1 100644 --- a/tests/src/Builder/Config/FileTypeTest.php +++ b/tests/src/Builder/Config/FileTypeTest.php @@ -35,9 +35,7 @@ */ final class FileTypeTest extends TestCase { - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\DataProvider('fromExtensionReturnsFileTypeOfGivenExtensionDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] 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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\DataProvider('fromFileReturnsFileTypeOfGivenFileDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function fromFileReturnsFileTypeOfGivenFile( string $file, Src\Builder\Config\FileType $expected, diff --git a/tests/src/Builder/Config/ValueObject/FileConditionTest.php b/tests/src/Builder/Config/ValueObject/FileConditionTest.php index 14236657..6edcd5f2 100644 --- a/tests/src/Builder/Config/ValueObject/FileConditionTest.php +++ b/tests/src/Builder/Config/ValueObject/FileConditionTest.php @@ -42,33 +42,25 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\FileCondition('foo', 'bar', 'target'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('foo', $this->subject->getPath()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getConditionReturnsCondition(): void { self::assertSame('bar', $this->subject->getCondition()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function hasConditionReturnsTrue(): void { self::assertTrue($this->subject->hasCondition()); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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..605046c2 100644 --- a/tests/src/Builder/Config/ValueObject/PropertyOptionTest.php +++ b/tests/src/Builder/Config/ValueObject/PropertyOptionTest.php @@ -42,17 +42,13 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\PropertyOption('foo', 'bar'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getValueReturnsValue(): void { self::assertSame('foo', $this->subject->getValue()); } - /** - * @test - */ + #[\PHPUnit\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..159fbf5d 100644 --- a/tests/src/Builder/Config/ValueObject/PropertyTest.php +++ b/tests/src/Builder/Config/ValueObject/PropertyTest.php @@ -54,9 +54,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getSubPropertiesReturnsSubProperties(): void { self::assertEquals( @@ -71,9 +69,7 @@ public function getSubPropertiesReturnsSubProperties(): void ); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function getIdentifierReturnsIdentifier(): void { self::assertSame('identifier', $this->subject->getIdentifier()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('path', $this->subject->getPath()); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function getNameReturnsName(): void { self::assertSame('name', $this->subject->getName()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getValueReturnsValue(): void { self::assertSame('value', $this->subject->getValue()); } - /** - * @test - */ + #[\PHPUnit\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..d04dc1b2 100644 --- a/tests/src/Builder/Config/ValueObject/PropertyValidatorTest.php +++ b/tests/src/Builder/Config/ValueObject/PropertyValidatorTest.php @@ -41,17 +41,13 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\PropertyValidator('foo', ['bar' => 'bar']); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getOptionsReturnsOptions(): void { self::assertSame(['bar' => 'bar'], $this->subject->getOptions()); } - /** - * @test - */ + #[\PHPUnit\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..a5e12fa7 100644 --- a/tests/src/Builder/Config/ValueObject/StepOptionsTest.php +++ b/tests/src/Builder/Config/ValueObject/StepOptionsTest.php @@ -47,9 +47,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getFileConditionsReturnsFileConditions(): void { self::assertEquals( @@ -60,17 +58,13 @@ public function getFileConditionsReturnsFileConditions(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTemplateFileReturnsTemplateFile(): void { self::assertSame('foo', $this->subject->getTemplateFile()); } - /** - * @test - */ + #[\PHPUnit\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..4b8f0b14 100644 --- a/tests/src/Builder/Config/ValueObject/StepTest.php +++ b/tests/src/Builder/Config/ValueObject/StepTest.php @@ -44,9 +44,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\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..c50b6c1f 100644 --- a/tests/src/Builder/Config/ValueObject/SubPropertyTest.php +++ b/tests/src/Builder/Config/ValueObject/SubPropertyTest.php @@ -57,17 +57,13 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('path', $this->subject->getPath()); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function getOptionsReturnsOptions(): void { self::assertEquals( @@ -93,25 +87,19 @@ public function getOptionsReturnsOptions(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function canHaveMultipleValuesReturnsTrue(): void { self::assertTrue($this->subject->canHaveMultipleValues()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getDefaultValueReturnsDefaultValue(): void { self::assertSame('defaultValue', $this->subject->getDefaultValue()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getValidatorsReturnsValidators(): void { self::assertEquals( @@ -122,9 +110,7 @@ public function getValidatorsReturnsValidators(): void ); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function getParentReturnsParentProperty(): void { self::assertEquals( @@ -152,9 +136,7 @@ public function getParentReturnsParentProperty(): void ); } - /** - * @test - */ + #[\PHPUnit\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 a3d53398..39610cb0 100644 --- a/tests/src/Builder/Generator/GeneratorTest.php +++ b/tests/src/Builder/Generator/GeneratorTest.php @@ -50,9 +50,7 @@ protected function setUp(): void $this->targetDirectory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runRunsThroughAllConfiguredSteps(): void { self::$io->setUserInputs(['foo']); @@ -89,9 +87,7 @@ public function runRunsThroughAllConfiguredSteps(): void self::assertInstanceOf(Src\Event\ProjectBuildFinishedEvent::class, $this->eventListener->dispatchedEvents[6]); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runRevertsAppliedStepsOnStepFailure(): void { $exception = null; @@ -120,9 +116,7 @@ public function runRevertsAppliedStepsOnStepFailure(): void self::assertInstanceOf(Src\Event\BuildStepRevertedEvent::class, $this->eventListener->dispatchedEvents[2]); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runRevertsAppliedStepsAndExistsIfStoppableStepFailed(): void { self::$io->setUserInputs(['foo', 'no']); @@ -133,9 +127,7 @@ public function runRevertsAppliedStepsAndExistsIfStoppableStepFailed(): void self::assertFalse($actual->isMirrored()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function dumpArtifactDumpsBuildArtifact(): void { self::$io->setUserInputs(['foo']); @@ -147,9 +139,7 @@ public function dumpArtifactDumpsBuildArtifact(): void self::assertTrue($result->isStepApplied('dumpBuildArtifact')); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function cleanUpCleansUpRemainingFilesInTargetDirectory(): void { self::$io->setUserInputs(['foo']); diff --git a/tests/src/Builder/Generator/Step/CleanUpStepTest.php b/tests/src/Builder/Generator/Step/CleanUpStepTest.php index e6349c77..1b4d3566 100644 --- a/tests/src/Builder/Generator/Step/CleanUpStepTest.php +++ b/tests/src/Builder/Generator/Step/CleanUpStepTest.php @@ -52,9 +52,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runCleansUpRemainingFilesInTargetDirectory(): void { $targetDirectory = $this->result->getInstructions()->getTargetDirectory(); @@ -72,9 +70,7 @@ public function runCleansUpRemainingFilesInTargetDirectory(): void self::assertTrue($this->result->isStepApplied('cleanUp')); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function revertThrowsException(): void { $this->expectException(LogicException::class); @@ -84,9 +80,7 @@ public function revertThrowsException(): void $this->subject->revert($this->result); } - /** - * @test - */ + #[\PHPUnit\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..fdab4efe 100644 --- a/tests/src/Builder/Generator/Step/CollectBuildInstructionsStepTest.php +++ b/tests/src/Builder/Generator/Step/CollectBuildInstructionsStepTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\CollectBuildInstructionsStep::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runAppliesNullAsDefaultValueOnSkippedProperties(): void { $config = new Src\Builder\Config\Config( @@ -73,9 +71,7 @@ public function runAppliesNullAsDefaultValueOnSkippedProperties(): void self::assertNull($buildResult->getInstructions()->getTemplateVariable('foo')); } - /** - * @test - */ + #[\PHPUnit\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..febd7c3f 100644 --- a/tests/src/Builder/Generator/Step/DumpBuildArtifactStepTest.php +++ b/tests/src/Builder/Generator/Step/DumpBuildArtifactStepTest.php @@ -60,9 +60,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runDoesNothingIfBuildArtifactWasNotGenerated(): void { self::assertTrue($this->subject->run($this->buildResult)); @@ -70,9 +68,7 @@ public function runDoesNothingIfBuildArtifactWasNotGenerated(): void self::assertFileDoesNotExist($this->buildArtifact->getFile()->getPathname()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runDumpsBuildArtifact(): void { $this->buildResult->setBuildArtifact($this->buildArtifact); @@ -86,9 +82,7 @@ public function runDumpsBuildArtifact(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function revertDoesNothingIfBuildArtifactWasNotGenerated(): void { $artifactPath = $this->buildArtifact->getFile()->getPathname(); @@ -104,9 +98,7 @@ public function revertDoesNothingIfBuildArtifactWasNotGenerated(): void self::assertStringEqualsFile($artifactPath, 'test'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function revertRemovesDumpedBuildArtifact(): void { $artifactPath = $this->buildArtifact->getFile()->getPathname(); @@ -124,9 +116,7 @@ public function revertRemovesDumpedBuildArtifact(): void self::assertFileDoesNotExist($artifactPath); } - /** - * @test - */ + #[\PHPUnit\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..7c605892 100644 --- a/tests/src/Builder/Generator/Step/GenerateBuildArtifactStepTest.php +++ b/tests/src/Builder/Generator/Step/GenerateBuildArtifactStepTest.php @@ -54,11 +54,8 @@ protected function setUp(): void ); } - /** - * @test - * - * @dataProvider runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function runAsksForConfirmationIfBuildArtifactPathAlreadyExists(bool $continue, bool $expected): void { self::$io->setUserInputs([$continue ? 'yes' : 'no']); @@ -76,9 +73,7 @@ public function runAsksForConfirmationIfBuildArtifactPathAlreadyExists(bool $con ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runGeneratesBuildArtifact(): void { self::assertTrue($this->subject->run($this->buildResult)); @@ -89,7 +84,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..0e70ab7c 100644 --- a/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php +++ b/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php @@ -52,18 +52,14 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runInstallsComposerDependencies(): void { self::assertTrue($this->subject->run($this->buildResult)); self::assertTrue($this->buildResult->isStepApplied($this->subject)); } - /** - * @test - */ + #[\PHPUnit\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..e7b599e4 100644 --- a/tests/src/Builder/Generator/Step/Interaction/InteractionFactoryTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/InteractionFactoryTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\Interaction\InteractionFactory::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -53,9 +51,7 @@ public function getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable(): void $this->subject->get('foo'); } - /** - * @test - */ + #[\PHPUnit\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 2a1c7aab..0f2a595d 100644 --- a/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/QuestionInteractionTest.php @@ -43,9 +43,7 @@ protected function setUp(): void $this->instructions = new Src\Builder\BuildInstructions(self::$config, 'foo'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactUsesTruAndFalseAsDefaultYesNoValues(): void { $interactionSubject = $this->buildInteractionSubject(); @@ -56,9 +54,7 @@ public function interactUsesTruAndFalseAsDefaultYesNoValues(): void self::assertFalse($this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactReturnsValueFromMatchingOption(): void { $interactionSubject = $this->buildInteractionSubject([ @@ -72,9 +68,7 @@ public function interactReturnsValueFromMatchingOption(): void self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactUsesFallbackConditionIfOnlyOptionValueIsConfigured(): void { $interactionSubject = $this->buildInteractionSubject([ diff --git a/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php b/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php index 41308f00..1bd17457 100644 --- a/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php +++ b/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php @@ -43,9 +43,7 @@ protected function setUp(): void $this->instructions = new Src\Builder\BuildInstructions(self::$config, 'foo'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactReturnsNullOnEmptyUserInput(): void { $interactionSubject = $this->buildInteractionSubject(); @@ -53,9 +51,7 @@ public function interactReturnsNullOnEmptyUserInput(): void self::assertNull($this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection(): void { $propertyOptions = [ @@ -67,9 +63,7 @@ public function interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection() self::assertSame('foo', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection(): void { $propertyOptions = [ @@ -81,9 +75,7 @@ public function interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection( self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactReturnsSelectedOption(): void { $propertyOptions = [ @@ -97,9 +89,7 @@ public function interactReturnsSelectedOption(): void self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function interactReturnsSelectedOptionsIfMultipleOptionsAreAllowed(): void { $propertyOptions = [ diff --git a/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php b/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php index d5a6e392..246cfebd 100644 --- a/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php +++ b/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php @@ -48,9 +48,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runProcessesSourceFilesAndAppliesStep(): void { $actual = $this->subject->run($this->result); @@ -67,9 +65,7 @@ public function runProcessesSourceFilesAndAppliesStep(): void self::assertTrue($this->result->isStepApplied($this->subject)); } - /** - * @test - */ + #[\PHPUnit\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..27fb0ded 100644 --- a/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php +++ b/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php @@ -51,9 +51,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runProcessesSourceFilesAndAppliesStep(): void { $actual = $this->subject->run($this->result); @@ -71,13 +69,11 @@ public function runProcessesSourceFilesAndAppliesStep(): void } /** - * @test - * - * @dataProvider runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider - * * @param list $fileConditions * @param list $notExpected */ + #[\PHPUnit\Framework\Attributes\DataProvider('runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function runCanProcessTheSameSourceFileWithMultipleConditions( array $fileConditions, string $expected, @@ -106,9 +102,7 @@ public function runCanProcessTheSameSourceFileWithMultipleConditions( } } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function revertRemovesProcessedFiles(): void { $this->subject->run($this->result); diff --git a/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php b/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php index fb63bacd..8f88b181 100644 --- a/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php +++ b/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php @@ -47,9 +47,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runThrowsExceptionIfNoTemplateFileIsGiven(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -59,9 +57,7 @@ public function runThrowsExceptionIfNoTemplateFileIsGiven(): void $this->subject->run($this->result); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runThrowsExceptionIfTemplateFileDoesNotExist(): void { $this->subject->setConfig( @@ -78,9 +74,7 @@ public function runThrowsExceptionIfTemplateFileDoesNotExist(): void $this->subject->run($this->result); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runThrowsExceptionIfTemplateFileCannotBeRendered(): void { $this->subject->setConfig( @@ -100,9 +94,7 @@ public function runThrowsExceptionIfTemplateFileCannotBeRendered(): void $this->subject->run($this->result); } - /** - * @test - */ + #[\PHPUnit\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..54d07ec7 100644 --- a/tests/src/Builder/Generator/Step/StepFactoryTest.php +++ b/tests/src/Builder/Generator/Step/StepFactoryTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\StepFactory::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getThrowsExceptionIfGivenStepIsNotSupported(): void { $step = new Src\Builder\Config\ValueObject\Step('foo'); @@ -55,9 +53,7 @@ public function getThrowsExceptionIfGivenStepIsNotSupported(): void $this->subject->get($step); } - /** - * @test - */ + #[\PHPUnit\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..8f7db351 100644 --- a/tests/src/Builder/Writer/GenericFileWriterTest.php +++ b/tests/src/Builder/Writer/GenericFileWriterTest.php @@ -46,9 +46,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\GenericFileWriter::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function writeCopiesGivenFileToTemporaryDirectory(): void { $instructions = new Src\Builder\BuildInstructions( @@ -67,9 +65,7 @@ public function writeCopiesGivenFileToTemporaryDirectory(): void (new Filesystem\Filesystem())->remove(dirname($expected)); } - /** - * @test - */ + #[\PHPUnit\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..45f0773d 100644 --- a/tests/src/Builder/Writer/JsonFileWriterTest.php +++ b/tests/src/Builder/Writer/JsonFileWriterTest.php @@ -43,11 +43,8 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\JsonFileWriter::class); } - /** - * @test - * - * @dataProvider writeDumpsJsonToGivenFileDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('writeDumpsJsonToGivenFileDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function writeDumpsJsonToGivenFile(string|JsonSerializable $json, string $expected): void { $file = Src\Helper\FilesystemHelper::createFileObject( diff --git a/tests/src/Builder/Writer/TemplateWriterTest.php b/tests/src/Builder/Writer/TemplateWriterTest.php index ce19d7ab..dbc07a73 100644 --- a/tests/src/Builder/Writer/TemplateWriterTest.php +++ b/tests/src/Builder/Writer/TemplateWriterTest.php @@ -46,9 +46,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\TemplateWriter::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function writeWritesRenderedTemplateFileToTemporaryDirectory(): void { $instructions = new Src\Builder\BuildInstructions( @@ -82,9 +80,7 @@ public function writeWritesRenderedTemplateFileToTemporaryDirectory(): void (new Filesystem\Filesystem())->remove(dirname($expected)); } - /** - * @test - */ + #[\PHPUnit\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..3c2e146e 100644 --- a/tests/src/Builder/Writer/WriterFactoryTest.php +++ b/tests/src/Builder/Writer/WriterFactoryTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\WriterFactory::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getThrowsExceptionIfFileIsNotSupported(): void { $subject = new Src\Builder\Writer\WriterFactory([]); @@ -55,9 +53,7 @@ public function getThrowsExceptionIfFileIsNotSupported(): void $subject->get('foo'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getReturnsWriterForGivenFile(): void { self::assertInstanceOf(Src\Builder\Writer\GenericFileWriter::class, $this->subject->get('foo')); diff --git a/tests/src/Console/ApplicationTest.php b/tests/src/Console/ApplicationTest.php index 1117434b..5899439a 100644 --- a/tests/src/Console/ApplicationTest.php +++ b/tests/src/Console/ApplicationTest.php @@ -68,9 +68,7 @@ protected function setUp(): void self::$io->makeInteractive(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runThrowsExceptionIfInputIsNonInteractive(): void { self::$io->makeInteractive(false); @@ -82,9 +80,7 @@ public function runThrowsExceptionIfInputIsNonInteractive(): void self::assertStringContainsString('This command cannot be run in non-interactive mode.', $output); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runMirrorsSourceFilesToTemporaryDirectory(): void { $temporaryDirectory = $this->targetDirectory.'/.build/src'; @@ -98,9 +94,7 @@ public function runMirrorsSourceFilesToTemporaryDirectory(): void self::assertDirectoryExists($temporaryDirectory); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runShowsWelcomeScreen(): void { self::$io->setUserInputs(['no']); @@ -112,9 +106,7 @@ public function runShowsWelcomeScreen(): void self::assertStringContainsString('Welcome to the Project Builder', $output); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderProvidesNoTemplates(): void { self::$io->setUserInputs(['yes', '', 'no']); @@ -127,9 +119,7 @@ public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProvide self::assertStringContainsString('Where can we find the project template?', $output); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderShouldBeChanged(): void { $this->templateProvider->templateSources = [ @@ -146,9 +136,7 @@ public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProvide self::assertStringContainsStringMultipleTimes('Try a different provider (e.g. Satis or GitHub)', $output); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runFailsIfProjectGenerationIsAborted(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -161,9 +149,7 @@ public function runFailsIfProjectGenerationIsAborted(): void self::assertSame(2, $this->subject->run()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runHandlesErrorDuringProjectGeneration(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -180,9 +166,7 @@ public function runHandlesErrorDuringProjectGeneration(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runGeneratesNewProjectFromSelectedTemplate(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -199,9 +183,7 @@ public function runGeneratesNewProjectFromSelectedTemplate(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured(): void { /** @var Src\Template\Provider\PackagistProvider $packagistProvider */ diff --git a/tests/src/Error/ErrorHandlerTest.php b/tests/src/Error/ErrorHandlerTest.php index ee05a9a2..da00db6d 100644 --- a/tests/src/Error/ErrorHandlerTest.php +++ b/tests/src/Error/ErrorHandlerTest.php @@ -49,12 +49,10 @@ protected function setUp(): void } /** - * @test - * - * @dataProvider handleExceptionWritesFormattedErrorMessageDataProvider - * * @param list $expectedOutput */ + #[\PHPUnit\Framework\Attributes\DataProvider('handleExceptionWritesFormattedErrorMessageDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function handleExceptionWritesFormattedErrorMessage(Throwable $exception, array $expectedOutput): void { $this->subject->handleException($exception); @@ -66,9 +64,7 @@ public function handleExceptionWritesFormattedErrorMessage(Throwable $exception, } } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function handleExceptionThrowsExceptionIfOutputIsVerbose(): void { $io = new IO\BufferIO('', Console\Output\OutputInterface::VERBOSITY_VERBOSE); diff --git a/tests/src/Event/BeforeTemplateRenderedEventTest.php b/tests/src/Event/BeforeTemplateRenderedEventTest.php index 97573707..57184665 100644 --- a/tests/src/Event/BeforeTemplateRenderedEventTest.php +++ b/tests/src/Event/BeforeTemplateRenderedEventTest.php @@ -51,9 +51,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTwigReturnsTwigEnvironment(): void { self::assertSame( @@ -62,9 +60,7 @@ public function getTwigReturnsTwigEnvironment(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getInstructionsReturnsBuildInstructions(): void { self::assertSame( @@ -73,9 +69,7 @@ public function getInstructionsReturnsBuildInstructions(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getVariablesReturnsVariables(): void { self::assertSame( @@ -87,9 +81,7 @@ public function getVariablesReturnsVariables(): void ); } - /** - * @test - */ + #[\PHPUnit\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..4e08b193 100644 --- a/tests/src/Event/BuildStepProcessedEventTest.php +++ b/tests/src/Event/BuildStepProcessedEventTest.php @@ -51,9 +51,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getStepReturnsStep(): void { self::assertSame( @@ -62,9 +60,7 @@ public function getStepReturnsStep(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getBuildResultReturnsBuildResult(): void { self::assertSame( @@ -73,9 +69,7 @@ public function getBuildResultReturnsBuildResult(): void ); } - /** - * @test - */ + #[\PHPUnit\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..925f43ab 100644 --- a/tests/src/Event/BuildStepRevertedEventTest.php +++ b/tests/src/Event/BuildStepRevertedEventTest.php @@ -50,9 +50,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getStepReturnsStep(): void { self::assertSame( @@ -61,9 +59,7 @@ public function getStepReturnsStep(): void ); } - /** - * @test - */ + #[\PHPUnit\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..9f4815e2 100644 --- a/tests/src/Event/ProjectBuildFinishedEventTest.php +++ b/tests/src/Event/ProjectBuildFinishedEventTest.php @@ -47,9 +47,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\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..42242d26 100644 --- a/tests/src/Event/ProjectBuildStartedEventTest.php +++ b/tests/src/Event/ProjectBuildStartedEventTest.php @@ -45,9 +45,7 @@ protected function setUp(): void ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getInstructionsReturnsBuildInstructions(): void { self::assertSame( diff --git a/tests/src/Exception/MisconfiguredValidatorExceptionTest.php b/tests/src/Exception/MisconfiguredValidatorExceptionTest.php index bd6fa0d3..779d56c8 100644 --- a/tests/src/Exception/MisconfiguredValidatorExceptionTest.php +++ b/tests/src/Exception/MisconfiguredValidatorExceptionTest.php @@ -34,9 +34,7 @@ */ final class MisconfiguredValidatorExceptionTest extends TestCase { - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function forUnexpectedOptionReturnsExceptionForUnexpectedOption(): void { $actual = Src\Exception\MisconfiguredValidatorException::forUnexpectedOption('foo', 'baz'); @@ -45,9 +43,7 @@ public function forUnexpectedOptionReturnsExceptionForUnexpectedOption(): void self::assertSame(1673886742, $actual->getCode()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function forUnexpectedOptionsReturnsExceptionForUnexpectedOptions(): void { $actual = Src\Exception\MisconfiguredValidatorException::forUnexpectedOptions('foo', ['baz', 'boo', 'dummy']); diff --git a/tests/src/Helper/ArrayHelperTest.php b/tests/src/Helper/ArrayHelperTest.php index 74e6612e..97168b39 100644 --- a/tests/src/Helper/ArrayHelperTest.php +++ b/tests/src/Helper/ArrayHelperTest.php @@ -35,9 +35,7 @@ */ final class ArrayHelperTest extends TestCase { - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function setValueByPathSetsValueAtGivenPath(): void { $subject = [ diff --git a/tests/src/Helper/FilesystemHelperTest.php b/tests/src/Helper/FilesystemHelperTest.php index 8ee638c0..991955ff 100644 --- a/tests/src/Helper/FilesystemHelperTest.php +++ b/tests/src/Helper/FilesystemHelperTest.php @@ -37,9 +37,7 @@ */ final class FilesystemHelperTest extends TestCase { - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createFileObjectReturnsFileObjectForGivenFile(): void { $baseDir = __DIR__; @@ -52,9 +50,7 @@ public function createFileObjectReturnsFileObjectForGivenFile(): void self::assertSame($baseDir.'/'.$relativePathname, $actual->getPathname()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { $actual = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -63,9 +59,7 @@ public function getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void self::assertStringStartsWith(sys_get_temp_dir(), $actual); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getProjectRootPathReturnsProjectRootPathFromEnvironmentVariable(): void { $projectRootPath = __DIR__.'/..'; @@ -77,9 +71,7 @@ public function getProjectRootPathReturnsProjectRootPathFromEnvironmentVariable( putenv('PROJECT_BUILDER_ROOT_PATH'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getProjectRootPathReturnsProjectRootPathFromComposerPackageArtifact(): void { self::assertSame(dirname(__DIR__, 3), Src\Helper\FilesystemHelper::getProjectRootPath()); diff --git a/tests/src/Helper/StringHelperTest.php b/tests/src/Helper/StringHelperTest.php index 9ee0adf5..ffde4c6a 100644 --- a/tests/src/Helper/StringHelperTest.php +++ b/tests/src/Helper/StringHelperTest.php @@ -37,20 +37,16 @@ final class StringHelperTest extends TestCase { /** - * @test - * * @param value-of $case - * - * @dataProvider convertCaseConvertsStringToGivenCaseDataProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('convertCaseConvertsStringToGivenCaseDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function convertCaseConvertsStringToGivenCase(string $string, string $case, string $expected): void { self::assertSame($expected, Src\Helper\StringHelper::convertCase($string, $case)); } - /** - * @test - */ + #[\PHPUnit\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 */ + #[\PHPUnit\Framework\Attributes\DataProvider('interpolateInterpolatedGivenStringWithKeyValuePairsDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function interpolateInterpolatedGivenStringWithKeyValuePairs(string $string, array $replacePairs, string $expected): void { self::assertSame($expected, Src\Helper\StringHelper::interpolate($string, $replacePairs)); diff --git a/tests/src/IO/InputReaderTest.php b/tests/src/IO/InputReaderTest.php index 4787946d..48756bfe 100644 --- a/tests/src/IO/InputReaderTest.php +++ b/tests/src/IO/InputReaderTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = new Src\IO\InputReader(self::$io); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function staticValueReturnsUserInput(): void { self::$io->setUserInputs(['Bob']); @@ -52,17 +50,13 @@ public function staticValueReturnsUserInput(): void self::assertStringContainsString('What\'s your name? (optional) [Alice]', self::$io->getOutput()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function staticValueReturnsDefaultValue(): void { self::assertSame('Alice', $this->subject->staticValue('What\'s your name?', 'Alice')); } - /** - * @test - */ + #[\PHPUnit\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 34e5ea8e..770ce2e3 100644 --- a/tests/src/IO/MessengerTest.php +++ b/tests/src/IO/MessengerTest.php @@ -47,9 +47,7 @@ protected function setUp(): void $this->subject = self::$container->get('app.messenger'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function selectProviderCanHandlePackagistProvider(): void { $packagistProvider = new Src\Template\Provider\PackagistProvider( @@ -62,9 +60,7 @@ public function selectProviderCanHandlePackagistProvider(): void self::assertSame($packagistProvider, $this->subject->selectProvider([$packagistProvider])); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function selectProviderCanHandleCustomComposerProvider(): void { $customProvider = new Src\Template\Provider\ComposerProvider( @@ -78,9 +74,7 @@ public function selectProviderCanHandleCustomComposerProvider(): void self::assertSame('https://www.example.com', $customProvider->getUrl()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplateSources(): void { $provider = new Tests\Fixtures\DummyProvider(); @@ -90,11 +84,8 @@ public function selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplat $this->subject->selectTemplateSource($provider); } - /** - * @test - * - * @dataProvider selectTemplateSourceReturnsSelectedTemplateSourceDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('selectTemplateSourceReturnsSelectedTemplateSourceDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function selectTemplateSourceReturnsSelectedTemplateSource( Package\PackageInterface $package, string $expected, @@ -109,11 +100,8 @@ public function selectTemplateSourceReturnsSelectedTemplateSource( self::assertStringContainsString($expected, self::$io->getOutput()); } - /** - * @test - * - * @dataProvider confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult(string $input, bool $expected): void { $exception = new Exception('Something went wrong.'); diff --git a/tests/src/IO/Validator/AbstractValidatorTest.php b/tests/src/IO/Validator/AbstractValidatorTestCase.php similarity index 94% rename from tests/src/IO/Validator/AbstractValidatorTest.php rename to tests/src/IO/Validator/AbstractValidatorTestCase.php index 838e94ed..6952b3d9 100644 --- a/tests/src/IO/Validator/AbstractValidatorTest.php +++ b/tests/src/IO/Validator/AbstractValidatorTestCase.php @@ -33,11 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class AbstractValidatorTest extends TestCase +final class AbstractValidatorTestCase extends TestCase { - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function constructorThrowsExceptionIfInvalidOptionsAreGiven(): void { $this->expectExceptionObject( diff --git a/tests/src/IO/Validator/CallbackValidatorTest.php b/tests/src/IO/Validator/CallbackValidatorTest.php index 6f0f7f4a..b2ab75c4 100644 --- a/tests/src/IO/Validator/CallbackValidatorTest.php +++ b/tests/src/IO/Validator/CallbackValidatorTest.php @@ -42,9 +42,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\CallbackValidator(['callback' => $this->validate(...)]); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function constructorThrowsExceptionIfNoCallbackIsGiven(): void { $this->expectExceptionObject( @@ -54,9 +52,7 @@ public function constructorThrowsExceptionIfNoCallbackIsGiven(): void new Src\IO\Validator\CallbackValidator(); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\DataProvider('invokeCallsConfiguredCallbackDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function invokeCallsConfiguredCallback(?string $input, ?string $expected): void { $actual = ($this->subject)($input); diff --git a/tests/src/IO/Validator/ChainedValidatorTest.php b/tests/src/IO/Validator/ChainedValidatorTest.php index 923f9746..64c03df9 100644 --- a/tests/src/IO/Validator/ChainedValidatorTest.php +++ b/tests/src/IO/Validator/ChainedValidatorTest.php @@ -46,9 +46,7 @@ protected function setUp(): void ]); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function getTypeReturnsType(): void { self::assertSame('chained', $this->subject::getType()); } - /** - * @test - */ + #[\PHPUnit\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..75ce6a66 100644 --- a/tests/src/IO/Validator/EmailValidatorTest.php +++ b/tests/src/IO/Validator/EmailValidatorTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\EmailValidator(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsNullOnNullInput(): void { $actual = ($this->subject)(null); @@ -51,9 +49,7 @@ public function invokeReturnsNullOnNullInput(): void self::assertNull($actual); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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..d934b393 100644 --- a/tests/src/IO/Validator/NotEmptyValidatorTest.php +++ b/tests/src/IO/Validator/NotEmptyValidatorTest.php @@ -42,11 +42,8 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\NotEmptyValidator(); } - /** - * @test - * - * @dataProvider invokeThrowsExceptionIfGivenInputIsEmptyDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('invokeThrowsExceptionIfGivenInputIsEmptyDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] 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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsEnabled(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -69,9 +64,7 @@ public function invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIs $subject(' '); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsNotEnabled(): void { $actual = ($this->subject)(' '); @@ -79,9 +72,7 @@ public function invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictC self::assertSame(' ', $actual); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsGivenInputIfGivenInputIsValid(): void { $actual = ($this->subject)('foo'); diff --git a/tests/src/IO/Validator/UrlValidatorTest.php b/tests/src/IO/Validator/UrlValidatorTest.php index 8764f9cd..050439e2 100644 --- a/tests/src/IO/Validator/UrlValidatorTest.php +++ b/tests/src/IO/Validator/UrlValidatorTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\UrlValidator(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsNullOnNullInput(): void { $actual = ($this->subject)(null); @@ -51,9 +49,7 @@ public function invokeReturnsNullOnNullInput(): void self::assertNull($actual); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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..479eab5f 100644 --- a/tests/src/IO/Validator/ValidatorFactoryTest.php +++ b/tests/src/IO/Validator/ValidatorFactoryTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\IO\Validator\ValidatorFactory::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getThrowsExceptionIfGivenTypeIsNotSupported(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -55,9 +53,7 @@ public function getThrowsExceptionIfGivenTypeIsNotSupported(): void $this->subject->get($validator); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getReturnsValidatorForGivenType(): void { $validator = new Src\Builder\Config\ValueObject\PropertyValidator('email'); @@ -65,9 +61,7 @@ public function getReturnsValidatorForGivenType(): void self::assertInstanceOf(Src\IO\Validator\EmailValidator::class, $this->subject->get($validator)); } - /** - * @test - */ + #[\PHPUnit\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..3eddc50f 100644 --- a/tests/src/Naming/NameVariantBuilderTest.php +++ b/tests/src/Naming/NameVariantBuilderTest.php @@ -49,9 +49,7 @@ protected function setUp(): void $this->subject = new Src\Naming\NameVariantBuilder($this->instructions); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createVariantThrowsExceptionIfGivenVariantIsUnsupported(): void { $this->expectException(UnhandledMatchError::class); @@ -60,9 +58,7 @@ public function createVariantThrowsExceptionIfGivenVariantIsUnsupported(): void $this->subject->createVariant('foo'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -71,11 +67,8 @@ public function createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable(): $this->subject->createShortVariant(); } - /** - * @test - * - * @dataProvider createShortVariantReturnsShortVariantDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('createShortVariantReturnsShortVariantDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function createShortVariantReturnsShortVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -86,9 +79,7 @@ public function createShortVariantReturnsShortVariant(string $customerName, ?str self::assertSame($expected, $this->subject->createShortVariant()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createShortVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project.customer_name', 'foo bar'); @@ -96,9 +87,7 @@ public function createShortVariantRespectsGivenStringCase(): void self::assertSame('FooBar', $this->subject->createShortVariant(Src\StringCase::UpperCamel->value)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -107,11 +96,8 @@ public function createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvail $this->subject->createAbbreviationVariant(); } - /** - * @test - * - * @dataProvider createAbbreviationVariantReturnsAbbreviationVariantDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('createAbbreviationVariantReturnsAbbreviationVariantDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function createAbbreviationVariantReturnsAbbreviationVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -122,9 +108,7 @@ public function createAbbreviationVariantReturnsAbbreviationVariant(string $cust self::assertSame($expected, $this->subject->createAbbreviationVariant()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createAbbreviationVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project.customer_abbreviation', 'foo bar'); @@ -132,9 +116,7 @@ public function createAbbreviationVariantRespectsGivenStringCase(): void self::assertSame('FooBar', $this->subject->createAbbreviationVariant(Src\StringCase::UpperCamel->value)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -143,11 +125,8 @@ public function createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable(): $this->subject->createFullVariant(); } - /** - * @test - * - * @dataProvider createFullVariantReturnsFullVariantDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('createFullVariantReturnsFullVariantDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function createFullVariantReturnsFullVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -158,9 +137,7 @@ public function createFullVariantReturnsFullVariant(string $customerName, ?strin self::assertSame($expected, $this->subject->createFullVariant()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createFullVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project', [ @@ -171,11 +148,8 @@ public function createFullVariantRespectsGivenStringCase(): void self::assertSame('FooBarBar', $this->subject->createFullVariant(Src\StringCase::UpperCamel->value)); } - /** - * @test - * - * @dataProvider isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault(?string $projectName, bool $expected): void { self::assertSame($expected, $this->subject::isDefaultProjectName($projectName)); diff --git a/tests/src/Resource/Http/PhpApiClientTest.php b/tests/src/Resource/Http/PhpApiClientTest.php index 29fbabe2..c655c648 100644 --- a/tests/src/Resource/Http/PhpApiClientTest.php +++ b/tests/src/Resource/Http/PhpApiClientTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Resource\Http\PhpApiClient::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getLatestStableVersionThrowsExceptionOnInvalidResponse(): void { self::$mockHandler->append(self::createErroneousResponse()); @@ -55,9 +53,7 @@ public function getLatestStableVersionThrowsExceptionOnInvalidResponse(): void $this->subject->getLatestStableVersion('8.0'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getLatestStableVersionReturnsLatestStableVersionOfGivenBranch(): void { self::$mockHandler->append(self::createJsonResponse(['version' => '8.0.10'])); @@ -65,9 +61,7 @@ public function getLatestStableVersionReturnsLatestStableVersionOfGivenBranch(): self::assertSame('8.0.10', $this->subject->getLatestStableVersion('8.0')); } - /** - * @test - */ + #[\PHPUnit\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..0d0562be 100644 --- a/tests/src/Resource/Local/ComposerTest.php +++ b/tests/src/Resource/Local/ComposerTest.php @@ -48,9 +48,7 @@ protected function setUp(): void $this->composerJson = dirname(__DIR__, 2).'/Fixtures/Templates/yaml-template/composer.json'; } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installThrowsExceptionIfGivenFileDoesNotExist(): void { $this->expectException(Src\Exception\IOException::class); @@ -60,9 +58,7 @@ public function installThrowsExceptionIfGivenFileDoesNotExist(): void $this->subject->install('foo'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installInstallsComposerDependenciesFromGivenFile(): void { $output = new Console\Output\BufferedOutput(); @@ -75,9 +71,7 @@ public function installInstallsComposerDependenciesFromGivenFile(): void self::assertStringNotContainsString('phpunit', $actualOutput); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installInstallsAllComposerDependenciesIncludingDevDependencies(): void { $output = new Console\Output\BufferedOutput(); @@ -90,9 +84,7 @@ public function installInstallsAllComposerDependenciesIncludingDevDependencies() self::assertStringContainsString('Installing phpunit/phpunit', $actualOutput); } - /** - * @test - */ + #[\PHPUnit\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..237ff8a1 100644 --- a/tests/src/Resource/Local/GitTest.php +++ b/tests/src/Resource/Local/GitTest.php @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = new Src\Resource\Local\Git($this->runner); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\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..bcb6f376 100644 --- a/tests/src/Resource/Local/ProcessedFileTest.php +++ b/tests/src/Resource/Local/ProcessedFileTest.php @@ -46,17 +46,13 @@ protected function setUp(): void $this->subject = new Src\Resource\Local\ProcessedFile($this->originalFile, $this->targetFile); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getOriginalFileReturnsOriginalFile(): void { self::assertSame($this->originalFile, $this->subject->getOriginalFile()); } - /** - * @test - */ + #[\PHPUnit\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..a74beece 100644 --- a/tests/src/Template/Provider/BaseProviderTest.php +++ b/tests/src/Template/Provider/BaseProviderTest.php @@ -64,13 +64,11 @@ protected function setUp(): void } /** - * @test - * - * @dataProvider listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider - * * @param list $packages * @param list $expected */ + #[\PHPUnit\Framework\Attributes\DataProvider('listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function listTemplateSourcesListsAllAvailableTemplateSources(array $packages, array $expected): void { $this->subject->packages = $packages; @@ -83,9 +81,7 @@ public function listTemplateSourcesListsAllAvailableTemplateSources(array $packa self::assertEquals($expectedTemplateSources, $this->subject->listTemplateSources()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installTemplateSourceThrowsExceptionIfInstallationFails(): void { $package = $this->createPackage('foo/baz'); @@ -109,9 +105,7 @@ public function installTemplateSourceThrowsExceptionIfInstallationFails(): void $this->subject->installTemplateSource($templateSource); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installTemplateSourceThrowsExceptionIfInstallationFailsWithGivenConstraint(): void { $package = $this->createPackage('foo/baz'); @@ -124,9 +118,7 @@ public function installTemplateSourceThrowsExceptionIfInstallationFailsWithGiven $this->subject->installTemplateSource($templateSource); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid(): void { $package = $this->createPackageFromTemplateFixture(); @@ -146,9 +138,7 @@ public function installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid(): vo ); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installTemplateSourceFailsIfGivenConstraintCannotBeResolved(): void { $package = $this->createPackageFromTemplateFixture(); @@ -167,9 +157,7 @@ public function installTemplateSourceFailsIfGivenConstraintCannotBeResolved(): v $this->subject->installTemplateSource($templateSource); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallationFailsWithGivenConstraint(): void { $package = $this->createPackageFromTemplateFixture(); @@ -192,12 +180,10 @@ public function installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallati } /** - * @test - * - * @dataProvider installTemplateSourceInstallsComposerPackageDataProvider - * * @param non-empty-list $packages */ + #[\PHPUnit\Framework\Attributes\DataProvider('installTemplateSourceInstallsComposerPackageDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function installTemplateSourceInstallsComposerPackage( array $packages, string $constraint, @@ -216,9 +202,7 @@ public function installTemplateSourceInstallsComposerPackage( self::assertStringContainsString($expected, self::$io->getOutput()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void { $actual = $this->subject->testCreateRepository(); diff --git a/tests/src/Template/Provider/ComposerProviderTest.php b/tests/src/Template/Provider/ComposerProviderTest.php index e1fb2fde..ff25cd18 100644 --- a/tests/src/Template/Provider/ComposerProviderTest.php +++ b/tests/src/Template/Provider/ComposerProviderTest.php @@ -53,9 +53,7 @@ protected function setUp(): void $this->acceptInsecureConnections(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function requestCustomOptionsAsksAndAppliesBaseUrl(): void { self::$io->setUserInputs(['https://example.com']); @@ -65,9 +63,7 @@ public function requestCustomOptionsAsksAndAppliesBaseUrl(): void self::assertSame('https://example.com', $this->subject->getUrl()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void { $this->expectExceptionObject(Src\Exception\InvalidResourceException::create('url')); @@ -75,9 +71,7 @@ public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void $this->subject->getUrl(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function setUrlAppliesGivenUrl(): void { $this->subject->setUrl('https://example.org'); @@ -85,9 +79,7 @@ public function setUrlAppliesGivenUrl(): void self::assertSame('https://example.org', $this->subject->getUrl()); } - /** - * @test - */ + #[\PHPUnit\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..fde1877b 100644 --- a/tests/src/Template/Provider/ProviderFactoryTest.php +++ b/tests/src/Template/Provider/ProviderFactoryTest.php @@ -41,9 +41,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Template\Provider\ProviderFactory::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -53,9 +51,7 @@ public function getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable(): void $this->subject->get('foo'); } - /** - * @test - */ + #[\PHPUnit\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 b92bb89b..64a53e9c 100644 --- a/tests/src/Template/Provider/VcsProviderTest.php +++ b/tests/src/Template/Provider/VcsProviderTest.php @@ -64,9 +64,7 @@ protected function setUp(): void putenv('PROJECT_BUILDER_ROOT_PATH='.$this->temporaryRootPath); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function requestCustomOptionsAsksAndAppliesBaseUrl(): void { self::$io->setUserInputs(['https://example.com']); @@ -76,9 +74,7 @@ public function requestCustomOptionsAsksAndAppliesBaseUrl(): void self::assertSame('https://example.com', $this->subject->getUrl()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void { $this->expectExceptionObject(Src\Exception\InvalidResourceException::create('url')); @@ -86,9 +82,7 @@ public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void $this->subject->getUrl(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function setUrlAppliesGivenUrl(): void { $this->subject->setUrl('https://example.org'); @@ -96,9 +90,7 @@ public function setUrlAppliesGivenUrl(): void self::assertSame('https://example.org', $this->subject->getUrl()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function listTemplateSourcesListsTemplatesFromConfiguredRepository(): void { $repoA = $this->initializeGitRepository('test/repo-a', ['test/repo-b' => '*']); @@ -116,9 +108,7 @@ public function listTemplateSourcesListsTemplatesFromConfiguredRepository(): voi $this->filesystem->remove($repoA); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function installTemplateSourceAsksForAdditionalRepositories(): void { $repoA = $this->initializeGitRepository('test/repo-a', ['test/repo-b' => '*']); diff --git a/tests/src/Template/TemplateSourceTest.php b/tests/src/Template/TemplateSourceTest.php index be6c28b3..4d15156f 100644 --- a/tests/src/Template/TemplateSourceTest.php +++ b/tests/src/Template/TemplateSourceTest.php @@ -48,25 +48,19 @@ protected function setUp(): void $this->subject = new Src\Template\TemplateSource($this->provider, $this->package); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getProviderReturnsProvider(): void { self::assertSame($this->provider, $this->subject->getProvider()); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function getPackageReturnsPackage(): void { self::assertSame($this->package, $this->subject->getPackage()); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\Test] public function shouldUseDynamicVersionConstraintReturnsFalseInitially(): void { self::assertFalse($this->subject->shouldUseDynamicVersionConstraint()); } - /** - * @test - * - * @dataProvider useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraint( bool $useDynamicVersionConstraint, bool $expected, diff --git a/tests/src/Twig/Filter/ConvertCaseFilterTest.php b/tests/src/Twig/Filter/ConvertCaseFilterTest.php index 037116f7..e0897941 100644 --- a/tests/src/Twig/Filter/ConvertCaseFilterTest.php +++ b/tests/src/Twig/Filter/ConvertCaseFilterTest.php @@ -42,9 +42,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Filter\ConvertCaseFilter(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -53,9 +51,7 @@ public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void ($this->subject)(null); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenCaseIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -64,9 +60,7 @@ public function invokeThrowsAssertionErrorIfGivenCaseIsNotAString(): void ($this->subject)('foo'); } - /** - * @test - */ + #[\PHPUnit\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..7b40d1d4 100644 --- a/tests/src/Twig/Filter/SlugifyFilterTest.php +++ b/tests/src/Twig/Filter/SlugifyFilterTest.php @@ -46,9 +46,7 @@ protected function setUp(): void error_reporting(E_WARNING); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -57,11 +55,8 @@ public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void ($this->subject)(null); } - /** - * @test - * - * @dataProvider invokeReturnsSlugForGivenInputDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsSlugForGivenInputDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsSlugForGivenInput(?string $separator, string $expected): void { $actual = ($this->subject)('foo bar', $separator); diff --git a/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php b/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php index 1b6f8e5e..183bea04 100644 --- a/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php +++ b/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultAuthorEmailFunction(new Src\Resource\Local\Git($this->runner)); } - /** - * @test - */ + #[\PHPUnit\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..a5ecb9ea 100644 --- a/tests/src/Twig/Func/DefaultAuthorNameFunctionTest.php +++ b/tests/src/Twig/Func/DefaultAuthorNameFunctionTest.php @@ -44,9 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultAuthorNameFunction(new Src\Resource\Local\Git($this->runner)); } - /** - * @test - */ + #[\PHPUnit\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..0fe7e7dd 100644 --- a/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php +++ b/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php @@ -42,11 +42,8 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultProjectNameFunction(); } - /** - * @test - * - * @dataProvider invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsTrueIfGivenProjectNameIsTheDefault(?string $projectName, bool $expected): void { $actual = ($this->subject)($projectName); diff --git a/tests/src/Twig/Func/NameVariantFunctionTest.php b/tests/src/Twig/Func/NameVariantFunctionTest.php index 8b69232a..f9cfea12 100644 --- a/tests/src/Twig/Func/NameVariantFunctionTest.php +++ b/tests/src/Twig/Func/NameVariantFunctionTest.php @@ -43,9 +43,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\NameVariantFunction(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenVariantIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -54,9 +52,7 @@ public function invokeThrowsExceptionIfGivenVariantIsNull(): void ($this->subject)(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructions(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -67,13 +63,11 @@ public function invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructio } /** - * @test - * - * @dataProvider invokeReturnsNameVariantDataProvider - * * @param value-of $variant * @param value-of|null $case */ + #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsNameVariantDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsNameVariant(string $variant, ?string $case, ?string $expected): void { $instructions = new Src\Builder\BuildInstructions( diff --git a/tests/src/Twig/Func/PhpVersionFunctionTest.php b/tests/src/Twig/Func/PhpVersionFunctionTest.php index ee64126b..708dd3c5 100644 --- a/tests/src/Twig/Func/PhpVersionFunctionTest.php +++ b/tests/src/Twig/Func/PhpVersionFunctionTest.php @@ -42,9 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Twig\Func\PhpVersionFunction::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenBranchIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -53,9 +51,7 @@ public function invokeThrowsExceptionIfGivenBranchIsNull(): void ($this->subject)(); } - /** - * @test - */ + #[\PHPUnit\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..0ed66e83 100644 --- a/tests/src/Twig/Func/ResolveIpFunctionTest.php +++ b/tests/src/Twig/Func/ResolveIpFunctionTest.php @@ -43,9 +43,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\ResolveIpFunction(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenHostnameIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -54,9 +52,7 @@ public function invokeThrowsExceptionIfGivenHostnameIsNull(): void ($this->subject)(); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsNullIfUrlCannotBeResolved(): void { $actual = ($this->subject)('https://'); @@ -64,9 +60,7 @@ public function invokeReturnsNullIfUrlCannotBeResolved(): void self::assertNull($actual); } - /** - * @test - */ + #[\PHPUnit\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 - */ + #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsResolvedIpAddressDataProvider')] + #[\PHPUnit\Framework\Attributes\Test] public function invokeReturnsResolvedIpAddress(string $hostname): void { $actual = ($this->subject)($hostname); diff --git a/tests/src/Twig/RendererTest.php b/tests/src/Twig/RendererTest.php index f2e71cdc..29a94c65 100644 --- a/tests/src/Twig/RendererTest.php +++ b/tests/src/Twig/RendererTest.php @@ -54,9 +54,7 @@ protected function setUp(): void $this->eventListener = self::$container->get(Tests\Fixtures\DummyTemplateRenderingEventListener::class); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function renderThrowsExceptionIfNoTemplateIsDefined(): void { $this->expectException(Src\Exception\TemplateRenderingException::class); @@ -66,9 +64,7 @@ public function renderThrowsExceptionIfNoTemplateIsDefined(): void $this->subject->render($this->instructions); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function renderThrowsExceptionIfTemplateIsMissing(): void { $this->expectException(Src\Exception\TemplateRenderingException::class); @@ -78,9 +74,7 @@ public function renderThrowsExceptionIfTemplateIsMissing(): void $this->subject->render($this->instructions, 'foo'); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function renderWithConfiguredFilesystemLoaderRendersTemplate(): void { self::assertFalse($this->eventListener->dispatched); @@ -91,9 +85,7 @@ public function renderWithConfiguredFilesystemLoaderRendersTemplate(): void self::assertTrue($this->eventListener->dispatched); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function renderWithConfiguredArrayLoaderRendersTemplate(): void { $subject = $this->subject->withDefaultTemplate('Hello {{ name }}!'); @@ -106,9 +98,7 @@ public function renderWithConfiguredArrayLoaderRendersTemplate(): void self::assertTrue($this->eventListener->dispatched); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function renderMergesBuildInstructionsAndAdditionalVariables(): void { $this->instructions->addTemplateVariable('foo', 'foo'); @@ -128,9 +118,7 @@ public function renderMergesBuildInstructionsAndAdditionalVariables(): void self::assertSame($expected, json_decode($actual, true, 512, JSON_THROW_ON_ERROR)); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function renderRespectsVariablesModifiedThroughDispatchedEvent(): void { $subject = $this->subject->withDefaultTemplate('Hello {{ name }}!'); @@ -147,9 +135,7 @@ public function renderRespectsVariablesModifiedThroughDispatchedEvent(): void self::assertTrue($this->eventListener->dispatched); } - /** - * @test - */ + #[\PHPUnit\Framework\Attributes\Test] public function canRenderReturnsChecksWhetherGivenTemplateCanBeRendered(): void { self::assertTrue($this->subject->canRender('dummy.twig')); From bf077f9f8442fe6b7481f0862c667b02c649438e Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 23 Mar 2023 17:08:18 +0100 Subject: [PATCH 21/42] [TASK] Migrate to static data providers --- .gitignore | 2 +- tests/src/Builder/BuildInstructionsTest.php | 4 +- tests/src/Builder/Config/FileTypeTest.php | 4 +- .../Step/ProcessSourceFilesStepTest.php | 2 +- .../src/Builder/Writer/JsonFileWriterTest.php | 2 +- tests/src/Error/ErrorHandlerTest.php | 2 +- tests/src/Helper/FilesystemHelperTest.php | 4 +- tests/src/Helper/StringHelperTest.php | 4 +- tests/src/IO/MessengerTest.php | 4 +- .../IO/Validator/CallbackValidatorTest.php | 2 +- .../IO/Validator/NotEmptyValidatorTest.php | 2 +- tests/src/Naming/NameVariantBuilderTest.php | 8 ++-- .../Template/Provider/BaseProviderTest.php | 41 +++++++++++-------- tests/src/Template/TemplateSourceTest.php | 2 +- tests/src/Twig/Filter/SlugifyFilterTest.php | 2 +- .../Func/DefaultProjectNameFunctionTest.php | 2 +- .../src/Twig/Func/NameVariantFunctionTest.php | 2 +- tests/src/Twig/Func/ResolveIpFunctionTest.php | 2 +- 18 files changed, 50 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 361a3ec0..07e8239d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ /var /vendor /.php-cs-fixer.cache -/.phpunit.result.cache +/.phpunit.cache diff --git a/tests/src/Builder/BuildInstructionsTest.php b/tests/src/Builder/BuildInstructionsTest.php index 3b75edd4..e4a7fb80 100644 --- a/tests/src/Builder/BuildInstructionsTest.php +++ b/tests/src/Builder/BuildInstructionsTest.php @@ -75,9 +75,11 @@ public function getSharedSourceDirectoryReturnsSharedSourceDirectory(): void public function getTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { $actual = $this->subject->getTemporaryDirectory(); + /** @var non-empty-string $prefix */ + $prefix = sys_get_temp_dir(); self::assertDirectoryDoesNotExist($actual); - self::assertStringStartsWith(sys_get_temp_dir(), $actual); + self::assertStringStartsWith($prefix, $actual); } #[\PHPUnit\Framework\Attributes\Test] diff --git a/tests/src/Builder/Config/FileTypeTest.php b/tests/src/Builder/Config/FileTypeTest.php index da90afe1..d0b61b2c 100644 --- a/tests/src/Builder/Config/FileTypeTest.php +++ b/tests/src/Builder/Config/FileTypeTest.php @@ -76,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]; @@ -86,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/Generator/Step/ProcessSourceFilesStepTest.php b/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php index 27fb0ded..08a1a6dd 100644 --- a/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php +++ b/tests/src/Builder/Generator/Step/ProcessSourceFilesStepTest.php @@ -117,7 +117,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/Writer/JsonFileWriterTest.php b/tests/src/Builder/Writer/JsonFileWriterTest.php index 45f0773d..70f15f30 100644 --- a/tests/src/Builder/Writer/JsonFileWriterTest.php +++ b/tests/src/Builder/Writer/JsonFileWriterTest.php @@ -60,7 +60,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/Error/ErrorHandlerTest.php b/tests/src/Error/ErrorHandlerTest.php index da00db6d..ac824dad 100644 --- a/tests/src/Error/ErrorHandlerTest.php +++ b/tests/src/Error/ErrorHandlerTest.php @@ -79,7 +79,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/Helper/FilesystemHelperTest.php b/tests/src/Helper/FilesystemHelperTest.php index 991955ff..600a2e8b 100644 --- a/tests/src/Helper/FilesystemHelperTest.php +++ b/tests/src/Helper/FilesystemHelperTest.php @@ -54,9 +54,11 @@ public function createFileObjectReturnsFileObjectForGivenFile(): void public function getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { $actual = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); + /** @var non-empty-string $prefix */ + $prefix = sys_get_temp_dir(); self::assertDirectoryDoesNotExist($actual); - self::assertStringStartsWith(sys_get_temp_dir(), $actual); + self::assertStringStartsWith($prefix, $actual); } #[\PHPUnit\Framework\Attributes\Test] diff --git a/tests/src/Helper/StringHelperTest.php b/tests/src/Helper/StringHelperTest.php index ffde4c6a..b5183814 100644 --- a/tests/src/Helper/StringHelperTest.php +++ b/tests/src/Helper/StringHelperTest.php @@ -68,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']; @@ -80,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/MessengerTest.php b/tests/src/IO/MessengerTest.php index 770ce2e3..bda52c3a 100644 --- a/tests/src/IO/MessengerTest.php +++ b/tests/src/IO/MessengerTest.php @@ -124,7 +124,7 @@ public function confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult(st /** * @return Generator */ - public function selectTemplateSourceReturnsSelectedTemplateSourceDataProvider(): Generator + public static function selectTemplateSourceReturnsSelectedTemplateSourceDataProvider(): Generator { $package = new Package\Package('foo/baz', '1.0.0', '1.0.0'); @@ -142,7 +142,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/CallbackValidatorTest.php b/tests/src/IO/Validator/CallbackValidatorTest.php index b2ab75c4..70cf09e5 100644 --- a/tests/src/IO/Validator/CallbackValidatorTest.php +++ b/tests/src/IO/Validator/CallbackValidatorTest.php @@ -75,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/NotEmptyValidatorTest.php b/tests/src/IO/Validator/NotEmptyValidatorTest.php index d934b393..c2b2aaf3 100644 --- a/tests/src/IO/Validator/NotEmptyValidatorTest.php +++ b/tests/src/IO/Validator/NotEmptyValidatorTest.php @@ -83,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/Naming/NameVariantBuilderTest.php b/tests/src/Naming/NameVariantBuilderTest.php index 3eddc50f..73b900ba 100644 --- a/tests/src/Naming/NameVariantBuilderTest.php +++ b/tests/src/Naming/NameVariantBuilderTest.php @@ -158,7 +158,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']; @@ -168,7 +168,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']; @@ -178,7 +178,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']; @@ -188,7 +188,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/Template/Provider/BaseProviderTest.php b/tests/src/Template/Provider/BaseProviderTest.php index a74beece..64284cac 100644 --- a/tests/src/Template/Provider/BaseProviderTest.php +++ b/tests/src/Template/Provider/BaseProviderTest.php @@ -203,36 +203,39 @@ public function installTemplateSourceInstallsComposerPackage( } #[\PHPUnit\Framework\Attributes\Test] - public function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void + public static function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void { - $actual = $this->subject->testCreateRepository(); + $instance = new self('BaseProviderTest'); + $actual = $instance->subject->testCreateRepository(); self::assertInstanceOf(Repository\ComposerRepository::class, $actual); - self::assertSame($this->subject->getUrl(), $actual->getRepoConfig()['url']); + self::assertSame($instance->subject->getUrl(), $actual->getRepoConfig()['url']); } /** * @return Generator, list}> */ - public function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider(): Generator + public static function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider(): Generator { + $instance = new self('BaseProviderTest'); + yield 'no packages' => [ [], [], ]; yield 'unsupported packages only' => [ [ - $this->createPackage('foo/baz-1', 'library'), - $this->createPackage('foo/baz-2', 'library'), - $this->createPackage('foo/baz-3', 'library'), + $instance->createPackage('foo/baz-1', 'library'), + $instance->createPackage('foo/baz-2', 'library'), + $instance->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'), + $instance->createPackage('foo/baz-1', 'library'), + $package1 = $instance->createPackage('foo/baz-2'), + $package2 = $instance->createPackage('foo/baz-3'), ], [ $package1, @@ -244,27 +247,29 @@ public function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider( /** * @return Generator, string, non-empty-string}> */ - public function installTemplateSourceInstallsComposerPackageDataProvider(): Generator + public static function installTemplateSourceInstallsComposerPackageDataProvider(): Generator { + $instance = new self('BaseProviderTest'); + yield 'no constraint' => [ - [$this->createPackageFromTemplateFixture()], + [$instance->createPackageFromTemplateFixture()], '', 'Installing project template (1.0.0)... Done', ]; yield 'constraint with one package' => [ - [$this->createPackageFromTemplateFixture(prettyVersion: '1.1.0')], + [$instance->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(), + $instance->createPackageFromTemplateFixture(prettyVersion: '2.0.0'), + $instance->createPackageFromTemplateFixture(prettyVersion: '1.2.0'), + $instance->createPackageFromTemplateFixture(prettyVersion: '1.1.23'), + $instance->createPackageFromTemplateFixture(prettyVersion: '1.1.0'), + $instance->createPackageFromTemplateFixture(), ], '~1.1.0', 'Installing project template (1.1.23)... Done', diff --git a/tests/src/Template/TemplateSourceTest.php b/tests/src/Template/TemplateSourceTest.php index 4d15156f..d41b82c7 100644 --- a/tests/src/Template/TemplateSourceTest.php +++ b/tests/src/Template/TemplateSourceTest.php @@ -88,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/SlugifyFilterTest.php b/tests/src/Twig/Filter/SlugifyFilterTest.php index 7b40d1d4..f16ecad2 100644 --- a/tests/src/Twig/Filter/SlugifyFilterTest.php +++ b/tests/src/Twig/Filter/SlugifyFilterTest.php @@ -67,7 +67,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/DefaultProjectNameFunctionTest.php b/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php index 0fe7e7dd..d3eeb481 100644 --- a/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php +++ b/tests/src/Twig/Func/DefaultProjectNameFunctionTest.php @@ -54,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 f9cfea12..758e6374 100644 --- a/tests/src/Twig/Func/NameVariantFunctionTest.php +++ b/tests/src/Twig/Func/NameVariantFunctionTest.php @@ -88,7 +88,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/ResolveIpFunctionTest.php b/tests/src/Twig/Func/ResolveIpFunctionTest.php index 0ed66e83..1bb75a42 100644 --- a/tests/src/Twig/Func/ResolveIpFunctionTest.php +++ b/tests/src/Twig/Func/ResolveIpFunctionTest.php @@ -81,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']; From 1de2f12d71a12c7106fb6cca777f9c433e7910c3 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 23 Mar 2023 17:09:02 +0100 Subject: [PATCH 22/42] [TASK] Migrate to static data providers --- .phpunit.result.cache | 1 + tests/src/Template/Provider/BaseProviderTest.php | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 00000000..130d9a79 --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":{"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::createRepositoryReturnsComposerRepositoryForConfiguredUrl":5,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured":8,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::testConstruct":5},"times":{"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getConfigReturnsConfig":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemplateDirectoryReturnsTemplateDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getSourceDirectoryReturnsSourceDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getSharedSourceDirectoryReturnsSharedSourceDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemporaryDirectoryReturnsUniqueTemporaryDirectory":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTargetDirectoryReturnsTargetDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemplateVariablesReturnsTemplateVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemplateVariableReturnsTemplateVariableAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::addTemplateVariableSetsTemplateVariableAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getInstructionsReturnsInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::isMirroredReturnsMirrorState":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getBuildArtifactReturnsBuildArtifact":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getAppliedStepsReturnsAppliedSteps":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::isStepAppliedTestsWhetherStepIsApplied":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::applyStepAddsStepToAppliedSteps":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getProcessedFilesReturnsProcessedFiles":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getWrittenDirectoryReturnsTemporaryDirectoryIfBuildWasNotMirrored":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getWrittenDirectoryReturnsTargetDirectoryIfBuildWasMirrored":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigFactoryTest::buildFromFileThrowsExceptionIfFileContentsAreInvalid":0.013,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigFactoryTest::buildFromFileReturnsHydratedConfigObject":0.046,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigFactoryTest::buildFromStringThrowsExceptionIfGivenContentIsInvalid":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::createCreatesTemplateDirectoryIfItDoesNotExist":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigThrowsExceptionIfTemplateHasNoComposerJson":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigThrowsExceptionIfTemplateWithGivenIdentifierDoesNotExist":0.184,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigThrowsExceptionIfTemplateContainsMultipleConfigFiles":0.178,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigReturnsHydratedConfigObject":0.187,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::hasConfigChecksWhetherConfigWithGivenIdentifierExists":0.173,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::listTemplateListsAllAvailableTemplates":0.177,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getIdentifierReturnsIdentifier":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getNameReturnsName":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getStepsReturnsSteps":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getPropertiesReturnsProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getDeclaringFileThrowsExceptionIfDeclaringFileIsNotSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::setDeclaringFileAppliesDeclaringFile":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getTemplateSourceThrowsExceptionIfTemplateSourceIsNotSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::setTemplateSourceAppliesTemplateSource":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::buildHashCalculatesConfigHash":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionThrowsExceptionIfGivenExtensionIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionReturnsFileTypeOfGivenExtension#json":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionReturnsFileTypeOfGivenExtension#yml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionReturnsFileTypeOfGivenExtension#yaml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileThrowsExceptionIfExtensionOfGivenFileIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileReturnsFileTypeOfGivenFile#json":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileReturnsFileTypeOfGivenFile#yml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileReturnsFileTypeOfGivenFile#yaml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::getPathReturnsPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::getConditionReturnsCondition":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::hasConditionReturnsTrue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::conditionMatchesChecksIfConditionMatches":0.01,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::getTargetReturnsTarget":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyOptionTest::getValueReturnsValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyOptionTest::conditionMatchesReturnsDefaultIfNoConditionIsSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getSubPropertiesReturnsSubProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::hasSubPropertiesChecksWhetherPropertyHasSubProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getIdentifierReturnsIdentifier":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getPathReturnsPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getPathFallsBackToIdentifierIfPathIsNotSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getNameReturnsName":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getValueReturnsValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::hasValueChecksIfPropertyHasValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyValidatorTest::getOptionsReturnsOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyValidatorTest::getTypeReturnsType":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepOptionsTest::getFileConditionsReturnsFileConditions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepOptionsTest::getTemplateFileReturnsTemplateFile":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepOptionsTest::getArtifactPathReturnsArtifactPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepTest::getOptionsReturnsOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getPathReturnsPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getPathConstructsPathFromIdentifierAndParentProperty":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getOptionsReturnsOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::canHaveMultipleValuesReturnsTrue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getDefaultValueReturnsDefaultValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getValidatorsReturnsValidators":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::isRequiredChecksIfNotEmptyValidatorIsSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getParentReturnsParentProperty":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::setParentAppliesParentProperty":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::runRunsThroughAllConfiguredSteps":0.166,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::runRevertsAppliedStepsOnStepFailure":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::runRevertsAppliedStepsAndExistsIfStoppableStepFailed":0.113,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::dumpArtifactDumpsBuildArtifact":0.112,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::cleanUpCleansUpRemainingFilesInTargetDirectory":0.121,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CleanUpStepTest::runCleansUpRemainingFilesInTargetDirectory":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CleanUpStepTest::revertThrowsException":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CleanUpStepTest::supportsReturnsFalse":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CollectBuildInstructionsStepTest::runAppliesNullAsDefaultValueOnSkippedProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CollectBuildInstructionsStepTest::runAppliesNullAsDefaultValueOnSkippedSubProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::runDoesNothingIfBuildArtifactWasNotGenerated":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::runDumpsBuildArtifact":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::revertDoesNothingIfBuildArtifactWasNotGenerated":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::revertRemovesDumpedBuildArtifact":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::supportsReturnsFalse":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\GenerateBuildArtifactStepTest::runAsksForConfirmationIfBuildArtifactPathAlreadyExists#continue":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\GenerateBuildArtifactStepTest::runAsksForConfirmationIfBuildArtifactPathAlreadyExists#do not continue":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\GenerateBuildArtifactStepTest::runGeneratesBuildArtifact":0.118,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\InstallComposerDependenciesStepTest::runInstallsComposerDependencies":0.686,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\InstallComposerDependenciesStepTest::runWritesComposerInstallOutputAndFailsOnFailure":0.376,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\InteractionFactoryTest::getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\InteractionFactoryTest::getReturnsInteractionOfGivenType":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\QuestionInteractionTest::interactUsesTruAndFalseAsDefaultYesNoValues":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\QuestionInteractionTest::interactReturnsValueFromMatchingOption":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\QuestionInteractionTest::interactUsesFallbackConditionIfOnlyOptionValueIsConfigured":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsNullOnEmptyUserInput":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsSelectedOption":0.037,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsSelectedOptionsIfMultipleOptionsAreAllowed":0.023,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSharedSourceFilesStepTest::runProcessesSourceFilesAndAppliesStep":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSharedSourceFilesStepTest::revertRemovesProcessedFiles":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runProcessesSourceFilesAndAppliesStep":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#one condition without target":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#one condition with target":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#multiple condition without target":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#multiple condition with target":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::revertRemovesProcessedFiles":0.004,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runThrowsExceptionIfNoTemplateFileIsGiven":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runThrowsExceptionIfTemplateFileDoesNotExist":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runThrowsExceptionIfTemplateFileCannotBeRendered":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runShowsNextStepsFromRenderedTemplateFileAndAppliesStep":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\StepFactoryTest::getThrowsExceptionIfGivenStepIsNotSupported":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\StepFactoryTest::getReturnsStepForGivenStep":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\GenericFileWriterTest::writeCopiesGivenFileToTemporaryDirectory":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\GenericFileWriterTest::writeCopiesGivenFileToGivenTargetFile":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\JsonFileWriterTest::writeDumpsJsonToGivenFile#json string":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\JsonFileWriterTest::writeDumpsJsonToGivenFile#serializable json object":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\TemplateWriterTest::writeWritesRenderedTemplateFileToTemporaryDirectory":0.004,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\TemplateWriterTest::writeWritesRenderedTemplateFileToGivenTargetFile":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\WriterFactoryTest::getThrowsExceptionIfFileIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\WriterFactoryTest::getReturnsWriterForGivenFile":0,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runThrowsExceptionIfInputIsNonInteractive":0.019,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runMirrorsSourceFilesToTemporaryDirectory":0.182,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runShowsWelcomeScreen":0.206,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderProvidesNoTemplates":0.199,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderShouldBeChanged":0.512,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runFailsIfProjectGenerationIsAborted":0.565,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runHandlesErrorDuringProjectGeneration":0.467,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runGeneratesNewProjectFromSelectedTemplate":0.572,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured":1.119,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with code":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with parent":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with code and parent":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with parent and its code":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with code and parent and its code":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#MappingError":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionThrowsExceptionIfOutputIsVerbose":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::getTwigReturnsTwigEnvironment":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::getInstructionsReturnsBuildInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::getVariablesReturnsVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::setVariablesUpdatesVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepProcessedEventTest::getStepReturnsStep":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepProcessedEventTest::getBuildResultReturnsBuildResult":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepProcessedEventTest::isSuccessfulReturnsState":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepRevertedEventTest::getStepReturnsStep":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepRevertedEventTest::getBuildResultReturnsBuildResult":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\ProjectBuildFinishedEventTest::getBuildResultReturnsBuildResult":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\ProjectBuildStartedEventTest::getInstructionsReturnsBuildInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Exception\\MisconfiguredValidatorExceptionTest::forUnexpectedOptionReturnsExceptionForUnexpectedOption":0,"CPSIT\\ProjectBuilder\\Tests\\Exception\\MisconfiguredValidatorExceptionTest::forUnexpectedOptionsReturnsExceptionForUnexpectedOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\ArrayHelperTest::getValueByPathReturnsValueAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\ArrayHelperTest::setValueByPathSetsValueAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::createFileObjectReturnsFileObjectForGivenFile":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::getProjectRootPathReturnsProjectRootPathFromEnvironmentVariable":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::getProjectRootPathReturnsProjectRootPathFromComposerPackageArtifact":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#lowercase":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#uppercase":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#snake case":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#upper camel case":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#lower camel case":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseThrowsExceptionWhenConvertingToUnsupportedCase":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#no placeholders":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#valid placeholder":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#invalid placeholder":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#multiple equal placeholders":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#multiple various placeholders":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\InputReaderTest::staticValueReturnsUserInput":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\InputReaderTest::staticValueReturnsDefaultValue":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\InputReaderTest::hiddenValueHidesUserInput":0.022,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectProviderCanHandlePackagistProvider":0.022,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectProviderCanHandleCustomComposerProvider":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplateSources":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceReturnsSelectedTemplateSource#package":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceReturnsSelectedTemplateSource#complete package":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceReturnsSelectedTemplateSource#complete package without description":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult#default":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult#yes":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult#no":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::constructorThrowsExceptionIfNoCallbackIsGiven":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::constructorThrowsExceptionIfInvalidCallbackIsGiven":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::invokeCallsConfiguredCallback#null":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::invokeCallsConfiguredCallback#string":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::constructorAddsGivenValidators":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::invokeInvokesAllValidators":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::invokeInvokesAllValidatorsAndReturnsModifiedInput":0.001,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::removeRemovesValidator":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::getTypeReturnsType":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::supportsReturnsFalse":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\EmailValidatorTest::invokeReturnsNullOnNullInput":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\EmailValidatorTest::invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\EmailValidatorTest::invokeReturnsGivenInputIfGivenInputIsValid":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeThrowsExceptionIfGivenInputIsEmpty#null":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeThrowsExceptionIfGivenInputIsEmpty#empty string":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsEnabled":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsNotEnabled":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeReturnsGivenInputIfGivenInputIsValid":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\UrlValidatorTest::invokeReturnsNullOnNullInput":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\UrlValidatorTest::invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\UrlValidatorTest::invokeReturnsGivenInputIfGivenInputIsValid":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ValidatorFactoryTest::getThrowsExceptionIfGivenTypeIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ValidatorFactoryTest::getReturnsValidatorForGivenType":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ValidatorFactoryTest::getAllReturnsChainedValidator":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createVariantThrowsExceptionIfGivenVariantIsUnsupported":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable":0.006,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantReturnsShortVariant#no project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantReturnsShortVariant#default project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantReturnsShortVariant#custom project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantRespectsGivenStringCase":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvailable":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantReturnsAbbreviationVariant#no project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantReturnsAbbreviationVariant#default project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantReturnsAbbreviationVariant#custom project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantRespectsGivenStringCase":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantReturnsFullVariant#no project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantReturnsFullVariant#default project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantReturnsFullVariant#custom project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantRespectsGivenStringCase":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault#null":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault#basic":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault#something different":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Http\\PhpApiClientTest::getLatestStableVersionThrowsExceptionOnInvalidResponse":0.015,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Http\\PhpApiClientTest::getLatestStableVersionReturnsLatestStableVersionOfGivenBranch":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Http\\PhpApiClientTest::getLatestStableVersionFallsBackToDotZeroReleaseIfResponseIsErroneous":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installThrowsExceptionIfGivenFileDoesNotExist":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installInstallsComposerDependenciesFromGivenFile":0.58,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installInstallsAllComposerDependenciesIncludingDevDependencies":1.628,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installRestoresInitialComposerEnvironmentVariable":0.863,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorNameReturnsGitUserNameConfig":0.004,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorNameFallsBackToGitAuthorNameConfig":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorEmailReturnsGitUserEmailConfig":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorEmailFallsBackToGitAuthorEmailConfig":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ProcessedFileTest::getOriginalFileReturnsOriginalFile":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ProcessedFileTest::getTargetFileReturnsTargetFile":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::listTemplateSourcesListsAllAvailableTemplateSources#no packages":0.013,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::listTemplateSourcesListsAllAvailableTemplateSources#unsupported packages only":0.011,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::listTemplateSourcesListsAllAvailableTemplateSources#unsupported and supported packages":0.014,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceThrowsExceptionIfInstallationFails":0.522,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceThrowsExceptionIfInstallationFailsWithGivenConstraint":0.475,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid":0.969,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceFailsIfGivenConstraintCannotBeResolved":0.099,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallationFailsWithGivenConstraint":1.005,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceInstallsComposerPackage#no constraint":0.919,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceInstallsComposerPackage#constraint with one package":0.872,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceInstallsComposerPackage#constraint with multiple packages":0.928,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::createRepositoryReturnsComposerRepositoryForConfiguredUrl":0.123,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::requestCustomOptionsAsksAndAppliesBaseUrl":0.013,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::getUrlThrowsExceptionIfNoUrlIsConfigured":0.011,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::setUrlAppliesGivenUrl":0.011,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::listTemplateSourcesConnectsToComposerHostToFetchAvailablePackages":0.04,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ProviderFactoryTest::getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable":0.001,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ProviderFactoryTest::getReturnsProviderOfGivenType":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::requestCustomOptionsAsksAndAppliesBaseUrl":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::getUrlThrowsExceptionIfNoUrlIsConfigured":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::setUrlAppliesGivenUrl":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::listTemplateSourcesListsTemplatesFromConfiguredRepository":0.442,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::installTemplateSourceAsksForAdditionalRepositories":2.959,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::getProviderReturnsProvider":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::getPackageReturnsPackage":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::setPackageAppliesGivenPackage":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::shouldUseDynamicVersionConstraintReturnsFalseInitially":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraint#true":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraint#false":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\ConvertCaseFilterTest::invokeThrowsAssertionErrorIfGivenInputIsNotAString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\ConvertCaseFilterTest::invokeThrowsAssertionErrorIfGivenCaseIsNotAString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\ConvertCaseFilterTest::invokeReturnsCaseConvertedString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\SlugifyFilterTest::invokeThrowsAssertionErrorIfGivenInputIsNotAString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\SlugifyFilterTest::invokeReturnsSlugForGivenInput#default separator":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\SlugifyFilterTest::invokeReturnsSlugForGivenInput#custom separator":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultAuthorEmailFunctionTest::invokeReturnsAuthorEmailFromGit":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultAuthorNameFunctionTest::invokeReturnsAuthorNameFromGit":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultProjectNameFunctionTest::invokeReturnsTrueIfGivenProjectNameIsTheDefault#null":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultProjectNameFunctionTest::invokeReturnsTrueIfGivenProjectNameIsTheDefault#basic":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultProjectNameFunctionTest::invokeReturnsTrueIfGivenProjectNameIsTheDefault#something different":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeThrowsExceptionIfGivenVariantIsNull":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#abbreviation":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#short name":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#full name":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#with case":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\PhpVersionFunctionTest::invokeThrowsExceptionIfGivenBranchIsNull":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\PhpVersionFunctionTest::invokeReturnsAndCachesLatestStableVersionOfGivenBranch":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeThrowsExceptionIfGivenHostnameIsNull":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsNullIfUrlCannotBeResolved":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsNullIfIpAddressCannotBeResolved":0.002,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsResolvedIpAddress#hostname":0.001,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsResolvedIpAddress#url":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderThrowsExceptionIfNoTemplateIsDefined":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderThrowsExceptionIfTemplateIsMissing":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderWithConfiguredFilesystemLoaderRendersTemplate":0.001,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderWithConfiguredArrayLoaderRendersTemplate":0.001,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderMergesBuildInstructionsAndAdditionalVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderRespectsVariablesModifiedThroughDispatchedEvent":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::canRenderReturnsChecksWhetherGivenTemplateCanBeRendered":0.001,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::testConstruct":0.122}} \ No newline at end of file diff --git a/tests/src/Template/Provider/BaseProviderTest.php b/tests/src/Template/Provider/BaseProviderTest.php index 64284cac..3a1cb8d6 100644 --- a/tests/src/Template/Provider/BaseProviderTest.php +++ b/tests/src/Template/Provider/BaseProviderTest.php @@ -51,6 +51,12 @@ final class BaseProviderTest extends Tests\ContainerAwareTestCase private Tests\Fixtures\DummyComposerProvider $subject; private MockWebServer\MockWebServer $server; + public function testConstruct(): void + { + $this->setUp(); + self::expectNotToPerformAssertions(); + } + protected function setUp(): void { $this->subject = new Tests\Fixtures\DummyComposerProvider( @@ -206,6 +212,8 @@ public function installTemplateSourceInstallsComposerPackage( public static function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void { $instance = new self('BaseProviderTest'); + $instance->setUp(); + $actual = $instance->subject->testCreateRepository(); self::assertInstanceOf(Repository\ComposerRepository::class, $actual); From 6644bbc37284fd3a4ddc506466afda806e358c1e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 13:41:22 +0000 Subject: [PATCH 23/42] [TASK] Update phpstan/phpstan to v1.10.8 --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 9eec9e6b..e90ff870 100644 --- a/composer.lock +++ b/composer.lock @@ -4869,16 +4869,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.7", + "version": "1.10.8", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975" + "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b10ceb526d9607903c5b2673f1fc8775dbe48975", - "reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0166aef76e066f0dd2adc2799bdadfa1635711e9", + "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9", "shasum": "" }, "require": { @@ -4927,7 +4927,7 @@ "type": "tidelift" } ], - "time": "2023-03-16T15:24:20+00:00" + "time": "2023-03-24T10:28:16+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", From 2e802e1d41ae5552fdd010367ff82e3ce1fe0a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sat, 25 Mar 2023 00:42:27 +0100 Subject: [PATCH 24/42] [TASK] Improve order of release categories --- .github/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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: - "*" From 1b49a5121c01a43357b73ab4b4c0f0de32364b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sat, 25 Mar 2023 00:41:06 +0100 Subject: [PATCH 25/42] [RELEASE] Release of project-builder 2.0.0 --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index b94929c8..8ef13f8f 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.0" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration From ee94f3de4e3ee5268e147ba27c291a35b95035e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Sat, 25 Mar 2023 17:52:45 +0100 Subject: [PATCH 26/42] [TASK] Allow $schema property in config files --- resources/config.schema.json | 4 ++++ src/Builder/Config/ConfigFactory.php | 6 ++++++ tests/src/Fixtures/Templates/json-template/config.json | 1 + tests/src/Fixtures/Templates/yaml-template/config.yaml | 2 ++ 4 files changed, 13 insertions(+) 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 34b98f44..93584104 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/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: From 54e18865d0f016bd89675028d567d38645c932cf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 00:27:44 +0000 Subject: [PATCH 27/42] [TASK] Update composer.lock --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index e90ff870..adb70973 100644 --- a/composer.lock +++ b/composer.lock @@ -3168,16 +3168,16 @@ }, { "name": "composer/composer", - "version": "2.5.4", + "version": "2.5.5", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "6b67eeea4d72051c369ccdbfb2423a56e2ab51a9" + "reference": "c7cffaad16a60636a776017eac5bd8cd0095c32f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/6b67eeea4d72051c369ccdbfb2423a56e2ab51a9", - "reference": "6b67eeea4d72051c369ccdbfb2423a56e2ab51a9", + "url": "https://api.github.com/repos/composer/composer/zipball/c7cffaad16a60636a776017eac5bd8cd0095c32f", + "reference": "c7cffaad16a60636a776017eac5bd8cd0095c32f", "shasum": "" }, "require": { @@ -3261,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.4" + "source": "https://github.com/composer/composer/tree/2.5.5" }, "funding": [ { @@ -3277,7 +3277,7 @@ "type": "tidelift" } ], - "time": "2023-02-15T12:10:06+00:00" + "time": "2023-03-21T10:50:05+00:00" }, { "name": "composer/metadata-minifier", @@ -4979,16 +4979,16 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.10", + "version": "1.3.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "4cc5c6cc38e56bce7ea47c4091814e516d172dc3" + "reference": "9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/4cc5c6cc38e56bce7ea47c4091814e516d172dc3", - "reference": "4cc5c6cc38e56bce7ea47c4091814e516d172dc3", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c", + "reference": "9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c", "shasum": "" }, "require": { @@ -5025,9 +5025,9 @@ "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.10" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.11" }, - "time": "2023-03-02T10:25:13+00:00" + "time": "2023-03-25T19:42:13+00:00" }, { "name": "phpstan/phpstan-strict-rules", From fd05dde4e48d937eabe9df70d1b05a6d43d4fc58 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 00:27:31 +0000 Subject: [PATCH 28/42] [TASK] Update phpstan/phpstan-phpunit to v1.3.11 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index e90ff870..34bfdad8 100644 --- a/composer.lock +++ b/composer.lock @@ -4979,16 +4979,16 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.10", + "version": "1.3.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "4cc5c6cc38e56bce7ea47c4091814e516d172dc3" + "reference": "9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/4cc5c6cc38e56bce7ea47c4091814e516d172dc3", - "reference": "4cc5c6cc38e56bce7ea47c4091814e516d172dc3", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c", + "reference": "9e1b9de6d260461f6e99b6a8f2dbb0bbb98b579c", "shasum": "" }, "require": { @@ -5025,9 +5025,9 @@ "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.10" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.11" }, - "time": "2023-03-02T10:25:13+00:00" + "time": "2023-03-25T19:42:13+00:00" }, { "name": "phpstan/phpstan-strict-rules", From 4f393ffeae345778ebf629cdc71ec43eaf318f13 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 18:57:08 +0000 Subject: [PATCH 29/42] [TASK] Update phpunit/phpunit to v9.6.6 --- composer.lock | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index adb70973..a3bdf5dd 100644 --- a/composer.lock +++ b/composer.lock @@ -5520,16 +5520,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.5", + "version": "9.6.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" + "reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", - "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b65d59a059d3004a040c16a82e07bbdf6cfdd115", + "reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115", "shasum": "" }, "require": { @@ -5602,7 +5602,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/9.6.6" }, "funding": [ { @@ -5618,7 +5619,7 @@ "type": "tidelift" } ], - "time": "2023-03-09T06:34:10+00:00" + "time": "2023-03-27T11:43:46+00:00" }, { "name": "react/promise", From 33652e7d2d6914855472bf83329872d1e105f7f7 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Tue, 28 Mar 2023 21:14:00 +0200 Subject: [PATCH 30/42] [TASK] Update phpunit/phpunit --- composer.lock | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index c0787c88..5e7eb47d 100644 --- a/composer.lock +++ b/composer.lock @@ -5450,16 +5450,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.16", + "version": "10.0.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "07d386a11ac7094032900f07cada1c8975d16607" + "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/07d386a11ac7094032900f07cada1c8975d16607", - "reference": "07d386a11ac7094032900f07cada1c8975d16607", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/20c23e85c86e5c06d63538ba464e8054f4744e62", + "reference": "20c23e85c86e5c06d63538ba464e8054f4744e62", "shasum": "" }, "require": { @@ -5530,7 +5530,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.16" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.19" }, "funding": [ { @@ -5546,7 +5547,7 @@ "type": "tidelift" } ], - "time": "2023-03-13T09:02:40+00:00" + "time": "2023-03-27T11:46:33+00:00" }, { "name": "react/promise", From 42728e91db20fc3464c31fb2d1febeb283be3c88 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 21:47:29 +0000 Subject: [PATCH 31/42] [TASK] Update phpstan/phpstan-strict-rules to v1.5.1 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index a3bdf5dd..4472c301 100644 --- a/composer.lock +++ b/composer.lock @@ -5031,16 +5031,16 @@ }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "b7dd96a5503919a43b3cd06a2dced9d4252492f2" + "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b7dd96a5503919a43b3cd06a2dced9d4252492f2", - "reference": "b7dd96a5503919a43b3cd06a2dced9d4252492f2", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b21c03d4f6f3a446e4311155f4be9d65048218e6", + "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6", "shasum": "" }, "require": { @@ -5074,9 +5074,9 @@ "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.5.0" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.1" }, - "time": "2023-02-21T10:17:10+00:00" + "time": "2023-03-29T14:47:40+00:00" }, { "name": "phpstan/phpstan-symfony", From 072b46aaba1d381d46846d676970243b2df2f74a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 09:50:49 +0000 Subject: [PATCH 32/42] [TASK] Update PHPStan packages --- composer.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 4472c301..120a1573 100644 --- a/composer.lock +++ b/composer.lock @@ -4869,16 +4869,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.8", + "version": "1.10.9", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9" + "reference": "9b13dafe3d66693d20fe5729c3dde1d31bb64703" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0166aef76e066f0dd2adc2799bdadfa1635711e9", - "reference": "0166aef76e066f0dd2adc2799bdadfa1635711e9", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b13dafe3d66693d20fe5729c3dde1d31bb64703", + "reference": "9b13dafe3d66693d20fe5729c3dde1d31bb64703", "shasum": "" }, "require": { @@ -4927,7 +4927,7 @@ "type": "tidelift" } ], - "time": "2023-03-24T10:28:16+00:00" + "time": "2023-03-30T08:58:01+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -5080,22 +5080,22 @@ }, { "name": "phpstan/phpstan-symfony", - "version": "1.2.23", + "version": "1.2.24", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "8a8d0538ca943b20beda7e9799e14fb3683262d4" + "reference": "db81b1861aac7cc2e66115cb33b4d1ea2a73d096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/8a8d0538ca943b20beda7e9799e14fb3683262d4", - "reference": "8a8d0538ca943b20beda7e9799e14fb3683262d4", + "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.4" + "phpstan/phpstan": "^1.9.18" }, "conflict": { "symfony/framework-bundle": "<3.0" @@ -5105,7 +5105,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", @@ -5145,9 +5145,9 @@ "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.23" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.2.24" }, - "time": "2023-02-06T10:42:02+00:00" + "time": "2023-03-30T08:38:10+00:00" }, { "name": "phpstan/phpstan-webmozart-assert", From e6db537f1ec27a2a24abbb2238f14e1c30b004de Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 30 Mar 2023 12:35:41 +0200 Subject: [PATCH 33/42] [TASK] Move from annotation to assertion --- tests/src/Builder/BuildInstructionsTest.php | 4 ++-- tests/src/Helper/FilesystemHelperTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/Builder/BuildInstructionsTest.php b/tests/src/Builder/BuildInstructionsTest.php index e4a7fb80..4c5634f1 100644 --- a/tests/src/Builder/BuildInstructionsTest.php +++ b/tests/src/Builder/BuildInstructionsTest.php @@ -74,10 +74,10 @@ public function getSharedSourceDirectoryReturnsSharedSourceDirectory(): void #[\PHPUnit\Framework\Attributes\Test] public function getTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { - $actual = $this->subject->getTemporaryDirectory(); - /** @var non-empty-string $prefix */ $prefix = sys_get_temp_dir(); + $actual = $this->subject->getTemporaryDirectory(); + self::assertNotEmpty($prefix); self::assertDirectoryDoesNotExist($actual); self::assertStringStartsWith($prefix, $actual); } diff --git a/tests/src/Helper/FilesystemHelperTest.php b/tests/src/Helper/FilesystemHelperTest.php index 600a2e8b..4d9fffe4 100644 --- a/tests/src/Helper/FilesystemHelperTest.php +++ b/tests/src/Helper/FilesystemHelperTest.php @@ -53,10 +53,10 @@ public function createFileObjectReturnsFileObjectForGivenFile(): void #[\PHPUnit\Framework\Attributes\Test] public function getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { - $actual = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); - /** @var non-empty-string $prefix */ $prefix = sys_get_temp_dir(); + $actual = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); + self::assertNotEmpty($prefix); self::assertDirectoryDoesNotExist($actual); self::assertStringStartsWith($prefix, $actual); } From 1a2e58fb847d848ed937ac9dcb5566eac1989e83 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 30 Mar 2023 12:36:15 +0200 Subject: [PATCH 34/42] [TASK] Remove PHPUnit result cache file --- .phpunit.result.cache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache deleted file mode 100644 index 130d9a79..00000000 --- a/.phpunit.result.cache +++ /dev/null @@ -1 +0,0 @@ -{"version":1,"defects":{"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::createRepositoryReturnsComposerRepositoryForConfiguredUrl":5,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured":8,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::testConstruct":5},"times":{"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getConfigReturnsConfig":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemplateDirectoryReturnsTemplateDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getSourceDirectoryReturnsSourceDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getSharedSourceDirectoryReturnsSharedSourceDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemporaryDirectoryReturnsUniqueTemporaryDirectory":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTargetDirectoryReturnsTargetDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemplateVariablesReturnsTemplateVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::getTemplateVariableReturnsTemplateVariableAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildInstructionsTest::addTemplateVariableSetsTemplateVariableAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getInstructionsReturnsInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::isMirroredReturnsMirrorState":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getBuildArtifactReturnsBuildArtifact":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getAppliedStepsReturnsAppliedSteps":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::isStepAppliedTestsWhetherStepIsApplied":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::applyStepAddsStepToAppliedSteps":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getProcessedFilesReturnsProcessedFiles":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getWrittenDirectoryReturnsTemporaryDirectoryIfBuildWasNotMirrored":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\BuildResultTest::getWrittenDirectoryReturnsTargetDirectoryIfBuildWasMirrored":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigFactoryTest::buildFromFileThrowsExceptionIfFileContentsAreInvalid":0.013,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigFactoryTest::buildFromFileReturnsHydratedConfigObject":0.046,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigFactoryTest::buildFromStringThrowsExceptionIfGivenContentIsInvalid":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::createCreatesTemplateDirectoryIfItDoesNotExist":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigThrowsExceptionIfTemplateHasNoComposerJson":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigThrowsExceptionIfTemplateWithGivenIdentifierDoesNotExist":0.184,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigThrowsExceptionIfTemplateContainsMultipleConfigFiles":0.178,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::readConfigReturnsHydratedConfigObject":0.187,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::hasConfigChecksWhetherConfigWithGivenIdentifierExists":0.173,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigReaderTest::listTemplateListsAllAvailableTemplates":0.177,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getIdentifierReturnsIdentifier":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getNameReturnsName":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getStepsReturnsSteps":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getPropertiesReturnsProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getDeclaringFileThrowsExceptionIfDeclaringFileIsNotSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::setDeclaringFileAppliesDeclaringFile":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::getTemplateSourceThrowsExceptionIfTemplateSourceIsNotSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::setTemplateSourceAppliesTemplateSource":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ConfigTest::buildHashCalculatesConfigHash":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionThrowsExceptionIfGivenExtensionIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionReturnsFileTypeOfGivenExtension#json":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionReturnsFileTypeOfGivenExtension#yml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromExtensionReturnsFileTypeOfGivenExtension#yaml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileThrowsExceptionIfExtensionOfGivenFileIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileReturnsFileTypeOfGivenFile#json":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileReturnsFileTypeOfGivenFile#yml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\FileTypeTest::fromFileReturnsFileTypeOfGivenFile#yaml":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::getPathReturnsPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::getConditionReturnsCondition":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::hasConditionReturnsTrue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::conditionMatchesChecksIfConditionMatches":0.01,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\FileConditionTest::getTargetReturnsTarget":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyOptionTest::getValueReturnsValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyOptionTest::conditionMatchesReturnsDefaultIfNoConditionIsSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getSubPropertiesReturnsSubProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::hasSubPropertiesChecksWhetherPropertyHasSubProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getIdentifierReturnsIdentifier":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getPathReturnsPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getPathFallsBackToIdentifierIfPathIsNotSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getNameReturnsName":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::getValueReturnsValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyTest::hasValueChecksIfPropertyHasValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyValidatorTest::getOptionsReturnsOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\PropertyValidatorTest::getTypeReturnsType":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepOptionsTest::getFileConditionsReturnsFileConditions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepOptionsTest::getTemplateFileReturnsTemplateFile":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepOptionsTest::getArtifactPathReturnsArtifactPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\StepTest::getOptionsReturnsOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getPathReturnsPath":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getPathConstructsPathFromIdentifierAndParentProperty":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getOptionsReturnsOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::canHaveMultipleValuesReturnsTrue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getDefaultValueReturnsDefaultValue":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getValidatorsReturnsValidators":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::isRequiredChecksIfNotEmptyValidatorIsSet":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::getParentReturnsParentProperty":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Config\\ValueObject\\SubPropertyTest::setParentAppliesParentProperty":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::runRunsThroughAllConfiguredSteps":0.166,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::runRevertsAppliedStepsOnStepFailure":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::runRevertsAppliedStepsAndExistsIfStoppableStepFailed":0.113,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::dumpArtifactDumpsBuildArtifact":0.112,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\GeneratorTest::cleanUpCleansUpRemainingFilesInTargetDirectory":0.121,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CleanUpStepTest::runCleansUpRemainingFilesInTargetDirectory":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CleanUpStepTest::revertThrowsException":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CleanUpStepTest::supportsReturnsFalse":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CollectBuildInstructionsStepTest::runAppliesNullAsDefaultValueOnSkippedProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\CollectBuildInstructionsStepTest::runAppliesNullAsDefaultValueOnSkippedSubProperties":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::runDoesNothingIfBuildArtifactWasNotGenerated":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::runDumpsBuildArtifact":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::revertDoesNothingIfBuildArtifactWasNotGenerated":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::revertRemovesDumpedBuildArtifact":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\DumpBuildArtifactStepTest::supportsReturnsFalse":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\GenerateBuildArtifactStepTest::runAsksForConfirmationIfBuildArtifactPathAlreadyExists#continue":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\GenerateBuildArtifactStepTest::runAsksForConfirmationIfBuildArtifactPathAlreadyExists#do not continue":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\GenerateBuildArtifactStepTest::runGeneratesBuildArtifact":0.118,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\InstallComposerDependenciesStepTest::runInstallsComposerDependencies":0.686,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\InstallComposerDependenciesStepTest::runWritesComposerInstallOutputAndFailsOnFailure":0.376,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\InteractionFactoryTest::getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\InteractionFactoryTest::getReturnsInteractionOfGivenType":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\QuestionInteractionTest::interactUsesTruAndFalseAsDefaultYesNoValues":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\QuestionInteractionTest::interactReturnsValueFromMatchingOption":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\QuestionInteractionTest::interactUsesFallbackConditionIfOnlyOptionValueIsConfigured":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsNullOnEmptyUserInput":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsSelectedOption":0.037,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\Interaction\\SelectInteractionTest::interactReturnsSelectedOptionsIfMultipleOptionsAreAllowed":0.023,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSharedSourceFilesStepTest::runProcessesSourceFilesAndAppliesStep":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSharedSourceFilesStepTest::revertRemovesProcessedFiles":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runProcessesSourceFilesAndAppliesStep":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#one condition without target":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#one condition with target":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#multiple condition without target":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::runCanProcessTheSameSourceFileWithMultipleConditions#multiple condition with target":0.003,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ProcessSourceFilesStepTest::revertRemovesProcessedFiles":0.004,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runThrowsExceptionIfNoTemplateFileIsGiven":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runThrowsExceptionIfTemplateFileDoesNotExist":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runThrowsExceptionIfTemplateFileCannotBeRendered":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\ShowNextStepsStepTest::runShowsNextStepsFromRenderedTemplateFileAndAppliesStep":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\StepFactoryTest::getThrowsExceptionIfGivenStepIsNotSupported":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Generator\\Step\\StepFactoryTest::getReturnsStepForGivenStep":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\GenericFileWriterTest::writeCopiesGivenFileToTemporaryDirectory":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\GenericFileWriterTest::writeCopiesGivenFileToGivenTargetFile":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\JsonFileWriterTest::writeDumpsJsonToGivenFile#json string":0.001,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\JsonFileWriterTest::writeDumpsJsonToGivenFile#serializable json object":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\TemplateWriterTest::writeWritesRenderedTemplateFileToTemporaryDirectory":0.004,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\TemplateWriterTest::writeWritesRenderedTemplateFileToGivenTargetFile":0.002,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\WriterFactoryTest::getThrowsExceptionIfFileIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\Builder\\Writer\\WriterFactoryTest::getReturnsWriterForGivenFile":0,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runThrowsExceptionIfInputIsNonInteractive":0.019,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runMirrorsSourceFilesToTemporaryDirectory":0.182,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runShowsWelcomeScreen":0.206,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderProvidesNoTemplates":0.199,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderShouldBeChanged":0.512,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runFailsIfProjectGenerationIsAborted":0.565,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runHandlesErrorDuringProjectGeneration":0.467,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runGeneratesNewProjectFromSelectedTemplate":0.572,"CPSIT\\ProjectBuilder\\Tests\\Console\\ApplicationTest::runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured":1.119,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with code":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with parent":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with code and parent":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with parent and its code":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#exception with code and parent and its code":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionWritesFormattedErrorMessage#MappingError":0,"CPSIT\\ProjectBuilder\\Tests\\Error\\ErrorHandlerTest::handleExceptionThrowsExceptionIfOutputIsVerbose":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::getTwigReturnsTwigEnvironment":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::getInstructionsReturnsBuildInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::getVariablesReturnsVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BeforeTemplateRenderedEventTest::setVariablesUpdatesVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepProcessedEventTest::getStepReturnsStep":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepProcessedEventTest::getBuildResultReturnsBuildResult":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepProcessedEventTest::isSuccessfulReturnsState":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepRevertedEventTest::getStepReturnsStep":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\BuildStepRevertedEventTest::getBuildResultReturnsBuildResult":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\ProjectBuildFinishedEventTest::getBuildResultReturnsBuildResult":0,"CPSIT\\ProjectBuilder\\Tests\\Event\\ProjectBuildStartedEventTest::getInstructionsReturnsBuildInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Exception\\MisconfiguredValidatorExceptionTest::forUnexpectedOptionReturnsExceptionForUnexpectedOption":0,"CPSIT\\ProjectBuilder\\Tests\\Exception\\MisconfiguredValidatorExceptionTest::forUnexpectedOptionsReturnsExceptionForUnexpectedOptions":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\ArrayHelperTest::getValueByPathReturnsValueAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\ArrayHelperTest::setValueByPathSetsValueAtGivenPath":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::createFileObjectReturnsFileObjectForGivenFile":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::getProjectRootPathReturnsProjectRootPathFromEnvironmentVariable":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\FilesystemHelperTest::getProjectRootPathReturnsProjectRootPathFromComposerPackageArtifact":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#lowercase":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#uppercase":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#snake case":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#upper camel case":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseConvertsStringToGivenCase#lower camel case":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::convertCaseThrowsExceptionWhenConvertingToUnsupportedCase":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#no placeholders":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#valid placeholder":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#invalid placeholder":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#multiple equal placeholders":0,"CPSIT\\ProjectBuilder\\Tests\\Helper\\StringHelperTest::interpolateInterpolatedGivenStringWithKeyValuePairs#multiple various placeholders":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\InputReaderTest::staticValueReturnsUserInput":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\InputReaderTest::staticValueReturnsDefaultValue":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\InputReaderTest::hiddenValueHidesUserInput":0.022,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectProviderCanHandlePackagistProvider":0.022,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectProviderCanHandleCustomComposerProvider":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplateSources":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceReturnsSelectedTemplateSource#package":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceReturnsSelectedTemplateSource#complete package":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::selectTemplateSourceReturnsSelectedTemplateSource#complete package without description":0.023,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult#default":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult#yes":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\MessengerTest::confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult#no":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::constructorThrowsExceptionIfNoCallbackIsGiven":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::constructorThrowsExceptionIfInvalidCallbackIsGiven":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::invokeCallsConfiguredCallback#null":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\CallbackValidatorTest::invokeCallsConfiguredCallback#string":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::constructorAddsGivenValidators":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::invokeInvokesAllValidators":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::invokeInvokesAllValidatorsAndReturnsModifiedInput":0.001,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::removeRemovesValidator":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::getTypeReturnsType":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ChainedValidatorTest::supportsReturnsFalse":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\EmailValidatorTest::invokeReturnsNullOnNullInput":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\EmailValidatorTest::invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\EmailValidatorTest::invokeReturnsGivenInputIfGivenInputIsValid":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeThrowsExceptionIfGivenInputIsEmpty#null":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeThrowsExceptionIfGivenInputIsEmpty#empty string":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsEnabled":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsNotEnabled":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\NotEmptyValidatorTest::invokeReturnsGivenInputIfGivenInputIsValid":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\UrlValidatorTest::invokeReturnsNullOnNullInput":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\UrlValidatorTest::invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\UrlValidatorTest::invokeReturnsGivenInputIfGivenInputIsValid":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ValidatorFactoryTest::getThrowsExceptionIfGivenTypeIsNotSupported":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ValidatorFactoryTest::getReturnsValidatorForGivenType":0,"CPSIT\\ProjectBuilder\\Tests\\IO\\Validator\\ValidatorFactoryTest::getAllReturnsChainedValidator":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createVariantThrowsExceptionIfGivenVariantIsUnsupported":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable":0.006,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantReturnsShortVariant#no project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantReturnsShortVariant#default project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantReturnsShortVariant#custom project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createShortVariantRespectsGivenStringCase":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvailable":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantReturnsAbbreviationVariant#no project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantReturnsAbbreviationVariant#default project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantReturnsAbbreviationVariant#custom project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createAbbreviationVariantRespectsGivenStringCase":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantReturnsFullVariant#no project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantReturnsFullVariant#default project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantReturnsFullVariant#custom project name":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::createFullVariantRespectsGivenStringCase":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault#null":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault#basic":0,"CPSIT\\ProjectBuilder\\Tests\\Naming\\NameVariantBuilderTest::isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault#something different":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Http\\PhpApiClientTest::getLatestStableVersionThrowsExceptionOnInvalidResponse":0.015,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Http\\PhpApiClientTest::getLatestStableVersionReturnsLatestStableVersionOfGivenBranch":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Http\\PhpApiClientTest::getLatestStableVersionFallsBackToDotZeroReleaseIfResponseIsErroneous":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installThrowsExceptionIfGivenFileDoesNotExist":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installInstallsComposerDependenciesFromGivenFile":0.58,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installInstallsAllComposerDependenciesIncludingDevDependencies":1.628,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ComposerTest::installRestoresInitialComposerEnvironmentVariable":0.863,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorNameReturnsGitUserNameConfig":0.004,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorNameFallsBackToGitAuthorNameConfig":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorEmailReturnsGitUserEmailConfig":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\GitTest::getAuthorEmailFallsBackToGitAuthorEmailConfig":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ProcessedFileTest::getOriginalFileReturnsOriginalFile":0,"CPSIT\\ProjectBuilder\\Tests\\Resource\\Local\\ProcessedFileTest::getTargetFileReturnsTargetFile":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::listTemplateSourcesListsAllAvailableTemplateSources#no packages":0.013,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::listTemplateSourcesListsAllAvailableTemplateSources#unsupported packages only":0.011,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::listTemplateSourcesListsAllAvailableTemplateSources#unsupported and supported packages":0.014,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceThrowsExceptionIfInstallationFails":0.522,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceThrowsExceptionIfInstallationFailsWithGivenConstraint":0.475,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid":0.969,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceFailsIfGivenConstraintCannotBeResolved":0.099,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallationFailsWithGivenConstraint":1.005,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceInstallsComposerPackage#no constraint":0.919,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceInstallsComposerPackage#constraint with one package":0.872,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::installTemplateSourceInstallsComposerPackage#constraint with multiple packages":0.928,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::createRepositoryReturnsComposerRepositoryForConfiguredUrl":0.123,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::requestCustomOptionsAsksAndAppliesBaseUrl":0.013,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::getUrlThrowsExceptionIfNoUrlIsConfigured":0.011,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::setUrlAppliesGivenUrl":0.011,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ComposerProviderTest::listTemplateSourcesConnectsToComposerHostToFetchAvailablePackages":0.04,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ProviderFactoryTest::getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable":0.001,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\ProviderFactoryTest::getReturnsProviderOfGivenType":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::requestCustomOptionsAsksAndAppliesBaseUrl":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::getUrlThrowsExceptionIfNoUrlIsConfigured":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::setUrlAppliesGivenUrl":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::listTemplateSourcesListsTemplatesFromConfiguredRepository":0.442,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\VcsProviderTest::installTemplateSourceAsksForAdditionalRepositories":2.959,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::getProviderReturnsProvider":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::getPackageReturnsPackage":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::setPackageAppliesGivenPackage":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::shouldUseDynamicVersionConstraintReturnsFalseInitially":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraint#true":0,"CPSIT\\ProjectBuilder\\Tests\\Template\\TemplateSourceTest::useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraint#false":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\ConvertCaseFilterTest::invokeThrowsAssertionErrorIfGivenInputIsNotAString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\ConvertCaseFilterTest::invokeThrowsAssertionErrorIfGivenCaseIsNotAString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\ConvertCaseFilterTest::invokeReturnsCaseConvertedString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\SlugifyFilterTest::invokeThrowsAssertionErrorIfGivenInputIsNotAString":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\SlugifyFilterTest::invokeReturnsSlugForGivenInput#default separator":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Filter\\SlugifyFilterTest::invokeReturnsSlugForGivenInput#custom separator":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultAuthorEmailFunctionTest::invokeReturnsAuthorEmailFromGit":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultAuthorNameFunctionTest::invokeReturnsAuthorNameFromGit":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultProjectNameFunctionTest::invokeReturnsTrueIfGivenProjectNameIsTheDefault#null":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultProjectNameFunctionTest::invokeReturnsTrueIfGivenProjectNameIsTheDefault#basic":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\DefaultProjectNameFunctionTest::invokeReturnsTrueIfGivenProjectNameIsTheDefault#something different":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeThrowsExceptionIfGivenVariantIsNull":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructions":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#abbreviation":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#short name":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#full name":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\NameVariantFunctionTest::invokeReturnsNameVariant#with case":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\PhpVersionFunctionTest::invokeThrowsExceptionIfGivenBranchIsNull":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\PhpVersionFunctionTest::invokeReturnsAndCachesLatestStableVersionOfGivenBranch":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeThrowsExceptionIfGivenHostnameIsNull":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsNullIfUrlCannotBeResolved":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsNullIfIpAddressCannotBeResolved":0.002,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsResolvedIpAddress#hostname":0.001,"CPSIT\\ProjectBuilder\\Tests\\Twig\\Func\\ResolveIpFunctionTest::invokeReturnsResolvedIpAddress#url":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderThrowsExceptionIfNoTemplateIsDefined":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderThrowsExceptionIfTemplateIsMissing":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderWithConfiguredFilesystemLoaderRendersTemplate":0.001,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderWithConfiguredArrayLoaderRendersTemplate":0.001,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderMergesBuildInstructionsAndAdditionalVariables":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::renderRespectsVariablesModifiedThroughDispatchedEvent":0,"CPSIT\\ProjectBuilder\\Tests\\Twig\\RendererTest::canRenderReturnsChecksWhetherGivenTemplateCanBeRendered":0.001,"CPSIT\\ProjectBuilder\\Tests\\Template\\Provider\\BaseProviderTest::testConstruct":0.122}} \ No newline at end of file From 49d55485b7760e04cb5aff7bc23675944fc667a2 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 30 Mar 2023 12:38:32 +0200 Subject: [PATCH 35/42] [TASK] Revert class rename --- tests/src/IO/Validator/AbstractValidatorTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/IO/Validator/AbstractValidatorTestCase.php b/tests/src/IO/Validator/AbstractValidatorTestCase.php index 6952b3d9..be37b7a2 100644 --- a/tests/src/IO/Validator/AbstractValidatorTestCase.php +++ b/tests/src/IO/Validator/AbstractValidatorTestCase.php @@ -33,7 +33,7 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class AbstractValidatorTestCase extends TestCase +final class AbstractValidatorTest extends TestCase { #[\PHPUnit\Framework\Attributes\Test] public function constructorThrowsExceptionIfInvalidOptionsAreGiven(): void From e6cca3188b29ebf31e58d4edee3a9136bc223525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 30 Mar 2023 12:38:27 +0200 Subject: [PATCH 36/42] [TASK] Enable PHPUnit level set list in Rector --- rector.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rector.php b/rector.php index b3099f4b..7ad51ba2 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,22 @@ __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', + ], ]); $rectorConfig->phpVersion(PhpVersion::PHP_81); $rectorConfig->sets([ LevelSetList::UP_TO_PHP_81, + PHPUnitLevelSetList::UP_TO_PHPUNIT_100, ]); }; From 5793efd6613ce85227fd8f76fa053dc8bdea737a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 30 Mar 2023 12:38:50 +0200 Subject: [PATCH 37/42] [TASK] Make methods used in data providers static --- .../Template/Provider/BaseProviderTest.php | 61 ++++++++----------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/tests/src/Template/Provider/BaseProviderTest.php b/tests/src/Template/Provider/BaseProviderTest.php index 3a1cb8d6..39174835 100644 --- a/tests/src/Template/Provider/BaseProviderTest.php +++ b/tests/src/Template/Provider/BaseProviderTest.php @@ -51,12 +51,6 @@ final class BaseProviderTest extends Tests\ContainerAwareTestCase private Tests\Fixtures\DummyComposerProvider $subject; private MockWebServer\MockWebServer $server; - public function testConstruct(): void - { - $this->setUp(); - self::expectNotToPerformAssertions(); - } - protected function setUp(): void { $this->subject = new Tests\Fixtures\DummyComposerProvider( @@ -90,7 +84,7 @@ public function listTemplateSourcesListsAllAvailableTemplateSources(array $packa #[\PHPUnit\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', @@ -114,7 +108,7 @@ public function installTemplateSourceThrowsExceptionIfInstallationFails(): void #[\PHPUnit\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(['']); @@ -127,7 +121,7 @@ public function installTemplateSourceThrowsExceptionIfInstallationFailsWithGiven #[\PHPUnit\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]; @@ -147,7 +141,7 @@ public function installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid(): vo #[\PHPUnit\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]; @@ -166,7 +160,7 @@ public function installTemplateSourceFailsIfGivenConstraintCannotBeResolved(): v #[\PHPUnit\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]; @@ -209,15 +203,12 @@ public function installTemplateSourceInstallsComposerPackage( } #[\PHPUnit\Framework\Attributes\Test] - public static function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void + public function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void { - $instance = new self('BaseProviderTest'); - $instance->setUp(); - - $actual = $instance->subject->testCreateRepository(); + $actual = $this->subject->testCreateRepository(); self::assertInstanceOf(Repository\ComposerRepository::class, $actual); - self::assertSame($instance->subject->getUrl(), $actual->getRepoConfig()['url']); + self::assertSame($this->subject->getUrl(), $actual->getRepoConfig()['url']); } /** @@ -225,25 +216,23 @@ public static function createRepositoryReturnsComposerRepositoryForConfiguredUrl */ public static function listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider(): Generator { - $instance = new self('BaseProviderTest'); - yield 'no packages' => [ [], [], ]; yield 'unsupported packages only' => [ [ - $instance->createPackage('foo/baz-1', 'library'), - $instance->createPackage('foo/baz-2', 'library'), - $instance->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' => [ [ - $instance->createPackage('foo/baz-1', 'library'), - $package1 = $instance->createPackage('foo/baz-2'), - $package2 = $instance->createPackage('foo/baz-3'), + self::createPackage('foo/baz-1', 'library'), + $package1 = self::createPackage('foo/baz-2'), + $package2 = self::createPackage('foo/baz-3'), ], [ $package1, @@ -257,34 +246,32 @@ public static function listTemplateSourcesListsAllAvailableTemplateSourcesDataPr */ public static function installTemplateSourceInstallsComposerPackageDataProvider(): Generator { - $instance = new self('BaseProviderTest'); - yield 'no constraint' => [ - [$instance->createPackageFromTemplateFixture()], + [self::createPackageFromTemplateFixture()], '', 'Installing project template (1.0.0)... Done', ]; yield 'constraint with one package' => [ - [$instance->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' => [ [ - $instance->createPackageFromTemplateFixture(prettyVersion: '2.0.0'), - $instance->createPackageFromTemplateFixture(prettyVersion: '1.2.0'), - $instance->createPackageFromTemplateFixture(prettyVersion: '1.1.23'), - $instance->createPackageFromTemplateFixture(prettyVersion: '1.1.0'), - $instance->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', @@ -297,7 +284,7 @@ private function createPackage( return $package; } - private function createPackageFromTemplateFixture( + private static function createPackageFromTemplateFixture( string $templateName = 'json-template', string $prettyVersion = '1.0.0', ): Package\Package { @@ -306,7 +293,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); From 8b40e37508861ce1df38b2746dbadee545b125e6 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 30 Mar 2023 12:40:54 +0200 Subject: [PATCH 38/42] [TASK] Ignore .phpunit.result.cache --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 07e8239d..361a3ec0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ /var /vendor /.php-cs-fixer.cache -/.phpunit.cache +/.phpunit.result.cache From 4a17705d6e5d7f19628b71b06f75192312ec49d9 Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 30 Mar 2023 12:45:35 +0200 Subject: [PATCH 39/42] [TASK] Rename AbstractValidatorTestCase.php --- .../{AbstractValidatorTestCase.php => AbstractValidatorTest.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/src/IO/Validator/{AbstractValidatorTestCase.php => AbstractValidatorTest.php} (100%) diff --git a/tests/src/IO/Validator/AbstractValidatorTestCase.php b/tests/src/IO/Validator/AbstractValidatorTest.php similarity index 100% rename from tests/src/IO/Validator/AbstractValidatorTestCase.php rename to tests/src/IO/Validator/AbstractValidatorTest.php From c3bfabdc84c88889f99d28b0fa97d6a885bf206c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 30 Mar 2023 13:02:03 +0200 Subject: [PATCH 40/42] [BUGFIX] Generate correct links to HTML pages in documentation --- docs/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: From 195ef8dfccd545b7eaae575938f910e1933d010d Mon Sep 17 00:00:00 2001 From: Martin Adler Date: Thu, 30 Mar 2023 13:11:29 +0200 Subject: [PATCH 41/42] [RELEASE] Release of project_builder 2.0.1 --- docs/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 8ef13f8f..537c0dc3 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 = "2.0.0" +release = "2.0.1" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -31,7 +31,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 ------------------------------------------------- From 4c0f9e3cde4c16276e0ab19c2a73226eb6e8fdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20H=C3=A4u=C3=9Fler?= Date: Thu, 30 Mar 2023 21:08:42 +0200 Subject: [PATCH 42/42] [TASK] Streamline PHPUnit attributes --- tests/src/Builder/BuildInstructionsTest.php | 19 ++++++------ tests/src/Builder/BuildResultTest.php | 19 ++++++------ .../src/Builder/Config/ConfigFactoryTest.php | 10 +++--- tests/src/Builder/Config/ConfigReaderTest.php | 18 +++++------ tests/src/Builder/Config/ConfigTest.php | 22 ++++++------- tests/src/Builder/Config/FileTypeTest.php | 16 +++++----- .../Config/ValueObject/FileConditionTest.php | 14 ++++----- .../Config/ValueObject/PropertyOptionTest.php | 8 ++--- .../Config/ValueObject/PropertyTest.php | 20 ++++++------ .../ValueObject/PropertyValidatorTest.php | 8 ++--- .../Config/ValueObject/StepOptionsTest.php | 10 +++--- .../Builder/Config/ValueObject/StepTest.php | 6 ++-- .../Config/ValueObject/SubPropertyTest.php | 22 ++++++------- tests/src/Builder/Generator/GeneratorTest.php | 11 ++++--- .../Generator/Step/CleanUpStepTest.php | 7 +++-- .../Step/CollectBuildInstructionsStepTest.php | 5 +-- .../Step/DumpBuildArtifactStepTest.php | 11 ++++--- .../Step/GenerateBuildArtifactStepTest.php | 7 +++-- .../InstallComposerDependenciesStepTest.php | 5 +-- .../Interaction/InteractionFactoryTest.php | 5 +-- .../Interaction/QuestionInteractionTest.php | 7 +++-- .../Interaction/SelectInteractionTest.php | 11 ++++--- .../Step/ProcessSharedSourceFilesStepTest.php | 5 +-- .../Step/ProcessSourceFilesStepTest.php | 9 +++--- .../Generator/Step/ShowNextStepsStepTest.php | 9 +++--- .../Generator/Step/StepFactoryTest.php | 5 +-- .../Builder/Writer/GenericFileWriterTest.php | 5 +-- .../src/Builder/Writer/JsonFileWriterTest.php | 5 +-- .../src/Builder/Writer/TemplateWriterTest.php | 5 +-- .../src/Builder/Writer/WriterFactoryTest.php | 5 +-- tests/src/Console/ApplicationTest.php | 19 ++++++------ tests/src/ContainerAwareTestCase.php | 4 +-- tests/src/Error/ErrorHandlerTest.php | 7 +++-- .../Event/BeforeTemplateRenderedEventTest.php | 9 +++--- .../src/Event/BuildStepProcessedEventTest.php | 7 +++-- .../src/Event/BuildStepRevertedEventTest.php | 5 +-- .../Event/ProjectBuildFinishedEventTest.php | 3 +- .../Event/ProjectBuildStartedEventTest.php | 3 +- .../MisconfiguredValidatorExceptionTest.php | 8 ++--- tests/src/Helper/ArrayHelperTest.php | 8 ++--- tests/src/Helper/FilesystemHelperTest.php | 12 +++---- tests/src/Helper/StringHelperTest.php | 14 ++++----- tests/src/IO/InputReaderTest.php | 7 +++-- tests/src/IO/MessengerTest.php | 15 ++++----- .../IO/Validator/AbstractValidatorTest.php | 6 ++-- .../IO/Validator/CallbackValidatorTest.php | 12 +++---- .../src/IO/Validator/ChainedValidatorTest.php | 16 +++++----- tests/src/IO/Validator/EmailValidatorTest.php | 10 +++--- .../IO/Validator/NotEmptyValidatorTest.php | 14 ++++----- tests/src/IO/Validator/UrlValidatorTest.php | 10 +++--- .../src/IO/Validator/ValidatorFactoryTest.php | 7 +++-- tests/src/Naming/NameVariantBuilderTest.php | 31 ++++++++++--------- tests/src/Resource/Http/PhpApiClientTest.php | 7 +++-- tests/src/Resource/Local/ComposerTest.php | 9 +++--- tests/src/Resource/Local/GitTest.php | 12 +++---- .../src/Resource/Local/ProcessedFileTest.php | 8 ++--- .../Template/Provider/BaseProviderTest.php | 21 +++++++------ .../Provider/ComposerProviderTest.php | 9 +++--- .../Template/Provider/ProviderFactoryTest.php | 5 +-- .../src/Template/Provider/VcsProviderTest.php | 11 ++++--- tests/src/Template/TemplateSourceTest.php | 16 +++++----- .../src/Twig/Filter/ConvertCaseFilterTest.php | 10 +++--- tests/src/Twig/Filter/SlugifyFilterTest.php | 7 +++-- .../Func/DefaultAuthorEmailFunctionTest.php | 6 ++-- .../Func/DefaultAuthorNameFunctionTest.php | 6 ++-- .../Func/DefaultProjectNameFunctionTest.php | 8 ++--- .../src/Twig/Func/NameVariantFunctionTest.php | 9 +++--- .../src/Twig/Func/PhpVersionFunctionTest.php | 5 +-- tests/src/Twig/Func/ResolveIpFunctionTest.php | 14 ++++----- tests/src/Twig/RendererTest.php | 15 ++++----- 70 files changed, 377 insertions(+), 337 deletions(-) diff --git a/tests/src/Builder/BuildInstructionsTest.php b/tests/src/Builder/BuildInstructionsTest.php index 4c5634f1..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,31 +48,31 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getConfigReturnsConfig(): void { self::assertSame(self::$container->get('app.config'), $this->subject->getConfig()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTemplateDirectoryReturnsTemplateDirectory(): void { self::assertSame(dirname(__DIR__), $this->subject->getTemplateDirectory()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getSourceDirectoryReturnsSourceDirectory(): void { self::assertSame(dirname(__DIR__).'/templates/src', $this->subject->getSourceDirectory()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getSharedSourceDirectoryReturnsSharedSourceDirectory(): void { self::assertSame(dirname(__DIR__).'/templates/shared', $this->subject->getSharedSourceDirectory()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { $prefix = sys_get_temp_dir(); @@ -82,13 +83,13 @@ public function getTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void self::assertStringStartsWith($prefix, $actual); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTargetDirectoryReturnsTargetDirectory(): void { self::assertSame('foo', $this->subject->getTargetDirectory()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTemplateVariablesReturnsTemplateVariables(): void { self::assertSame([], $this->subject->getTemplateVariables()); @@ -98,7 +99,7 @@ public function getTemplateVariablesReturnsTemplateVariables(): void self::assertSame(['foo' => 'bar'], $this->subject->getTemplateVariables()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTemplateVariableReturnsTemplateVariableAtGivenPath(): void { self::assertNull($this->subject->getTemplateVariable('foo.bar.hello')); @@ -112,7 +113,7 @@ public function getTemplateVariableReturnsTemplateVariableAtGivenPath(): void self::assertSame('world!', $this->subject->getTemplateVariable('foo.bar.hello')); } - #[\PHPUnit\Framework\Attributes\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 8a82b89c..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,20 +52,20 @@ protected function setUp(): void $this->subject = new Src\Builder\BuildResult($this->instructions); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getInstructionsReturnsInstructions(): void { self::assertSame($this->instructions, $this->subject->getInstructions()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function isMirroredReturnsMirrorState(): void { self::assertFalse($this->subject->isMirrored()); self::assertTrue($this->subject->setMirrored(true)->isMirrored()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getBuildArtifactReturnsBuildArtifact(): void { self::assertNull($this->subject->getBuildArtifact()); @@ -78,7 +79,7 @@ public function getBuildArtifactReturnsBuildArtifact(): void self::assertSame($buildArtifact, $this->subject->setBuildArtifact($buildArtifact)->getBuildArtifact()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getAppliedStepsReturnsAppliedSteps(): void { $step = new Tests\Fixtures\DummyStep(); @@ -90,7 +91,7 @@ public function getAppliedStepsReturnsAppliedSteps(): void self::assertSame([$step::getType() => $step], $this->subject->getAppliedSteps()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function isStepAppliedTestsWhetherStepIsApplied(): void { $step = new Tests\Fixtures\DummyStep(); @@ -107,7 +108,7 @@ public function isStepAppliedTestsWhetherStepIsApplied(): void )); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function applyStepAddsStepToAppliedSteps(): void { $step = new Tests\Fixtures\DummyStep(); @@ -119,7 +120,7 @@ public function applyStepAddsStepToAppliedSteps(): void self::assertTrue($this->subject->isStepApplied($step)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getProcessedFilesReturnsProcessedFiles(): void { self::assertSame([], $this->subject->getProcessedFiles()); @@ -137,13 +138,13 @@ public function getProcessedFilesReturnsProcessedFiles(): void self::assertSame([$barFile], $this->subject->getProcessedFiles('/bar')); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getWrittenDirectoryReturnsTemporaryDirectoryIfBuildWasNotMirrored(): void { self::assertSame($this->instructions->getTemporaryDirectory(), $this->subject->getWrittenDirectory()); } - #[\PHPUnit\Framework\Attributes\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 66c3546e..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,7 +44,7 @@ protected function setUp(): void $this->subject = Src\Builder\Config\ConfigFactory::create(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function buildFromFileThrowsExceptionIfFileContentsAreInvalid(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -53,7 +53,7 @@ public function buildFromFileThrowsExceptionIfFileContentsAreInvalid(): void $this->subject->buildFromFile(dirname(__DIR__, 2).'/Fixtures/Files/invalid-config.yaml', 'foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function buildFromFileReturnsHydratedConfigObject(): void { $createConfig = fn (string $type): Src\Builder\Config\Config => new Src\Builder\Config\Config( @@ -132,7 +132,7 @@ public function buildFromFileReturnsHydratedConfigObject(): void } } - #[\PHPUnit\Framework\Attributes\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 75ec18e8..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,7 +45,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createCreatesTemplateDirectoryIfItDoesNotExist(): void { $templateDirectory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); @@ -57,7 +57,7 @@ public function createCreatesTemplateDirectoryIfItDoesNotExist(): void self::assertDirectoryExists($templateDirectory); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function readConfigThrowsExceptionIfTemplateHasNoComposerJson(): void { $templateDirectory = dirname(__DIR__, 2).'/Fixtures'; @@ -70,7 +70,7 @@ public function readConfigThrowsExceptionIfTemplateHasNoComposerJson(): void $subject->readConfig('foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function readConfigThrowsExceptionIfTemplateWithGivenIdentifierDoesNotExist(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -80,7 +80,7 @@ public function readConfigThrowsExceptionIfTemplateWithGivenIdentifierDoesNotExi $this->subject->readConfig('foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function readConfigThrowsExceptionIfTemplateContainsMultipleConfigFiles(): void { $subject = Src\Builder\Config\ConfigReader::create( @@ -94,7 +94,7 @@ public function readConfigThrowsExceptionIfTemplateContainsMultipleConfigFiles() $subject->readConfig('cpsit/project-builder-template-invalid'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function readConfigReturnsHydratedConfigObject(): void { $actual = $this->subject->readConfig('cpsit/project-builder-template-yaml'); @@ -106,7 +106,7 @@ public function readConfigReturnsHydratedConfigObject(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function hasConfigChecksWhetherConfigWithGivenIdentifierExists(): void { self::assertTrue($this->subject->hasConfig('cpsit/project-builder-template-json')); @@ -114,7 +114,7 @@ public function hasConfigChecksWhetherConfigWithGivenIdentifierExists(): void self::assertFalse($this->subject->hasConfig('foo')); } - #[\PHPUnit\Framework\Attributes\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 71c1a24a..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,19 +53,19 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getIdentifierReturnsIdentifier(): void { self::assertSame('identifier', $this->subject->getIdentifier()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getNameReturnsName(): void { self::assertSame('name', $this->subject->getName()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getStepsReturnsSteps(): void { self::assertEquals( @@ -76,7 +76,7 @@ public function getStepsReturnsSteps(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getPropertiesReturnsProperties(): void { self::assertEquals( @@ -87,7 +87,7 @@ public function getPropertiesReturnsProperties(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getDeclaringFileThrowsExceptionIfDeclaringFileIsNotSet(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -97,13 +97,13 @@ public function getDeclaringFileThrowsExceptionIfDeclaringFileIsNotSet(): void $this->subject->getDeclaringFile(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function setDeclaringFileAppliesDeclaringFile(): void { self::assertSame('foo', $this->subject->setDeclaringFile('foo')->getDeclaringFile()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTemplateSourceThrowsExceptionIfTemplateSourceIsNotSet(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -113,7 +113,7 @@ public function getTemplateSourceThrowsExceptionIfTemplateSourceIsNotSet(): void $this->subject->getTemplateSource(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function setTemplateSourceAppliesTemplateSource(): void { $templateSource = new Src\Template\TemplateSource( @@ -124,7 +124,7 @@ public function setTemplateSourceAppliesTemplateSource(): void self::assertSame($templateSource, $this->subject->setTemplateSource($templateSource)->getTemplateSource()); } - #[\PHPUnit\Framework\Attributes\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 d0b61b2c..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,9 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class FileTypeTest extends TestCase +final class FileTypeTest extends Framework\TestCase { - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function fromExtensionThrowsExceptionIfGivenExtensionIsNotSupported(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -45,8 +45,8 @@ public function fromExtensionThrowsExceptionIfGivenExtensionIsNotSupported(): vo Src\Builder\Config\FileType::fromExtension('php'); } - #[\PHPUnit\Framework\Attributes\DataProvider('fromExtensionReturnsFileTypeOfGivenExtensionDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('fromExtensionReturnsFileTypeOfGivenExtensionDataProvider')] public function fromExtensionReturnsFileTypeOfGivenExtension( string $extension, Src\Builder\Config\FileType $expected, @@ -54,7 +54,7 @@ public function fromExtensionReturnsFileTypeOfGivenExtension( self::assertSame($expected, Src\Builder\Config\FileType::fromExtension($extension)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function fromFileThrowsExceptionIfExtensionOfGivenFileIsNotSupported(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -64,8 +64,8 @@ public function fromFileThrowsExceptionIfExtensionOfGivenFileIsNotSupported(): v Src\Builder\Config\FileType::fromFile(__FILE__); } - #[\PHPUnit\Framework\Attributes\DataProvider('fromFileReturnsFileTypeOfGivenFileDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('fromFileReturnsFileTypeOfGivenFileDataProvider')] public function fromFileReturnsFileTypeOfGivenFile( string $file, Src\Builder\Config\FileType $expected, diff --git a/tests/src/Builder/Config/ValueObject/FileConditionTest.php b/tests/src/Builder/Config/ValueObject/FileConditionTest.php index 6edcd5f2..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,25 +42,25 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\FileCondition('foo', 'bar', 'target'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('foo', $this->subject->getPath()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getConditionReturnsCondition(): void { self::assertSame('bar', $this->subject->getCondition()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function hasConditionReturnsTrue(): void { self::assertTrue($this->subject->hasCondition()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function conditionMatchesChecksIfConditionMatches(): void { $expressionLanguage = new ExpressionLanguage\ExpressionLanguage(); @@ -69,7 +69,7 @@ public function conditionMatchesChecksIfConditionMatches(): void self::assertTrue($this->subject->conditionMatches($expressionLanguage, ['bar' => true])); } - #[\PHPUnit\Framework\Attributes\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 605046c2..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,13 +42,13 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\PropertyOption('foo', 'bar'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getValueReturnsValue(): void { self::assertSame('foo', $this->subject->getValue()); } - #[\PHPUnit\Framework\Attributes\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 159fbf5d..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,7 +54,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getSubPropertiesReturnsSubProperties(): void { self::assertEquals( @@ -69,7 +69,7 @@ public function getSubPropertiesReturnsSubProperties(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function hasSubPropertiesChecksWhetherPropertyHasSubProperties(): void { self::assertTrue($this->subject->hasSubProperties()); @@ -79,19 +79,19 @@ public function hasSubPropertiesChecksWhetherPropertyHasSubProperties(): void self::assertFalse($subject->hasSubProperties()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getIdentifierReturnsIdentifier(): void { self::assertSame('identifier', $this->subject->getIdentifier()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('path', $this->subject->getPath()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getPathFallsBackToIdentifierIfPathIsNotSet(): void { $subject = new Src\Builder\Config\ValueObject\Property('identifier', 'name'); @@ -99,19 +99,19 @@ public function getPathFallsBackToIdentifierIfPathIsNotSet(): void self::assertSame('identifier', $subject->getPath()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getNameReturnsName(): void { self::assertSame('name', $this->subject->getName()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getValueReturnsValue(): void { self::assertSame('value', $this->subject->getValue()); } - #[\PHPUnit\Framework\Attributes\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 d04dc1b2..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,13 +41,13 @@ protected function setUp(): void $this->subject = new Src\Builder\Config\ValueObject\PropertyValidator('foo', ['bar' => 'bar']); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getOptionsReturnsOptions(): void { self::assertSame(['bar' => 'bar'], $this->subject->getOptions()); } - #[\PHPUnit\Framework\Attributes\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 a5e12fa7..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,7 +47,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getFileConditionsReturnsFileConditions(): void { self::assertEquals( @@ -58,13 +58,13 @@ public function getFileConditionsReturnsFileConditions(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTemplateFileReturnsTemplateFile(): void { self::assertSame('foo', $this->subject->getTemplateFile()); } - #[\PHPUnit\Framework\Attributes\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 4b8f0b14..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,7 +44,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\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 c50b6c1f..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,13 +57,13 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getPathReturnsPath(): void { self::assertSame('path', $this->subject->getPath()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getPathConstructsPathFromIdentifierAndParentProperty(): void { $subject = new Src\Builder\Config\ValueObject\SubProperty( @@ -76,7 +76,7 @@ public function getPathConstructsPathFromIdentifierAndParentProperty(): void self::assertSame('parent-identifier.identifier', $subject->getPath()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getOptionsReturnsOptions(): void { self::assertEquals( @@ -87,19 +87,19 @@ public function getOptionsReturnsOptions(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function canHaveMultipleValuesReturnsTrue(): void { self::assertTrue($this->subject->canHaveMultipleValues()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getDefaultValueReturnsDefaultValue(): void { self::assertSame('defaultValue', $this->subject->getDefaultValue()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getValidatorsReturnsValidators(): void { self::assertEquals( @@ -110,7 +110,7 @@ public function getValidatorsReturnsValidators(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function isRequiredChecksIfNotEmptyValidatorIsSet(): void { self::assertFalse($this->subject->isRequired()); @@ -127,7 +127,7 @@ public function isRequiredChecksIfNotEmptyValidatorIsSet(): void self::assertTrue($subject->isRequired()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getParentReturnsParentProperty(): void { self::assertEquals( @@ -136,7 +136,7 @@ public function getParentReturnsParentProperty(): void ); } - #[\PHPUnit\Framework\Attributes\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 39610cb0..63cb2cd7 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\Console; use Symfony\Component\Filesystem; @@ -50,7 +51,7 @@ protected function setUp(): void $this->targetDirectory = Src\Helper\FilesystemHelper::getNewTemporaryDirectory(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runRunsThroughAllConfiguredSteps(): void { self::$io->setUserInputs(['foo']); @@ -87,7 +88,7 @@ public function runRunsThroughAllConfiguredSteps(): void self::assertInstanceOf(Src\Event\ProjectBuildFinishedEvent::class, $this->eventListener->dispatchedEvents[6]); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runRevertsAppliedStepsOnStepFailure(): void { $exception = null; @@ -116,7 +117,7 @@ public function runRevertsAppliedStepsOnStepFailure(): void self::assertInstanceOf(Src\Event\BuildStepRevertedEvent::class, $this->eventListener->dispatchedEvents[2]); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runRevertsAppliedStepsAndExistsIfStoppableStepFailed(): void { self::$io->setUserInputs(['foo', 'no']); @@ -127,7 +128,7 @@ public function runRevertsAppliedStepsAndExistsIfStoppableStepFailed(): void self::assertFalse($actual->isMirrored()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function dumpArtifactDumpsBuildArtifact(): void { self::$io->setUserInputs(['foo']); @@ -139,7 +140,7 @@ public function dumpArtifactDumpsBuildArtifact(): void self::assertTrue($result->isStepApplied('dumpBuildArtifact')); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function cleanUpCleansUpRemainingFilesInTargetDirectory(): void { self::$io->setUserInputs(['foo']); diff --git a/tests/src/Builder/Generator/Step/CleanUpStepTest.php b/tests/src/Builder/Generator/Step/CleanUpStepTest.php index 1b4d3566..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,7 +53,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runCleansUpRemainingFilesInTargetDirectory(): void { $targetDirectory = $this->result->getInstructions()->getTargetDirectory(); @@ -70,7 +71,7 @@ public function runCleansUpRemainingFilesInTargetDirectory(): void self::assertTrue($this->result->isStepApplied('cleanUp')); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function revertThrowsException(): void { $this->expectException(LogicException::class); @@ -80,7 +81,7 @@ public function revertThrowsException(): void $this->subject->revert($this->result); } - #[\PHPUnit\Framework\Attributes\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 fdab4efe..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,7 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\CollectBuildInstructionsStep::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runAppliesNullAsDefaultValueOnSkippedProperties(): void { $config = new Src\Builder\Config\Config( @@ -71,7 +72,7 @@ public function runAppliesNullAsDefaultValueOnSkippedProperties(): void self::assertNull($buildResult->getInstructions()->getTemplateVariable('foo')); } - #[\PHPUnit\Framework\Attributes\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 febd7c3f..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,7 +61,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runDoesNothingIfBuildArtifactWasNotGenerated(): void { self::assertTrue($this->subject->run($this->buildResult)); @@ -68,7 +69,7 @@ public function runDoesNothingIfBuildArtifactWasNotGenerated(): void self::assertFileDoesNotExist($this->buildArtifact->getFile()->getPathname()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runDumpsBuildArtifact(): void { $this->buildResult->setBuildArtifact($this->buildArtifact); @@ -82,7 +83,7 @@ public function runDumpsBuildArtifact(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function revertDoesNothingIfBuildArtifactWasNotGenerated(): void { $artifactPath = $this->buildArtifact->getFile()->getPathname(); @@ -98,7 +99,7 @@ public function revertDoesNothingIfBuildArtifactWasNotGenerated(): void self::assertStringEqualsFile($artifactPath, 'test'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function revertRemovesDumpedBuildArtifact(): void { $artifactPath = $this->buildArtifact->getFile()->getPathname(); @@ -116,7 +117,7 @@ public function revertRemovesDumpedBuildArtifact(): void self::assertFileDoesNotExist($artifactPath); } - #[\PHPUnit\Framework\Attributes\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 7c605892..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,8 +55,8 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\DataProvider('runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('runAsksForConfirmationIfBuildArtifactPathAlreadyExistsDataProvider')] public function runAsksForConfirmationIfBuildArtifactPathAlreadyExists(bool $continue, bool $expected): void { self::$io->setUserInputs([$continue ? 'yes' : 'no']); @@ -73,7 +74,7 @@ public function runAsksForConfirmationIfBuildArtifactPathAlreadyExists(bool $con ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runGeneratesBuildArtifact(): void { self::assertTrue($this->subject->run($this->buildResult)); diff --git a/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php b/tests/src/Builder/Generator/Step/InstallComposerDependenciesStepTest.php index 0e70ab7c..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,14 +53,14 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runInstallsComposerDependencies(): void { self::assertTrue($this->subject->run($this->buildResult)); self::assertTrue($this->buildResult->isStepApplied($this->subject)); } - #[\PHPUnit\Framework\Attributes\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 e7b599e4..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,7 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\Interaction\InteractionFactory::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -51,7 +52,7 @@ public function getThrowsExceptionIfNoInteractionOfGivenTypeIsAvailable(): void $this->subject->get('foo'); } - #[\PHPUnit\Framework\Attributes\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 0f2a595d..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,7 +44,7 @@ protected function setUp(): void $this->instructions = new Src\Builder\BuildInstructions(self::$config, 'foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactUsesTruAndFalseAsDefaultYesNoValues(): void { $interactionSubject = $this->buildInteractionSubject(); @@ -54,7 +55,7 @@ public function interactUsesTruAndFalseAsDefaultYesNoValues(): void self::assertFalse($this->subject->interact($interactionSubject, $this->instructions)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactReturnsValueFromMatchingOption(): void { $interactionSubject = $this->buildInteractionSubject([ @@ -68,7 +69,7 @@ public function interactReturnsValueFromMatchingOption(): void self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactUsesFallbackConditionIfOnlyOptionValueIsConfigured(): void { $interactionSubject = $this->buildInteractionSubject([ diff --git a/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php b/tests/src/Builder/Generator/Step/Interaction/SelectInteractionTest.php index 1bd17457..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,7 +44,7 @@ protected function setUp(): void $this->instructions = new Src\Builder\BuildInstructions(self::$config, 'foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactReturnsNullOnEmptyUserInput(): void { $interactionSubject = $this->buildInteractionSubject(); @@ -51,7 +52,7 @@ public function interactReturnsNullOnEmptyUserInput(): void self::assertNull($this->subject->interact($interactionSubject, $this->instructions)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection(): void { $propertyOptions = [ @@ -63,7 +64,7 @@ public function interactReturnsFirstOptionOnEmptyUserInputAndRequiredSelection() self::assertSame('foo', $this->subject->interact($interactionSubject, $this->instructions)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection(): void { $propertyOptions = [ @@ -75,7 +76,7 @@ public function interactReturnsDefaultValueOnEmptyUserInputAndRequiredSelection( self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactReturnsSelectedOption(): void { $propertyOptions = [ @@ -89,7 +90,7 @@ public function interactReturnsSelectedOption(): void self::assertSame('bar', $this->subject->interact($interactionSubject, $this->instructions)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function interactReturnsSelectedOptionsIfMultipleOptionsAreAllowed(): void { $propertyOptions = [ diff --git a/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php b/tests/src/Builder/Generator/Step/ProcessSharedSourceFilesStepTest.php index 246cfebd..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,7 +49,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runProcessesSourceFilesAndAppliesStep(): void { $actual = $this->subject->run($this->result); @@ -65,7 +66,7 @@ public function runProcessesSourceFilesAndAppliesStep(): void self::assertTrue($this->result->isStepApplied($this->subject)); } - #[\PHPUnit\Framework\Attributes\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 08a1a6dd..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,7 +52,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runProcessesSourceFilesAndAppliesStep(): void { $actual = $this->subject->run($this->result); @@ -72,8 +73,8 @@ public function runProcessesSourceFilesAndAppliesStep(): void * @param list $fileConditions * @param list $notExpected */ - #[\PHPUnit\Framework\Attributes\DataProvider('runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('runCanProcessTheSameSourceFileWithMultipleConditionsDataProvider')] public function runCanProcessTheSameSourceFileWithMultipleConditions( array $fileConditions, string $expected, @@ -102,7 +103,7 @@ public function runCanProcessTheSameSourceFileWithMultipleConditions( } } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function revertRemovesProcessedFiles(): void { $this->subject->run($this->result); diff --git a/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php b/tests/src/Builder/Generator/Step/ShowNextStepsStepTest.php index 8f88b181..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,7 +48,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runThrowsExceptionIfNoTemplateFileIsGiven(): void { $this->expectException(Src\Exception\InvalidConfigurationException::class); @@ -57,7 +58,7 @@ public function runThrowsExceptionIfNoTemplateFileIsGiven(): void $this->subject->run($this->result); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runThrowsExceptionIfTemplateFileDoesNotExist(): void { $this->subject->setConfig( @@ -74,7 +75,7 @@ public function runThrowsExceptionIfTemplateFileDoesNotExist(): void $this->subject->run($this->result); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runThrowsExceptionIfTemplateFileCannotBeRendered(): void { $this->subject->setConfig( @@ -94,7 +95,7 @@ public function runThrowsExceptionIfTemplateFileCannotBeRendered(): void $this->subject->run($this->result); } - #[\PHPUnit\Framework\Attributes\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 54d07ec7..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,7 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Generator\Step\StepFactory::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getThrowsExceptionIfGivenStepIsNotSupported(): void { $step = new Src\Builder\Config\ValueObject\Step('foo'); @@ -53,7 +54,7 @@ public function getThrowsExceptionIfGivenStepIsNotSupported(): void $this->subject->get($step); } - #[\PHPUnit\Framework\Attributes\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 8f7db351..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,7 +47,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\GenericFileWriter::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function writeCopiesGivenFileToTemporaryDirectory(): void { $instructions = new Src\Builder\BuildInstructions( @@ -65,7 +66,7 @@ public function writeCopiesGivenFileToTemporaryDirectory(): void (new Filesystem\Filesystem())->remove(dirname($expected)); } - #[\PHPUnit\Framework\Attributes\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 70f15f30..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,8 +44,8 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\JsonFileWriter::class); } - #[\PHPUnit\Framework\Attributes\DataProvider('writeDumpsJsonToGivenFileDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('writeDumpsJsonToGivenFileDataProvider')] public function writeDumpsJsonToGivenFile(string|JsonSerializable $json, string $expected): void { $file = Src\Helper\FilesystemHelper::createFileObject( diff --git a/tests/src/Builder/Writer/TemplateWriterTest.php b/tests/src/Builder/Writer/TemplateWriterTest.php index dbc07a73..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,7 +47,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\TemplateWriter::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function writeWritesRenderedTemplateFileToTemporaryDirectory(): void { $instructions = new Src\Builder\BuildInstructions( @@ -80,7 +81,7 @@ public function writeWritesRenderedTemplateFileToTemporaryDirectory(): void (new Filesystem\Filesystem())->remove(dirname($expected)); } - #[\PHPUnit\Framework\Attributes\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 3c2e146e..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,7 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Builder\Writer\WriterFactory::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getThrowsExceptionIfFileIsNotSupported(): void { $subject = new Src\Builder\Writer\WriterFactory([]); @@ -53,7 +54,7 @@ public function getThrowsExceptionIfFileIsNotSupported(): void $subject->get('foo'); } - #[\PHPUnit\Framework\Attributes\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/ApplicationTest.php b/tests/src/Console/ApplicationTest.php index 5899439a..7c812b2d 100644 --- a/tests/src/Console/ApplicationTest.php +++ b/tests/src/Console/ApplicationTest.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 dirname; @@ -68,7 +69,7 @@ protected function setUp(): void self::$io->makeInteractive(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runThrowsExceptionIfInputIsNonInteractive(): void { self::$io->makeInteractive(false); @@ -80,7 +81,7 @@ public function runThrowsExceptionIfInputIsNonInteractive(): void self::assertStringContainsString('This command cannot be run in non-interactive mode.', $output); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runMirrorsSourceFilesToTemporaryDirectory(): void { $temporaryDirectory = $this->targetDirectory.'/.build/src'; @@ -94,7 +95,7 @@ public function runMirrorsSourceFilesToTemporaryDirectory(): void self::assertDirectoryExists($temporaryDirectory); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runShowsWelcomeScreen(): void { self::$io->setUserInputs(['no']); @@ -106,7 +107,7 @@ public function runShowsWelcomeScreen(): void self::assertStringContainsString('Welcome to the Project Builder', $output); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderProvidesNoTemplates(): void { self::$io->setUserInputs(['yes', '', 'no']); @@ -119,7 +120,7 @@ public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProvide self::assertStringContainsString('Where can we find the project template?', $output); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProviderShouldBeChanged(): void { $this->templateProvider->templateSources = [ @@ -136,7 +137,7 @@ public function runAllowsSelectingADifferentTemplateProviderIfTheSelectedProvide self::assertStringContainsStringMultipleTimes('Try a different provider (e.g. Satis or GitHub)', $output); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runFailsIfProjectGenerationIsAborted(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -149,7 +150,7 @@ public function runFailsIfProjectGenerationIsAborted(): void self::assertSame(2, $this->subject->run()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runHandlesErrorDuringProjectGeneration(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -166,7 +167,7 @@ public function runHandlesErrorDuringProjectGeneration(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runGeneratesNewProjectFromSelectedTemplate(): void { $this->templateProvider->installationPath = $this->targetDirectory; @@ -183,7 +184,7 @@ public function runGeneratesNewProjectFromSelectedTemplate(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function runUsesDefaultTemplateProvidersIfNoProvidersAreConfigured(): void { /** @var Src\Template\Provider\PackagistProvider $packagistProvider */ 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 ac824dad..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; @@ -51,8 +52,8 @@ protected function setUp(): void /** * @param list $expectedOutput */ - #[\PHPUnit\Framework\Attributes\DataProvider('handleExceptionWritesFormattedErrorMessageDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('handleExceptionWritesFormattedErrorMessageDataProvider')] public function handleExceptionWritesFormattedErrorMessage(Throwable $exception, array $expectedOutput): void { $this->subject->handleException($exception); @@ -64,7 +65,7 @@ public function handleExceptionWritesFormattedErrorMessage(Throwable $exception, } } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function handleExceptionThrowsExceptionIfOutputIsVerbose(): void { $io = new IO\BufferIO('', Console\Output\OutputInterface::VERBOSITY_VERBOSE); diff --git a/tests/src/Event/BeforeTemplateRenderedEventTest.php b/tests/src/Event/BeforeTemplateRenderedEventTest.php index 57184665..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,7 +52,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTwigReturnsTwigEnvironment(): void { self::assertSame( @@ -60,7 +61,7 @@ public function getTwigReturnsTwigEnvironment(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getInstructionsReturnsBuildInstructions(): void { self::assertSame( @@ -69,7 +70,7 @@ public function getInstructionsReturnsBuildInstructions(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getVariablesReturnsVariables(): void { self::assertSame( @@ -81,7 +82,7 @@ public function getVariablesReturnsVariables(): void ); } - #[\PHPUnit\Framework\Attributes\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 4e08b193..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,7 +52,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getStepReturnsStep(): void { self::assertSame( @@ -60,7 +61,7 @@ public function getStepReturnsStep(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getBuildResultReturnsBuildResult(): void { self::assertSame( @@ -69,7 +70,7 @@ public function getBuildResultReturnsBuildResult(): void ); } - #[\PHPUnit\Framework\Attributes\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 925f43ab..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,7 +51,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getStepReturnsStep(): void { self::assertSame( @@ -59,7 +60,7 @@ public function getStepReturnsStep(): void ); } - #[\PHPUnit\Framework\Attributes\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 9f4815e2..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,7 +48,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\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 42242d26..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,7 +46,7 @@ protected function setUp(): void ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getInstructionsReturnsBuildInstructions(): void { self::assertSame( diff --git a/tests/src/Exception/MisconfiguredValidatorExceptionTest.php b/tests/src/Exception/MisconfiguredValidatorExceptionTest.php index 779d56c8..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,9 +32,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class MisconfiguredValidatorExceptionTest extends TestCase +final class MisconfiguredValidatorExceptionTest extends Framework\TestCase { - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function forUnexpectedOptionReturnsExceptionForUnexpectedOption(): void { $actual = Src\Exception\MisconfiguredValidatorException::forUnexpectedOption('foo', 'baz'); @@ -43,7 +43,7 @@ public function forUnexpectedOptionReturnsExceptionForUnexpectedOption(): void self::assertSame(1673886742, $actual->getCode()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function forUnexpectedOptionsReturnsExceptionForUnexpectedOptions(): void { $actual = Src\Exception\MisconfiguredValidatorException::forUnexpectedOptions('foo', ['baz', 'boo', 'dummy']); diff --git a/tests/src/Helper/ArrayHelperTest.php b/tests/src/Helper/ArrayHelperTest.php index 97168b39..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,9 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class ArrayHelperTest extends TestCase +final class ArrayHelperTest extends Framework\TestCase { - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getValueByPathReturnsValueAtGivenPath(): void { $object = new stdClass(); @@ -59,7 +59,7 @@ public function getValueByPathReturnsValueAtGivenPath(): void self::assertNull(Src\Helper\ArrayHelper::getValueByPath($subject, 'foo.baz.boo')); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function setValueByPathSetsValueAtGivenPath(): void { $subject = [ diff --git a/tests/src/Helper/FilesystemHelperTest.php b/tests/src/Helper/FilesystemHelperTest.php index 4d9fffe4..56f4facd 100644 --- a/tests/src/Helper/FilesystemHelperTest.php +++ b/tests/src/Helper/FilesystemHelperTest.php @@ -24,7 +24,7 @@ namespace CPSIT\ProjectBuilder\Tests\Helper; use CPSIT\ProjectBuilder as Src; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; use function dirname; use function putenv; @@ -35,9 +35,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class FilesystemHelperTest extends TestCase +final class FilesystemHelperTest extends Framework\TestCase { - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createFileObjectReturnsFileObjectForGivenFile(): void { $baseDir = __DIR__; @@ -50,7 +50,7 @@ public function createFileObjectReturnsFileObjectForGivenFile(): void self::assertSame($baseDir.'/'.$relativePathname, $actual->getPathname()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void { $prefix = sys_get_temp_dir(); @@ -61,7 +61,7 @@ public function getNewTemporaryDirectoryReturnsUniqueTemporaryDirectory(): void self::assertStringStartsWith($prefix, $actual); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getProjectRootPathReturnsProjectRootPathFromEnvironmentVariable(): void { $projectRootPath = __DIR__.'/..'; @@ -73,7 +73,7 @@ public function getProjectRootPathReturnsProjectRootPathFromEnvironmentVariable( putenv('PROJECT_BUILDER_ROOT_PATH'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getProjectRootPathReturnsProjectRootPathFromComposerPackageArtifact(): void { self::assertSame(dirname(__DIR__, 3), Src\Helper\FilesystemHelper::getProjectRootPath()); diff --git a/tests/src/Helper/StringHelperTest.php b/tests/src/Helper/StringHelperTest.php index b5183814..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,19 +34,19 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class StringHelperTest extends TestCase +final class StringHelperTest extends Framework\TestCase { /** * @param value-of $case */ - #[\PHPUnit\Framework\Attributes\DataProvider('convertCaseConvertsStringToGivenCaseDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[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)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function convertCaseThrowsExceptionWhenConvertingToUnsupportedCase(): void { $this->expectException(UnhandledMatchError::class); @@ -58,8 +58,8 @@ public function convertCaseThrowsExceptionWhenConvertingToUnsupportedCase(): voi /** * @param array $replacePairs */ - #[\PHPUnit\Framework\Attributes\DataProvider('interpolateInterpolatedGivenStringWithKeyValuePairsDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[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)); diff --git a/tests/src/IO/InputReaderTest.php b/tests/src/IO/InputReaderTest.php index 48756bfe..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,7 +42,7 @@ protected function setUp(): void $this->subject = new Src\IO\InputReader(self::$io); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function staticValueReturnsUserInput(): void { self::$io->setUserInputs(['Bob']); @@ -50,13 +51,13 @@ public function staticValueReturnsUserInput(): void self::assertStringContainsString('What\'s your name? (optional) [Alice]', self::$io->getOutput()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function staticValueReturnsDefaultValue(): void { self::assertSame('Alice', $this->subject->staticValue('What\'s your name?', 'Alice')); } - #[\PHPUnit\Framework\Attributes\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 bda52c3a..cad243dc 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\Filesystem; use function implode; @@ -47,7 +48,7 @@ protected function setUp(): void $this->subject = self::$container->get('app.messenger'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function selectProviderCanHandlePackagistProvider(): void { $packagistProvider = new Src\Template\Provider\PackagistProvider( @@ -60,7 +61,7 @@ public function selectProviderCanHandlePackagistProvider(): void self::assertSame($packagistProvider, $this->subject->selectProvider([$packagistProvider])); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function selectProviderCanHandleCustomComposerProvider(): void { $customProvider = new Src\Template\Provider\ComposerProvider( @@ -74,7 +75,7 @@ public function selectProviderCanHandleCustomComposerProvider(): void self::assertSame('https://www.example.com', $customProvider->getUrl()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplateSources(): void { $provider = new Tests\Fixtures\DummyProvider(); @@ -84,8 +85,8 @@ public function selectTemplateSourceThrowsExceptionIfGivenProviderListsNoTemplat $this->subject->selectTemplateSource($provider); } - #[\PHPUnit\Framework\Attributes\DataProvider('selectTemplateSourceReturnsSelectedTemplateSourceDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('selectTemplateSourceReturnsSelectedTemplateSourceDataProvider')] public function selectTemplateSourceReturnsSelectedTemplateSource( Package\PackageInterface $package, string $expected, @@ -100,8 +101,8 @@ public function selectTemplateSourceReturnsSelectedTemplateSource( self::assertStringContainsString($expected, self::$io->getOutput()); } - #[\PHPUnit\Framework\Attributes\DataProvider('confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('confirmTemplateSourceRetryAsksForConfirmationAndReturnsResultDataProvider')] public function confirmTemplateSourceRetryAsksForConfirmationAndReturnsResult(string $input, bool $expected): void { $exception = new Exception('Something went wrong.'); diff --git a/tests/src/IO/Validator/AbstractValidatorTest.php b/tests/src/IO/Validator/AbstractValidatorTest.php index be37b7a2..786f8416 100644 --- a/tests/src/IO/Validator/AbstractValidatorTest.php +++ b/tests/src/IO/Validator/AbstractValidatorTest.php @@ -25,7 +25,7 @@ use CPSIT\ProjectBuilder as Src; use CPSIT\ProjectBuilder\Tests; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework; /** * AbstractValidatorTest. @@ -33,9 +33,9 @@ * @author Elias Häußler * @license GPL-3.0-or-later */ -final class AbstractValidatorTest extends TestCase +final class AbstractValidatorTest extends Framework\TestCase { - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function constructorThrowsExceptionIfInvalidOptionsAreGiven(): void { $this->expectExceptionObject( diff --git a/tests/src/IO/Validator/CallbackValidatorTest.php b/tests/src/IO/Validator/CallbackValidatorTest.php index 70cf09e5..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,7 +42,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\CallbackValidator(['callback' => $this->validate(...)]); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function constructorThrowsExceptionIfNoCallbackIsGiven(): void { $this->expectExceptionObject( @@ -52,7 +52,7 @@ public function constructorThrowsExceptionIfNoCallbackIsGiven(): void new Src\IO\Validator\CallbackValidator(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function constructorThrowsExceptionIfInvalidCallbackIsGiven(): void { $this->expectExceptionObject( @@ -63,8 +63,8 @@ public function constructorThrowsExceptionIfInvalidCallbackIsGiven(): void new Src\IO\Validator\CallbackValidator(['callback' => 'foo']); } - #[\PHPUnit\Framework\Attributes\DataProvider('invokeCallsConfiguredCallbackDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeCallsConfiguredCallbackDataProvider')] public function invokeCallsConfiguredCallback(?string $input, ?string $expected): void { $actual = ($this->subject)($input); diff --git a/tests/src/IO/Validator/ChainedValidatorTest.php b/tests/src/IO/Validator/ChainedValidatorTest.php index 64c03df9..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,7 +46,7 @@ protected function setUp(): void ]); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function constructorAddsGivenValidators(): void { $emailValidator = new Src\IO\Validator\EmailValidator(); @@ -58,7 +58,7 @@ public function constructorAddsGivenValidators(): void self::assertFalse($this->subject->has($urlValidator)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeInvokesAllValidators(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -68,7 +68,7 @@ public function invokeInvokesAllValidators(): void ($this->subject)(null); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeInvokesAllValidatorsAndReturnsModifiedInput(): void { $actual = ($this->subject)('foo@bar.de'); @@ -76,7 +76,7 @@ public function invokeInvokesAllValidatorsAndReturnsModifiedInput(): void self::assertSame('FOO@BAR.DE', $actual); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function removeRemovesValidator(): void { $validator = new Src\IO\Validator\EmailValidator(); @@ -85,13 +85,13 @@ public function removeRemovesValidator(): void self::assertFalse($this->subject->remove($validator)->has($validator)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getTypeReturnsType(): void { self::assertSame('chained', $this->subject::getType()); } - #[\PHPUnit\Framework\Attributes\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 75ce6a66..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,7 +41,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\EmailValidator(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeReturnsNullOnNullInput(): void { $actual = ($this->subject)(null); @@ -49,7 +49,7 @@ public function invokeReturnsNullOnNullInput(): void self::assertNull($actual); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -59,7 +59,7 @@ public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void ($this->subject)('foo'); } - #[\PHPUnit\Framework\Attributes\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 c2b2aaf3..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,8 +42,8 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\NotEmptyValidator(); } - #[\PHPUnit\Framework\Attributes\DataProvider('invokeThrowsExceptionIfGivenInputIsEmptyDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeThrowsExceptionIfGivenInputIsEmptyDataProvider')] public function invokeThrowsExceptionIfGivenInputIsEmpty(?string $input): void { $this->expectException(Src\Exception\ValidationException::class); @@ -53,7 +53,7 @@ public function invokeThrowsExceptionIfGivenInputIsEmpty(?string $input): void ($this->subject)($input); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsEnabled(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -64,7 +64,7 @@ public function invokeThrowsExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIs $subject(' '); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictCheckIsNotEnabled(): void { $actual = ($this->subject)(' '); @@ -72,7 +72,7 @@ public function invokeDoesNotThrowExceptionIfGivenInputIsAnEmptyStringAndStrictC self::assertSame(' ', $actual); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeReturnsGivenInputIfGivenInputIsValid(): void { $actual = ($this->subject)('foo'); diff --git a/tests/src/IO/Validator/UrlValidatorTest.php b/tests/src/IO/Validator/UrlValidatorTest.php index 050439e2..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,7 +41,7 @@ protected function setUp(): void $this->subject = new Src\IO\Validator\UrlValidator(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeReturnsNullOnNullInput(): void { $actual = ($this->subject)(null); @@ -49,7 +49,7 @@ public function invokeReturnsNullOnNullInput(): void self::assertNull($actual); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void { $this->expectException(Src\Exception\ValidationException::class); @@ -59,7 +59,7 @@ public function invokeThrowsExceptionIfGivenInputIsNotAValidEmailAddress(): void ($this->subject)('foo'); } - #[\PHPUnit\Framework\Attributes\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 479eab5f..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,7 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\IO\Validator\ValidatorFactory::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getThrowsExceptionIfGivenTypeIsNotSupported(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -53,7 +54,7 @@ public function getThrowsExceptionIfGivenTypeIsNotSupported(): void $this->subject->get($validator); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getReturnsValidatorForGivenType(): void { $validator = new Src\Builder\Config\ValueObject\PropertyValidator('email'); @@ -61,7 +62,7 @@ public function getReturnsValidatorForGivenType(): void self::assertInstanceOf(Src\IO\Validator\EmailValidator::class, $this->subject->get($validator)); } - #[\PHPUnit\Framework\Attributes\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 73b900ba..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,7 +50,7 @@ protected function setUp(): void $this->subject = new Src\Naming\NameVariantBuilder($this->instructions); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createVariantThrowsExceptionIfGivenVariantIsUnsupported(): void { $this->expectException(UnhandledMatchError::class); @@ -58,7 +59,7 @@ public function createVariantThrowsExceptionIfGivenVariantIsUnsupported(): void $this->subject->createVariant('foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -67,8 +68,8 @@ public function createShortVariantThrowsExceptionIfCustomerNameIsNotAvailable(): $this->subject->createShortVariant(); } - #[\PHPUnit\Framework\Attributes\DataProvider('createShortVariantReturnsShortVariantDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('createShortVariantReturnsShortVariantDataProvider')] public function createShortVariantReturnsShortVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -79,7 +80,7 @@ public function createShortVariantReturnsShortVariant(string $customerName, ?str self::assertSame($expected, $this->subject->createShortVariant()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createShortVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project.customer_name', 'foo bar'); @@ -87,7 +88,7 @@ public function createShortVariantRespectsGivenStringCase(): void self::assertSame('FooBar', $this->subject->createShortVariant(Src\StringCase::UpperCamel->value)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -96,8 +97,8 @@ public function createAbbreviationVariantThrowsExceptionIfCustomerNameIsNotAvail $this->subject->createAbbreviationVariant(); } - #[\PHPUnit\Framework\Attributes\DataProvider('createAbbreviationVariantReturnsAbbreviationVariantDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('createAbbreviationVariantReturnsAbbreviationVariantDataProvider')] public function createAbbreviationVariantReturnsAbbreviationVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -108,7 +109,7 @@ public function createAbbreviationVariantReturnsAbbreviationVariant(string $cust self::assertSame($expected, $this->subject->createAbbreviationVariant()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createAbbreviationVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project.customer_abbreviation', 'foo bar'); @@ -116,7 +117,7 @@ public function createAbbreviationVariantRespectsGivenStringCase(): void self::assertSame('FooBar', $this->subject->createAbbreviationVariant(Src\StringCase::UpperCamel->value)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -125,8 +126,8 @@ public function createFullVariantThrowsExceptionIfCustomerNameIsNotAvailable(): $this->subject->createFullVariant(); } - #[\PHPUnit\Framework\Attributes\DataProvider('createFullVariantReturnsFullVariantDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('createFullVariantReturnsFullVariantDataProvider')] public function createFullVariantReturnsFullVariant(string $customerName, ?string $projectName, string $expected): void { $this->instructions->addTemplateVariable('project', [ @@ -137,7 +138,7 @@ public function createFullVariantReturnsFullVariant(string $customerName, ?strin self::assertSame($expected, $this->subject->createFullVariant()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createFullVariantRespectsGivenStringCase(): void { $this->instructions->addTemplateVariable('project', [ @@ -148,8 +149,8 @@ public function createFullVariantRespectsGivenStringCase(): void self::assertSame('FooBarBar', $this->subject->createFullVariant(Src\StringCase::UpperCamel->value)); } - #[\PHPUnit\Framework\Attributes\DataProvider('isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] public function isDefaultProjectNameReturnsTrueIfGivenProjectNameIsTheDefault(?string $projectName, bool $expected): void { self::assertSame($expected, $this->subject::isDefaultProjectName($projectName)); diff --git a/tests/src/Resource/Http/PhpApiClientTest.php b/tests/src/Resource/Http/PhpApiClientTest.php index c655c648..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,7 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Resource\Http\PhpApiClient::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getLatestStableVersionThrowsExceptionOnInvalidResponse(): void { self::$mockHandler->append(self::createErroneousResponse()); @@ -53,7 +54,7 @@ public function getLatestStableVersionThrowsExceptionOnInvalidResponse(): void $this->subject->getLatestStableVersion('8.0'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getLatestStableVersionReturnsLatestStableVersionOfGivenBranch(): void { self::$mockHandler->append(self::createJsonResponse(['version' => '8.0.10'])); @@ -61,7 +62,7 @@ public function getLatestStableVersionReturnsLatestStableVersionOfGivenBranch(): self::assertSame('8.0.10', $this->subject->getLatestStableVersion('8.0')); } - #[\PHPUnit\Framework\Attributes\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 0d0562be..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,7 +49,7 @@ protected function setUp(): void $this->composerJson = dirname(__DIR__, 2).'/Fixtures/Templates/yaml-template/composer.json'; } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installThrowsExceptionIfGivenFileDoesNotExist(): void { $this->expectException(Src\Exception\IOException::class); @@ -58,7 +59,7 @@ public function installThrowsExceptionIfGivenFileDoesNotExist(): void $this->subject->install('foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installInstallsComposerDependenciesFromGivenFile(): void { $output = new Console\Output\BufferedOutput(); @@ -71,7 +72,7 @@ public function installInstallsComposerDependenciesFromGivenFile(): void self::assertStringNotContainsString('phpunit', $actualOutput); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installInstallsAllComposerDependenciesIncludingDevDependencies(): void { $output = new Console\Output\BufferedOutput(); @@ -84,7 +85,7 @@ public function installInstallsAllComposerDependenciesIncludingDevDependencies() self::assertStringContainsString('Installing phpunit/phpunit', $actualOutput); } - #[\PHPUnit\Framework\Attributes\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 237ff8a1..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,7 +44,7 @@ protected function setUp(): void $this->subject = new Src\Resource\Local\Git($this->runner); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getAuthorNameReturnsGitUserNameConfig(): void { $this->runner->expectedResults[] = ['Alice']; @@ -52,7 +52,7 @@ public function getAuthorNameReturnsGitUserNameConfig(): void self::assertSame('Alice', $this->subject->getAuthorName()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getAuthorNameFallsBackToGitAuthorNameConfig(): void { $this->runner->expectedResults[] = ['', 1]; @@ -61,7 +61,7 @@ public function getAuthorNameFallsBackToGitAuthorNameConfig(): void self::assertSame('Bob', $this->subject->getAuthorName()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getAuthorEmailReturnsGitUserEmailConfig(): void { $this->runner->expectedResults[] = ['foo@bar.de']; @@ -69,7 +69,7 @@ public function getAuthorEmailReturnsGitUserEmailConfig(): void self::assertSame('foo@bar.de', $this->subject->getAuthorEmail()); } - #[\PHPUnit\Framework\Attributes\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 bcb6f376..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,13 +46,13 @@ protected function setUp(): void $this->subject = new Src\Resource\Local\ProcessedFile($this->originalFile, $this->targetFile); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getOriginalFileReturnsOriginalFile(): void { self::assertSame($this->originalFile, $this->subject->getOriginalFile()); } - #[\PHPUnit\Framework\Attributes\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 39174835..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; @@ -67,8 +68,8 @@ protected function setUp(): void * @param list $packages * @param list $expected */ - #[\PHPUnit\Framework\Attributes\DataProvider('listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('listTemplateSourcesListsAllAvailableTemplateSourcesDataProvider')] public function listTemplateSourcesListsAllAvailableTemplateSources(array $packages, array $expected): void { $this->subject->packages = $packages; @@ -81,7 +82,7 @@ public function listTemplateSourcesListsAllAvailableTemplateSources(array $packa self::assertEquals($expectedTemplateSources, $this->subject->listTemplateSources()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installTemplateSourceThrowsExceptionIfInstallationFails(): void { $package = self::createPackage('foo/baz'); @@ -105,7 +106,7 @@ public function installTemplateSourceThrowsExceptionIfInstallationFails(): void $this->subject->installTemplateSource($templateSource); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installTemplateSourceThrowsExceptionIfInstallationFailsWithGivenConstraint(): void { $package = self::createPackage('foo/baz'); @@ -118,7 +119,7 @@ public function installTemplateSourceThrowsExceptionIfInstallationFailsWithGiven $this->subject->installTemplateSource($templateSource); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid(): void { $package = self::createPackageFromTemplateFixture(); @@ -138,7 +139,7 @@ public function installTemplateSourceFailsSoftlyIfGivenConstraintIsInvalid(): vo ); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installTemplateSourceFailsIfGivenConstraintCannotBeResolved(): void { $package = self::createPackageFromTemplateFixture(); @@ -157,7 +158,7 @@ public function installTemplateSourceFailsIfGivenConstraintCannotBeResolved(): v $this->subject->installTemplateSource($templateSource); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallationFailsWithGivenConstraint(): void { $package = self::createPackageFromTemplateFixture(); @@ -182,8 +183,8 @@ public function installTemplateSourceAllowsSpecifyingOtherConstraintIfInstallati /** * @param non-empty-list $packages */ - #[\PHPUnit\Framework\Attributes\DataProvider('installTemplateSourceInstallsComposerPackageDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('installTemplateSourceInstallsComposerPackageDataProvider')] public function installTemplateSourceInstallsComposerPackage( array $packages, string $constraint, @@ -202,7 +203,7 @@ public function installTemplateSourceInstallsComposerPackage( self::assertStringContainsString($expected, self::$io->getOutput()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function createRepositoryReturnsComposerRepositoryForConfiguredUrl(): void { $actual = $this->subject->testCreateRepository(); diff --git a/tests/src/Template/Provider/ComposerProviderTest.php b/tests/src/Template/Provider/ComposerProviderTest.php index ff25cd18..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,7 +54,7 @@ protected function setUp(): void $this->acceptInsecureConnections(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function requestCustomOptionsAsksAndAppliesBaseUrl(): void { self::$io->setUserInputs(['https://example.com']); @@ -63,7 +64,7 @@ public function requestCustomOptionsAsksAndAppliesBaseUrl(): void self::assertSame('https://example.com', $this->subject->getUrl()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void { $this->expectExceptionObject(Src\Exception\InvalidResourceException::create('url')); @@ -71,7 +72,7 @@ public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void $this->subject->getUrl(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function setUrlAppliesGivenUrl(): void { $this->subject->setUrl('https://example.org'); @@ -79,7 +80,7 @@ public function setUrlAppliesGivenUrl(): void self::assertSame('https://example.org', $this->subject->getUrl()); } - #[\PHPUnit\Framework\Attributes\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 fde1877b..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,7 +42,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Template\Provider\ProviderFactory::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable(): void { $this->expectException(Src\Exception\UnsupportedTypeException::class); @@ -51,7 +52,7 @@ public function getThrowsExceptionIfNoProviderOfGivenTypeIsAvailable(): void $this->subject->get('foo'); } - #[\PHPUnit\Framework\Attributes\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 64a53e9c..5bb550ed 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; @@ -64,7 +65,7 @@ protected function setUp(): void putenv('PROJECT_BUILDER_ROOT_PATH='.$this->temporaryRootPath); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function requestCustomOptionsAsksAndAppliesBaseUrl(): void { self::$io->setUserInputs(['https://example.com']); @@ -74,7 +75,7 @@ public function requestCustomOptionsAsksAndAppliesBaseUrl(): void self::assertSame('https://example.com', $this->subject->getUrl()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void { $this->expectExceptionObject(Src\Exception\InvalidResourceException::create('url')); @@ -82,7 +83,7 @@ public function getUrlThrowsExceptionIfNoUrlIsConfigured(): void $this->subject->getUrl(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function setUrlAppliesGivenUrl(): void { $this->subject->setUrl('https://example.org'); @@ -90,7 +91,7 @@ public function setUrlAppliesGivenUrl(): void self::assertSame('https://example.org', $this->subject->getUrl()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function listTemplateSourcesListsTemplatesFromConfiguredRepository(): void { $repoA = $this->initializeGitRepository('test/repo-a', ['test/repo-b' => '*']); @@ -108,7 +109,7 @@ public function listTemplateSourcesListsTemplatesFromConfiguredRepository(): voi $this->filesystem->remove($repoA); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function installTemplateSourceAsksForAdditionalRepositories(): void { $repoA = $this->initializeGitRepository('test/repo-a', ['test/repo-b' => '*']); diff --git a/tests/src/Template/TemplateSourceTest.php b/tests/src/Template/TemplateSourceTest.php index d41b82c7..aba1afb7 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,19 +48,19 @@ protected function setUp(): void $this->subject = new Src\Template\TemplateSource($this->provider, $this->package); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getProviderReturnsProvider(): void { self::assertSame($this->provider, $this->subject->getProvider()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function getPackageReturnsPackage(): void { self::assertSame($this->package, $this->subject->getPackage()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function setPackageAppliesGivenPackage(): void { $newPackage = clone $this->package; @@ -68,14 +68,14 @@ public function setPackageAppliesGivenPackage(): void self::assertSame($newPackage, $this->subject->setPackage($newPackage)->getPackage()); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function shouldUseDynamicVersionConstraintReturnsFalseInitially(): void { self::assertFalse($this->subject->shouldUseDynamicVersionConstraint()); } - #[\PHPUnit\Framework\Attributes\DataProvider('useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraintDataProvider')] public function useDynamicVersionConstraintDefinesWhetherToUseDynamicVersionConstraint( bool $useDynamicVersionConstraint, bool $expected, diff --git a/tests/src/Twig/Filter/ConvertCaseFilterTest.php b/tests/src/Twig/Filter/ConvertCaseFilterTest.php index e0897941..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,7 +42,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Filter\ConvertCaseFilter(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -51,7 +51,7 @@ public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void ($this->subject)(null); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenCaseIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -60,7 +60,7 @@ public function invokeThrowsAssertionErrorIfGivenCaseIsNotAString(): void ($this->subject)('foo'); } - #[\PHPUnit\Framework\Attributes\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 f16ecad2..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,7 +47,7 @@ protected function setUp(): void error_reporting(E_WARNING); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -55,8 +56,8 @@ public function invokeThrowsAssertionErrorIfGivenInputIsNotAString(): void ($this->subject)(null); } - #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsSlugForGivenInputDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsSlugForGivenInputDataProvider')] public function invokeReturnsSlugForGivenInput(?string $separator, string $expected): void { $actual = ($this->subject)('foo bar', $separator); diff --git a/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php b/tests/src/Twig/Func/DefaultAuthorEmailFunctionTest.php index 183bea04..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,7 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultAuthorEmailFunction(new Src\Resource\Local\Git($this->runner)); } - #[\PHPUnit\Framework\Attributes\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 a5ecb9ea..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,7 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultAuthorNameFunction(new Src\Resource\Local\Git($this->runner)); } - #[\PHPUnit\Framework\Attributes\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 d3eeb481..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,8 +42,8 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\DefaultProjectNameFunction(); } - #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsTrueIfGivenProjectNameIsTheDefaultDataProvider')] public function invokeReturnsTrueIfGivenProjectNameIsTheDefault(?string $projectName, bool $expected): void { $actual = ($this->subject)($projectName); diff --git a/tests/src/Twig/Func/NameVariantFunctionTest.php b/tests/src/Twig/Func/NameVariantFunctionTest.php index 758e6374..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,7 +44,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\NameVariantFunction(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenVariantIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -52,7 +53,7 @@ public function invokeThrowsExceptionIfGivenVariantIsNull(): void ($this->subject)(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructions(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -66,8 +67,8 @@ public function invokeThrowsExceptionIfGivenContextDoesNotContainBuildInstructio * @param value-of $variant * @param value-of|null $case */ - #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsNameVariantDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsNameVariantDataProvider')] public function invokeReturnsNameVariant(string $variant, ?string $case, ?string $expected): void { $instructions = new Src\Builder\BuildInstructions( diff --git a/tests/src/Twig/Func/PhpVersionFunctionTest.php b/tests/src/Twig/Func/PhpVersionFunctionTest.php index 708dd3c5..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,7 +43,7 @@ protected function setUp(): void $this->subject = self::$container->get(Src\Twig\Func\PhpVersionFunction::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenBranchIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -51,7 +52,7 @@ public function invokeThrowsExceptionIfGivenBranchIsNull(): void ($this->subject)(); } - #[\PHPUnit\Framework\Attributes\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 1bb75a42..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,7 +43,7 @@ protected function setUp(): void $this->subject = new Src\Twig\Func\ResolveIpFunction(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeThrowsExceptionIfGivenHostnameIsNull(): void { $this->expectException(Assert\InvalidArgumentException::class); @@ -52,7 +52,7 @@ public function invokeThrowsExceptionIfGivenHostnameIsNull(): void ($this->subject)(); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeReturnsNullIfUrlCannotBeResolved(): void { $actual = ($this->subject)('https://'); @@ -60,7 +60,7 @@ public function invokeReturnsNullIfUrlCannotBeResolved(): void self::assertNull($actual); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function invokeReturnsNullIfIpAddressCannotBeResolved(): void { $actual = ($this->subject)('foo.bar'); @@ -68,8 +68,8 @@ public function invokeReturnsNullIfIpAddressCannotBeResolved(): void self::assertNull($actual); } - #[\PHPUnit\Framework\Attributes\DataProvider('invokeReturnsResolvedIpAddressDataProvider')] - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] + #[Framework\Attributes\DataProvider('invokeReturnsResolvedIpAddressDataProvider')] public function invokeReturnsResolvedIpAddress(string $hostname): void { $actual = ($this->subject)($hostname); diff --git a/tests/src/Twig/RendererTest.php b/tests/src/Twig/RendererTest.php index 29a94c65..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,7 +55,7 @@ protected function setUp(): void $this->eventListener = self::$container->get(Tests\Fixtures\DummyTemplateRenderingEventListener::class); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function renderThrowsExceptionIfNoTemplateIsDefined(): void { $this->expectException(Src\Exception\TemplateRenderingException::class); @@ -64,7 +65,7 @@ public function renderThrowsExceptionIfNoTemplateIsDefined(): void $this->subject->render($this->instructions); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function renderThrowsExceptionIfTemplateIsMissing(): void { $this->expectException(Src\Exception\TemplateRenderingException::class); @@ -74,7 +75,7 @@ public function renderThrowsExceptionIfTemplateIsMissing(): void $this->subject->render($this->instructions, 'foo'); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function renderWithConfiguredFilesystemLoaderRendersTemplate(): void { self::assertFalse($this->eventListener->dispatched); @@ -85,7 +86,7 @@ public function renderWithConfiguredFilesystemLoaderRendersTemplate(): void self::assertTrue($this->eventListener->dispatched); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function renderWithConfiguredArrayLoaderRendersTemplate(): void { $subject = $this->subject->withDefaultTemplate('Hello {{ name }}!'); @@ -98,7 +99,7 @@ public function renderWithConfiguredArrayLoaderRendersTemplate(): void self::assertTrue($this->eventListener->dispatched); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function renderMergesBuildInstructionsAndAdditionalVariables(): void { $this->instructions->addTemplateVariable('foo', 'foo'); @@ -118,7 +119,7 @@ public function renderMergesBuildInstructionsAndAdditionalVariables(): void self::assertSame($expected, json_decode($actual, true, 512, JSON_THROW_ON_ERROR)); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function renderRespectsVariablesModifiedThroughDispatchedEvent(): void { $subject = $this->subject->withDefaultTemplate('Hello {{ name }}!'); @@ -135,7 +136,7 @@ public function renderRespectsVariablesModifiedThroughDispatchedEvent(): void self::assertTrue($this->eventListener->dispatched); } - #[\PHPUnit\Framework\Attributes\Test] + #[Framework\Attributes\Test] public function canRenderReturnsChecksWhetherGivenTemplateCanBeRendered(): void { self::assertTrue($this->subject->canRender('dummy.twig'));