From fddc25f6dc88b3e511aed67ceac6bcd159aece2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Poirier=20Th=C3=A9or=C3=AAt?= Date: Tue, 17 Oct 2023 09:05:18 -0400 Subject: [PATCH] [Internal] support of phpunit 10, drop support for phpunit 8 --- .github/workflows/build.yml | 2 +- .gitignore | 1 + composer.json | 2 +- composer.lock | 874 +++++++++--------- .../Command/CronDumpToFileCommandTest.php | 14 +- .../DoctrineConfigurationRegistryTest.php | 41 +- .../Tests/Configuration/Entity/ConfigTest.php | 5 +- .../Tests/Cron/CronManagerTest.php | 5 +- packages/application/Tests/Cron/JobTest.php | 5 +- .../UpdateDeployedVersionCommandTest.php | 14 +- .../Event/FetchRunningVersionEventTest.php | 5 +- .../FetchRunningVersionListenerTest.php | 5 +- .../Tests/Versioning/VersionManagerTest.php | 15 +- packages/application/composer.json | 2 +- .../CloudWatchLogsDownloadCommandTest.php | 24 +- .../NewestInstanceRoleListenerCheckTest.php | 19 +- .../Tests/Imds/ImdsClientV1Test.php | 10 +- .../Tests/Imds/ImdsClientV2Test.php | 43 +- packages/aws-tool-kit/composer.json | 2 +- .../Command/PurgeExecutionCommandTest.php | 73 +- .../console/Tests/Entity/ExecutionTest.php | 5 +- .../Tests/Event/CommandErrorEventTest.php | 5 +- .../EventListener/CommandFlowListenerTest.php | 34 +- .../Output/BufferedConsoleOutputTest.php | 5 +- packages/console/composer.json | 2 +- packages/core/Tests/DateTimeUtilsTest.php | 6 +- .../Tests/FilterExpression/EvaluatorTest.php | 2 +- .../CompositeExpressionEvaluatorTest.php | 10 +- .../ConstraintExpressionEvaluatorTest.php | 5 +- .../core/Tests/FilterExpression/QueryTest.php | 5 +- .../Reflection/ReflectionAccessorTest.php | 5 +- packages/core/composer.json | 2 +- packages/doctrine-extra/composer.json | 2 +- .../Tests/ClassPrivateStaticCallFixerTest.php | 2 +- .../fixer/Tests/ClassStaticCallFixerTest.php | 2 +- packages/fixer/composer.json | 2 +- .../Processor/RequestHeadersProcessorTest.php | 2 +- ...ommandExecutionOptionsCompilerPassTest.php | 5 +- ...ewestInstanceRoleCommandOptionPassTest.php | 5 +- .../Compiler/UserCheckerDecoratorPassTest.php | 5 +- .../DependencyInjection/ConfigurationTest.php | 2 +- .../DrawFrameworkExtraExtensionTest.php | 4 +- .../Integration/AwsToolKitIntegrationTest.php | 6 +- .../ConfigurationIntegrationTest.php | 6 +- .../Integration/ConsoleIntegrationTest.php | 6 +- .../Integration/CronIntegrationTest.php | 6 +- .../DoctrineExtraIntegrationTest.php | 6 +- .../Integration/FeatureIntegrationTest.php | 6 +- .../Integration/IntegrationTestCase.php | 7 +- .../Integration/LogIntegrationTest.php | 6 +- .../Integration/LoggerIntegrationTest.php | 6 +- .../Integration/MailerIntegrationTest.php | 6 +- .../Integration/MessengerIntegrationTest.php | 6 +- .../Integration/OpenApiIntegrationTest.php | 10 +- .../Integration/ProcessIntegrationTest.php | 6 +- .../Integration/SecurityIntegrationTest.php | 6 +- .../SystemMonitoringIntegrationTest.php | 6 +- .../Integration/TesterIntegrationTest.php | 6 +- .../Integration/ValidatorIntegrationTest.php | 6 +- .../Integration/VersioningIntegrationTest.php | 6 +- .../Integration/WorkflowIntegrationTest.php | 6 +- .../Tests/DrawFrameworkExtraBundleTest.php | 89 +- packages/framework-extra-bundle/composer.json | 2 +- packages/log/composer.json | 2 +- .../Command/SendTestEmailCommandTest.php | 14 +- .../Tests/Email/CallToActionEmailTest.php | 5 +- .../DefaultFromEmailWriterTest.php | 5 +- .../EmailCssInlinerListenerTest.php | 5 +- .../EmailSubjectFromHtmlTitleListenerTest.php | 5 +- .../EventListener/EmailWriterListenerTest.php | 18 +- .../Tests/Twig/TranslationExtensionTest.php | 21 +- packages/mailer/composer.json | 2 +- .../AutoStampEnvelopeListenerTest.php | 5 +- .../messenger/Tests/Broker/BrokerTest.php | 130 ++- .../StartMessengerBrokerCommandTest.php | 9 +- .../Broker/Event/BrokerRunningEventTest.php | 5 +- .../Broker/Event/BrokerStartedEventTest.php | 5 +- .../Event/NewConsumerProcessEventTest.php | 5 +- .../BrokerDefaultValuesListenerTest.php | 5 +- .../StopBrokerOnSigtermSignalListenerTest.php | 5 +- .../Entity/MessageHolderTraitTest.php | 5 +- .../BasicEnvelopeFactoryTest.php | 44 +- .../Event/EnvelopeCreatedEventTest.php | 10 +- .../DoctrineBusMessageListenerTest.php | 20 +- .../EnvelopeFactoryDelayStampListenerTest.php | 5 +- ...spatchAfterCurrentBusStampListenerTest.php | 5 +- .../Tests/Entity/DrawMessageTagTraitTest.php | 19 +- .../Tests/Entity/DrawMessageTraitTest.php | 19 +- .../StopOnNewVersionListenerTest.php | 5 +- .../MessageNotFoundExceptionTest.php | 5 +- .../PurgeExpiredMessageCommandTest.php | 22 +- .../Expirable/Stamp/ExpirationStampTest.php | 5 +- .../Action/ClickMessageActionTest.php | 32 +- .../Event/MessageLinkErrorEventTest.php | 5 +- ...pManuallyTriggeredEnvelopeListenerTest.php | 16 +- .../RedirectToRouteMessageTraitTest.php | 5 +- .../RedirectToRouteMessageHandlerTest.php | 5 +- .../Stamp/ManualTriggerStampTest.php | 5 +- .../Tests/Searchable/EnvelopeFinderTest.php | 10 +- .../Stamp/FindFromTransportStampTest.php | 5 +- .../Stamp/SearchableTagStampTest.php | 5 +- .../Event/BaseSerializerEventTest.php | 2 +- ...EventDispatcherSerializerDecoratorTest.php | 11 +- .../Transport/DrawTransportFactoryTest.php | 18 +- .../Tests/Transport/DrawTransportTest.php | 60 +- packages/messenger/composer.json | 2 +- .../Command/InstallSandboxCommandTest.php | 9 +- .../Event/PreDumpRootSchemaEventTest.php | 5 +- .../Event/PreSerializerResponseEventTest.php | 5 +- .../EventListener/BaseCleanerTestCase.php | 6 +- .../DefinitionAliasCleanerListenerTest.php | 2 +- ...finitionAliasSchemaCleanerListenerTest.php | 7 +- ...questQueryParameterFetcherListenerTest.php | 14 +- .../RequestValidationListenerTest.php | 21 +- .../ResponseApiExceptionListenerTest.php | 11 +- .../ResponseSerializerListenerTest.php | 20 +- .../SchemaAddDefaultHeadersListenerTest.php | 5 +- .../UnReferenceCleanerListenerTest.php | 2 +- .../ConstraintViolationListExceptionTest.php | 5 +- .../ExtractionImpossibleExceptionTest.php | 5 +- .../NotBlankConstraintExtractorTest.php | 12 +- .../JmsSerializer/PropertiesExtractorTest.php | 12 +- .../OpenApi/RootSchemaExtractorTest.php | 2 +- .../PhpDoc/OperationExtractorTest.php | 2 +- .../Extractor/TypeSchemaExtractorTest.php | 2 +- .../Tests/Mock/Controller/TestController.php | 8 +- .../Mock/Model/{Test.php => TestClass.php} | 2 +- .../Naming/AliasesClassNamingFilterTest.php | 5 +- packages/open-api/Tests/OpenApiTest.php | 12 +- .../DeserializeBodyParamConverterTest.php | 17 +- .../Tests/Serializer/SerializationTest.php | 5 +- ...RouteDefaultApiRouteVersionMatcherTest.php | 5 +- packages/open-api/composer.json | 2 +- packages/process/composer.json | 2 +- .../Tests/Sql/SqlAssertionBuilderTest.php | 6 +- packages/profiling/composer.json | 2 +- .../Core/Event/CheckPostAuthEventTest.php | 5 +- .../Core/Event/CheckPreAuthEventTest.php | 5 +- .../Core/User/EventDrivenUserCheckerTest.php | 15 +- .../Authenticator/JwtAuthenticatorTest.php | 22 +- .../MessageAuthenticatorTest.php | 22 +- .../Passport/Badge/JwtPayloadBadgeTest.php | 5 +- .../Badge/RoleRestrictedBadgeTest.php | 5 +- ...oleRestrictedAuthenticatorListenerTest.php | 15 +- .../security/Tests/Jwt/JwtEncoderTest.php | 5 +- packages/security/composer.json | 2 +- .../DependencyInjection/ConfigurationTest.php | 2 +- ...ataExtraExtensionAutoActionEnabledTest.php | 2 +- ...onataExtraExtensionAutoHelpEnabledTest.php | 2 +- ...ExtensionCanSecurityHandlerEnabledTest.php | 2 +- ...taExtraExtensionFixMenuDeptEnabledTest.php | 2 +- ...xtraExtensionSessionTimeoutEnabledTest.php | 2 +- .../DrawSonataExtraExtensionTest.php | 2 +- .../SessionTimeoutRequestListenerTest.php | 203 ++-- packages/sonata-extra-bundle/composer.json | 2 +- .../DependencyInjection/ConfigurationTest.php | 2 +- ...ationExtensionConfigurationEnabledTest.php | 8 +- ...IntegrationExtensionConsoleEnabledTest.php | 8 +- ...tegrationExtensionMessengerEnabledTest.php | 14 +- .../DrawSonataIntegrationExtensionTest.php | 9 +- ...xtensionUser2faEnabledEmailEnabledTest.php | 9 +- ...IntegrationExtensionUser2faEnabledTest.php | 8 +- ...ataIntegrationExtensionUserEnabledTest.php | 8 +- ...ntegrationExtensionUserLockEnabledTest.php | 8 +- ...ctorAuthenticationResendCodeActionTest.php | 15 +- .../sonata-integration-bundle/composer.json | 2 +- .../Compiler/MessengerPassTest.php | 5 +- .../DependencyInjection/ConfigurationTest.php | 7 +- .../DrawTesterExtensionTest.php | 2 +- ...rawTesterExtensionWithoutProfilingTest.php | 4 +- packages/tester-bundle/composer.json | 2 +- .../tester/Application/CommandTestTrait.php | 4 +- .../ConfigurationTestCase.php | 2 +- .../DependencyInjection/ExtensionTestCase.php | 15 +- packages/tester/Http/Client.php | 4 +- packages/tester/Http/ClientInterface.php | 4 +- packages/tester/Http/ClientObserver.php | 2 +- .../tester/Http/ClientObserverInterface.php | 27 + packages/tester/MockTrait.php | 46 + .../Extension/CarbonResetExtension.php | 34 + .../TestListener/CarbonResetTestListener.php | 27 - .../Command/TestsCoverageCheckCommandTest.php | 9 +- packages/tester/Tests/Http/ClientTest.php | 5 +- .../Tests/Http/Cookie/CookieJarTest.php | 4 +- .../tester/Tests/Http/TestResponseTest.php | 6 +- packages/tester/composer.json | 2 +- .../Entity/SecurityUserInterface.php | 7 +- .../user-bundle/Entity/SecurityUserTrait.php | 2 +- .../Entity/LockableUserTraitTest.php | 5 +- .../AccountLocker/Entity/UserLockTest.php | 12 +- .../DependencyInjection/ConfigurationTest.php | 2 +- .../DrawUserExtensionTest.php | 2 +- ...rExtensionWithAccountLockerEnabledTest.php | 2 +- ...erExtensionWithEmailWritersEnabledTest.php | 2 +- .../DrawUserExtensionWithEnforce2faTest.php | 2 +- ...onWithEnforce2faWithEnforcingRolesTest.php | 4 +- ...UserExtensionWithOnboardingEnabledTest.php | 2 +- ...nWithPasswordChangeEnforcerEnabledTest.php | 2 +- ...sionWithoutEncryptPasswordListenerTest.php | 4 +- .../TwoFactorAuthenticationListenerTest.php | 57 +- .../Message/TemporaryUnlockedMessageTest.php | 5 +- packages/user-bundle/composer.json | 2 +- .../Tests/Constraints/PhpCallableTest.php | 5 +- .../Constraints/PhpCallableValidatorTest.php | 12 +- .../Constraints/RemoteFileExistsTest.php | 5 +- .../RemoteFileExistsValidatorTest.php | 12 +- .../Tests/Constraints/StrtotimeTest.php | 5 +- packages/validator/composer.json | 2 +- packages/workflow/composer.json | 2 +- phpstan-baseline.neon | 8 +- phpunit.xml.dist | 37 +- symfony.lock | 3 - tests/Command/NullCommandTest.php | 4 +- tests/Controller/PingActionTest.php | 2 +- .../fixtures/api-doc-scope-all.json | 6 +- .../ValueIsNotUsedValidatorTest.php | 2 +- vendor-bin/monorepo/composer.lock | 75 +- vendor-bin/simplify/composer.lock | 2 +- 218 files changed, 1546 insertions(+), 1662 deletions(-) rename packages/open-api/Tests/Mock/Model/{Test.php => TestClass.php} (98%) create mode 100644 packages/tester/Http/ClientObserverInterface.php create mode 100644 packages/tester/PHPUnit/Extension/CarbonResetExtension.php delete mode 100644 packages/tester/PHPUnit/TestListener/CarbonResetTestListener.php diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67983b4b8..f37322c19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,5 +70,5 @@ jobs: php bin/console messenger:setup-transports --no-interaction php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration -q php bin/console doctrine:fixtures:load --no-interaction - vendor/bin/phpunit --testdox -v --no-coverage + vendor/bin/phpunit --testdox --no-coverage echo "::endgroup::" diff --git a/.gitignore b/.gitignore index bda0da5d9..a4f4ba47f 100755 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ composer-normalize ###> phpunit/phpunit ### /phpunit.xml .phpunit.result.cache +.phpunit.cache ###< phpunit/phpunit ### ###> friendsofphp/php-cs-fixer ### diff --git a/composer.json b/composer.json index 8215bd7f6..39a184fc7 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "jms/serializer": "^3.11", "jms/serializer-bundle": "^4.2", "phpdocumentor/reflection-docblock": "^5.2", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "psr/http-message": "^1.0", "psr/log": "@stable", "ramsey/uuid": "^4.2", diff --git a/composer.lock b/composer.lock index 6f5c76d47..c6adbdab1 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": "dc54cdf40a32da3701a57e24ff125877", + "content-hash": "e183452fdb6e676d5e9cb2266ae6bb8c", "packages": [ { "name": "aws/aws-crt-php", @@ -62,16 +62,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.281.13", + "version": "3.283.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "5547757d891495713aa7d5770bf04124d48a6ab5" + "reference": "a0877cbbf6062cef363145b1bd0cb1d1f6654e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5547757d891495713aa7d5770bf04124d48a6ab5", - "reference": "5547757d891495713aa7d5770bf04124d48a6ab5", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/a0877cbbf6062cef363145b1bd0cb1d1f6654e04", + "reference": "a0877cbbf6062cef363145b1bd0cb1d1f6654e04", "shasum": "" }, "require": { @@ -151,9 +151,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.281.13" + "source": "https://github.com/aws/aws-sdk-php/tree/3.283.4" }, - "time": "2023-09-25T18:07:38+00:00" + "time": "2023-10-16T18:08:25+00:00" }, { "name": "brick/math", @@ -212,16 +212,16 @@ }, { "name": "composer/pcre", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", "shasum": "" }, "require": { @@ -263,7 +263,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" + "source": "https://github.com/composer/pcre/tree/3.1.1" }, "funding": [ { @@ -279,7 +279,7 @@ "type": "tidelift" } ], - "time": "2022-11-17T09:50:14+00:00" + "time": "2023-10-11T07:11:09+00:00" }, { "name": "composer/semver", @@ -599,16 +599,16 @@ }, { "name": "doctrine/collections", - "version": "2.1.3", + "version": "2.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "3023e150f90a38843856147b58190aa8b46cc155" + "reference": "72328a11443a0de79967104ad36ba7b30bded134" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/3023e150f90a38843856147b58190aa8b46cc155", - "reference": "3023e150f90a38843856147b58190aa8b46cc155", + "url": "https://api.github.com/repos/doctrine/collections/zipball/72328a11443a0de79967104ad36ba7b30bded134", + "reference": "72328a11443a0de79967104ad36ba7b30bded134", "shasum": "" }, "require": { @@ -616,7 +616,7 @@ "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^10.0", + "doctrine/coding-standard": "^12", "ext-json": "*", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.0", @@ -665,7 +665,7 @@ ], "support": { "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/2.1.3" + "source": "https://github.com/doctrine/collections/tree/2.1.4" }, "funding": [ { @@ -681,7 +681,7 @@ "type": "tidelift" } ], - "time": "2023-07-06T15:15:36+00:00" + "time": "2023-10-03T09:22:33+00:00" }, { "name": "doctrine/common", @@ -858,16 +858,16 @@ }, { "name": "doctrine/dbal", - "version": "3.6.7", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "8e0e268052b4a8974cb00215bb2892787021614f" + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/8e0e268052b4a8974cb00215bb2892787021614f", - "reference": "8e0e268052b4a8974cb00215bb2892787021614f", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/5b7bd66c9ff58c04c5474ab85edce442f8081cb2", + "reference": "5b7bd66c9ff58c04c5474ab85edce442f8081cb2", "shasum": "" }, "require": { @@ -883,9 +883,9 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.10.34", + "phpstan/phpstan": "1.10.35", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "9.6.12", + "phpunit/phpunit": "9.6.13", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.7.2", @@ -951,7 +951,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.6.7" + "source": "https://github.com/doctrine/dbal/tree/3.7.1" }, "funding": [ { @@ -967,20 +967,20 @@ "type": "tidelift" } ], - "time": "2023-09-19T20:15:41+00:00" + "time": "2023-10-06T05:06:20+00:00" }, { "name": "doctrine/deprecations", - "version": "v1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", "shasum": "" }, "require": { @@ -1012,9 +1012,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" + "source": "https://github.com/doctrine/deprecations/tree/1.1.2" }, - "time": "2023-06-03T09:27:29+00:00" + "time": "2023-09-27T20:04:15+00:00" }, { "name": "doctrine/doctrine-bundle", @@ -1716,16 +1716,16 @@ }, { "name": "egulias/email-validator", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff" + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/3a85486b709bc384dae8eb78fb2eec649bdb64ff", - "reference": "3a85486b709bc384dae8eb78fb2eec649bdb64ff", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e", + "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e", "shasum": "" }, "require": { @@ -1734,8 +1734,8 @@ "symfony/polyfill-intl-idn": "^1.26" }, "require-dev": { - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^4.30" + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" }, "suggest": { "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" @@ -1771,7 +1771,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/4.0.1" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.2" }, "funding": [ { @@ -1779,20 +1779,20 @@ "type": "github" } ], - "time": "2023-01-14T14:17:03+00:00" + "time": "2023-10-06T06:47:41+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.28.0", + "version": "v3.35.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "113e09fea3d2306319ffaa2423fe3de768b28cff" + "reference": "ec1ccc264994b6764882669973ca435cf05bab08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/113e09fea3d2306319ffaa2423fe3de768b28cff", - "reference": "113e09fea3d2306319ffaa2423fe3de768b28cff", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ec1ccc264994b6764882669973ca435cf05bab08", + "reference": "ec1ccc264994b6764882669973ca435cf05bab08", "shasum": "" }, "require": { @@ -1825,8 +1825,6 @@ "phpspec/prophecy": "^1.16", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.6", - "phpunitgoodpractices/traits": "^1.9.2", "symfony/phpunit-bridge": "^6.2.3", "symfony/yaml": "^5.4 || ^6.0" }, @@ -1866,7 +1864,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.28.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.35.1" }, "funding": [ { @@ -1874,7 +1872,7 @@ "type": "github" } ], - "time": "2023-09-22T20:43:40+00:00" + "time": "2023-10-12T13:47:26+00:00" }, { "name": "guzzlehttp/guzzle", @@ -3154,16 +3152,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.24.1", + "version": "1.24.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01" + "reference": "bcad8d995980440892759db0c32acae7c8e79442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", - "reference": "9f854d275c2dbf84915a5c0ec9a2d17d2cd86b01", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", + "reference": "bcad8d995980440892759db0c32acae7c8e79442", "shasum": "" }, "require": { @@ -3195,22 +3193,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" }, - "time": "2023-09-18T12:18:02+00:00" + "time": "2023-09-26T12:28:12+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.29", + "version": "10.1.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + "reference": "355324ca4980b8916c18b9db29f3ef484078f26e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/355324ca4980b8916c18b9db29f3ef484078f26e", + "reference": "355324ca4980b8916c18b9db29f3ef484078f26e", "shasum": "" }, "require": { @@ -3218,18 +3216,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.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -3238,7 +3236,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -3267,7 +3265,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.7" }, "funding": [ { @@ -3275,32 +3273,32 @@ "type": "github" } ], - "time": "2023-09-19T04:57:46+00:00" + "time": "2023-10-04T15:34:17+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "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/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "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": { @@ -3327,7 +3325,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -3335,28 +3334,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-08-31T06:24:48+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": "*" @@ -3364,7 +3363,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3390,7 +3389,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": [ { @@ -3398,32 +3397,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.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "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/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "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": { @@ -3449,7 +3448,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -3457,32 +3457,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-08-31T14:07:24+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": { @@ -3508,7 +3508,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": [ { @@ -3516,24 +3516,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.13", + "version": "10.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "reference": "62bd7af13d282deeb95650077d28ba3600ca321c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/62bd7af13d282deeb95650077d28ba3600ca321c", + "reference": "62bd7af13d282deeb95650077d28ba3600ca321c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -3543,27 +3542,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.28", - "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.1.5", + "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.1", + "sebastian/global-state": "^6.0.1", + "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" @@ -3571,7 +3569,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.4-dev" } }, "autoload": { @@ -3603,7 +3601,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.1" }, "funding": [ { @@ -3619,7 +3617,7 @@ "type": "tidelift" } ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2023-10-08T05:01:11+00:00" }, { "name": "psr/cache", @@ -4253,28 +4251,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": { @@ -4297,7 +4295,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": [ { @@ -4305,32 +4303,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": { @@ -4353,7 +4351,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": [ { @@ -4361,32 +4359,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": { @@ -4408,7 +4406,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": [ { @@ -4416,34 +4414,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.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "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.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -4482,7 +4482,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -4490,33 +4491,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "68cfb347a44871f01e33ab0ef8215966432f6957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68cfb347a44871f01e33ab0ef8215966432f6957", + "reference": "68cfb347a44871f01e33ab0ef8215966432f6957", "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.1-dev" } }, "autoload": { @@ -4539,7 +4540,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.1.0" }, "funding": [ { @@ -4547,33 +4549,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-09-28T11:50:59+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "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": { @@ -4605,7 +4607,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -4613,27 +4616,27 @@ "type": "github" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -4641,7 +4644,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -4660,7 +4663,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", @@ -4668,7 +4671,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -4676,34 +4680,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", "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.1-dev" } }, "autoload": { @@ -4745,7 +4749,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" }, "funding": [ { @@ -4753,38 +4758,35 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2023-09-24T13:22:09+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.6", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "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": { @@ -4809,7 +4811,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -4817,33 +4820,33 @@ "type": "github" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" }, "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/649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", "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": { @@ -4866,7 +4869,8 @@ "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" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" }, "funding": [ { @@ -4874,34 +4878,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-08-31T09:25:50+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": { @@ -4923,7 +4927,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": [ { @@ -4931,32 +4935,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": { @@ -4978,7 +4982,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": [ { @@ -4986,32 +4990,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": { @@ -5041,7 +5045,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": [ { @@ -5049,87 +5053,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": { @@ -5152,7 +5101,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": [ { @@ -5160,29 +5109,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": { @@ -5205,7 +5154,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": [ { @@ -5213,7 +5162,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "sensiolabs/ansi-to-html", @@ -6295,16 +6244,16 @@ }, { "name": "symfony/cache", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "62b7ae3bccc5b474a30fadc7ef6bbc362007d3f9" + "reference": "e29c5a97bc2d81269973c3e1d7ceb9d48b4d5151" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/62b7ae3bccc5b474a30fadc7ef6bbc362007d3f9", - "reference": "62b7ae3bccc5b474a30fadc7ef6bbc362007d3f9", + "url": "https://api.github.com/repos/symfony/cache/zipball/e29c5a97bc2d81269973c3e1d7ceb9d48b4d5151", + "reference": "e29c5a97bc2d81269973c3e1d7ceb9d48b4d5151", "shasum": "" }, "require": { @@ -6372,7 +6321,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.28" + "source": "https://github.com/symfony/cache/tree/v5.4.29" }, "funding": [ { @@ -6388,7 +6337,7 @@ "type": "tidelift" } ], - "time": "2023-08-05T08:32:42+00:00" + "time": "2023-09-19T13:25:51+00:00" }, { "name": "symfony/cache-contracts", @@ -6715,16 +6664,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "addc22fed594f9ce04e73ef6a9d3e2416f77192d" + "reference": "338638ed8c9d5c7fcb136a73f5c7043465ae2f05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/addc22fed594f9ce04e73ef6a9d3e2416f77192d", - "reference": "addc22fed594f9ce04e73ef6a9d3e2416f77192d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/338638ed8c9d5c7fcb136a73f5c7043465ae2f05", + "reference": "338638ed8c9d5c7fcb136a73f5c7043465ae2f05", "shasum": "" }, "require": { @@ -6784,7 +6733,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/v5.4.28" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.29" }, "funding": [ { @@ -6800,7 +6749,7 @@ "type": "tidelift" } ], - "time": "2023-08-14T10:47:38+00:00" + "time": "2023-09-20T06:23:43+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7135,16 +7084,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.4.26", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "b26719213a39c9ba57520cbc5e52bfcc5e8d92f9" + "reference": "328c6fcfd2f90b64c16efaf0ea67a311d672f078" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/b26719213a39c9ba57520cbc5e52bfcc5e8d92f9", - "reference": "b26719213a39c9ba57520cbc5e52bfcc5e8d92f9", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/328c6fcfd2f90b64c16efaf0ea67a311d672f078", + "reference": "328c6fcfd2f90b64c16efaf0ea67a311d672f078", "shasum": "" }, "require": { @@ -7186,7 +7135,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.26" + "source": "https://github.com/symfony/error-handler/tree/v5.4.29" }, "funding": [ { @@ -7202,7 +7151,7 @@ "type": "tidelift" } ], - "time": "2023-07-16T16:48:57+00:00" + "time": "2023-09-06T21:54:06+00:00" }, { "name": "symfony/event-dispatcher", @@ -7557,16 +7506,16 @@ }, { "name": "symfony/form", - "version": "v5.4.26", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "ca99a6874695aa266044a28ff945176cf480d9bf" + "reference": "57baf5a73a68c24dfe12d0d93bec119ec71acb48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/ca99a6874695aa266044a28ff945176cf480d9bf", - "reference": "ca99a6874695aa266044a28ff945176cf480d9bf", + "url": "https://api.github.com/repos/symfony/form/zipball/57baf5a73a68c24dfe12d0d93bec119ec71acb48", + "reference": "57baf5a73a68c24dfe12d0d93bec119ec71acb48", "shasum": "" }, "require": { @@ -7639,7 +7588,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v5.4.26" + "source": "https://github.com/symfony/form/tree/v5.4.29" }, "funding": [ { @@ -7655,20 +7604,20 @@ "type": "tidelift" } ], - "time": "2023-07-26T07:54:04+00:00" + "time": "2023-09-10T17:22:50+00:00" }, { "name": "symfony/framework-bundle", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "b84ebb25405c7334976b5791bfbbe0e50f4e472c" + "reference": "63e4ad1386fd4f31a005d751cd4dc016f9f2346e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/b84ebb25405c7334976b5791bfbbe0e50f4e472c", - "reference": "b84ebb25405c7334976b5791bfbbe0e50f4e472c", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/63e4ad1386fd4f31a005d751cd4dc016f9f2346e", + "reference": "63e4ad1386fd4f31a005d751cd4dc016f9f2346e", "shasum": "" }, "require": { @@ -7789,7 +7738,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v5.4.28" + "source": "https://github.com/symfony/framework-bundle/tree/v5.4.29" }, "funding": [ { @@ -7805,7 +7754,7 @@ "type": "tidelift" } ], - "time": "2023-08-08T11:21:07+00:00" + "time": "2023-09-27T13:49:58+00:00" }, { "name": "symfony/http-foundation", @@ -7885,16 +7834,16 @@ }, { "name": "symfony/http-kernel", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "127a2322ca1828157901092518b8ea8e4e1109d4" + "reference": "f53265fc6bd2a7f3a4ed4e443b76e750348ac3f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/127a2322ca1828157901092518b8ea8e4e1109d4", - "reference": "127a2322ca1828157901092518b8ea8e4e1109d4", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f53265fc6bd2a7f3a4ed4e443b76e750348ac3f7", + "reference": "f53265fc6bd2a7f3a4ed4e443b76e750348ac3f7", "shasum": "" }, "require": { @@ -7977,7 +7926,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.28" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.29" }, "funding": [ { @@ -7993,7 +7942,7 @@ "type": "tidelift" } ], - "time": "2023-08-26T13:47:51+00:00" + "time": "2023-09-30T06:31:17+00:00" }, { "name": "symfony/mailer", @@ -8073,16 +8022,16 @@ }, { "name": "symfony/messenger", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/messenger.git", - "reference": "39b0c94ef74c3558caeb87fc480bcef6da65be82" + "reference": "ce5165859adc36595578d684e77fc721fa53e387" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/messenger/zipball/39b0c94ef74c3558caeb87fc480bcef6da65be82", - "reference": "39b0c94ef74c3558caeb87fc480bcef6da65be82", + "url": "https://api.github.com/repos/symfony/messenger/zipball/ce5165859adc36595578d684e77fc721fa53e387", + "reference": "ce5165859adc36595578d684e77fc721fa53e387", "shasum": "" }, "require": { @@ -8143,7 +8092,7 @@ "description": "Helps applications send and receive messages to/from other applications or via message queues", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/messenger/tree/v5.4.28" + "source": "https://github.com/symfony/messenger/tree/v5.4.29" }, "funding": [ { @@ -8159,7 +8108,7 @@ "type": "tidelift" } ], - "time": "2023-08-12T16:35:23+00:00" + "time": "2023-09-20T14:19:32+00:00" }, { "name": "symfony/mime", @@ -8313,16 +8262,16 @@ }, { "name": "symfony/password-hasher", - "version": "v5.4.27", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/password-hasher.git", - "reference": "6dd2daf41b44384752f6b59e8ad3e56ffb81e35c" + "reference": "57cd0369af1a92b87c1e960251ebdf9457225bfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/password-hasher/zipball/6dd2daf41b44384752f6b59e8ad3e56ffb81e35c", - "reference": "6dd2daf41b44384752f6b59e8ad3e56ffb81e35c", + "url": "https://api.github.com/repos/symfony/password-hasher/zipball/57cd0369af1a92b87c1e960251ebdf9457225bfd", + "reference": "57cd0369af1a92b87c1e960251ebdf9457225bfd", "shasum": "" }, "require": { @@ -8367,7 +8316,7 @@ "password" ], "support": { - "source": "https://github.com/symfony/password-hasher/tree/v5.4.27" + "source": "https://github.com/symfony/password-hasher/tree/v5.4.29" }, "funding": [ { @@ -8383,7 +8332,7 @@ "type": "tidelift" } ], - "time": "2023-07-28T14:44:35+00:00" + "time": "2023-09-19T07:33:45+00:00" }, { "name": "symfony/polyfill-ctype", @@ -9444,16 +9393,16 @@ }, { "name": "symfony/security-bundle", - "version": "v5.4.26", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "38d674b6150ebd638f7c517b19790ac631f8dc35" + "reference": "8f432fae02bd908c1decea70a359d85a9be37f2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/38d674b6150ebd638f7c517b19790ac631f8dc35", - "reference": "38d674b6150ebd638f7c517b19790ac631f8dc35", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/8f432fae02bd908c1decea70a359d85a9be37f2c", + "reference": "8f432fae02bd908c1decea70a359d85a9be37f2c", "shasum": "" }, "require": { @@ -9526,7 +9475,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v5.4.26" + "source": "https://github.com/symfony/security-bundle/tree/v5.4.29" }, "funding": [ { @@ -9542,20 +9491,20 @@ "type": "tidelift" } ], - "time": "2023-07-05T15:49:26+00:00" + "time": "2023-09-19T07:33:45+00:00" }, { "name": "symfony/security-core", - "version": "v5.4.22", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "a801d525c7545332e2ddf7f52c163959354b1650" + "reference": "f8421bb428f48655d2b327d4bf58870983eef84a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/a801d525c7545332e2ddf7f52c163959354b1650", - "reference": "a801d525c7545332e2ddf7f52c163959354b1650", + "url": "https://api.github.com/repos/symfony/security-core/zipball/f8421bb428f48655d2b327d4bf58870983eef84a", + "reference": "f8421bb428f48655d2b327d4bf58870983eef84a", "shasum": "" }, "require": { @@ -9619,7 +9568,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v5.4.22" + "source": "https://github.com/symfony/security-core/tree/v5.4.29" }, "funding": [ { @@ -9635,7 +9584,7 @@ "type": "tidelift" } ], - "time": "2023-03-10T10:02:45+00:00" + "time": "2023-09-10T17:22:50+00:00" }, { "name": "symfony/security-csrf", @@ -9865,16 +9814,16 @@ }, { "name": "symfony/serializer", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "701e2b8d48a3a627ffe128b38fbe6c4cf3ddcb3c" + "reference": "b893175000155839170d589f3a3593f2ce601829" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/701e2b8d48a3a627ffe128b38fbe6c4cf3ddcb3c", - "reference": "701e2b8d48a3a627ffe128b38fbe6c4cf3ddcb3c", + "url": "https://api.github.com/repos/symfony/serializer/zipball/b893175000155839170d589f3a3593f2ce601829", + "reference": "b893175000155839170d589f3a3593f2ce601829", "shasum": "" }, "require": { @@ -9948,7 +9897,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v5.4.28" + "source": "https://github.com/symfony/serializer/tree/v5.4.29" }, "funding": [ { @@ -9964,7 +9913,7 @@ "type": "tidelift" } ], - "time": "2023-08-24T14:14:18+00:00" + "time": "2023-09-20T07:40:46+00:00" }, { "name": "symfony/service-contracts", @@ -10113,16 +10062,16 @@ }, { "name": "symfony/string", - "version": "v5.4.26", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1181fe9270e373537475e826873b5867b863883c" + "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", - "reference": "1181fe9270e373537475e826873b5867b863883c", + "url": "https://api.github.com/repos/symfony/string/zipball/e41bdc93def20eaf3bfc1537c4e0a2b0680a152d", + "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d", "shasum": "" }, "require": { @@ -10179,7 +10128,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.26" + "source": "https://github.com/symfony/string/tree/v5.4.29" }, "funding": [ { @@ -10195,7 +10144,7 @@ "type": "tidelift" } ], - "time": "2023-06-28T12:46:07+00:00" + "time": "2023-09-13T11:47:41+00:00" }, { "name": "symfony/translation", @@ -10374,16 +10323,16 @@ }, { "name": "symfony/twig-bridge", - "version": "v5.4.26", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "832461a5f556df7933fd82e75b097d76182c640b" + "reference": "8e94856da373b63e7ba69e51a6c4f834d991cd58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/832461a5f556df7933fd82e75b097d76182c640b", - "reference": "832461a5f556df7933fd82e75b097d76182c640b", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/8e94856da373b63e7ba69e51a6c4f834d991cd58", + "reference": "8e94856da373b63e7ba69e51a6c4f834d991cd58", "shasum": "" }, "require": { @@ -10475,7 +10424,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v5.4.26" + "source": "https://github.com/symfony/twig-bridge/tree/v5.4.29" }, "funding": [ { @@ -10491,7 +10440,7 @@ "type": "tidelift" } ], - "time": "2023-07-20T16:28:53+00:00" + "time": "2023-09-06T21:54:06+00:00" }, { "name": "symfony/twig-bundle", @@ -10585,16 +10534,16 @@ }, { "name": "symfony/validator", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "0acdcb86a8fc5ffd71c3b060184d2ed20a76a2c9" + "reference": "287ef8c80d1c23d5d1db8c3e26a8ad56680d535b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/0acdcb86a8fc5ffd71c3b060184d2ed20a76a2c9", - "reference": "0acdcb86a8fc5ffd71c3b060184d2ed20a76a2c9", + "url": "https://api.github.com/repos/symfony/validator/zipball/287ef8c80d1c23d5d1db8c3e26a8ad56680d535b", + "reference": "287ef8c80d1c23d5d1db8c3e26a8ad56680d535b", "shasum": "" }, "require": { @@ -10677,7 +10626,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v5.4.28" + "source": "https://github.com/symfony/validator/tree/v5.4.29" }, "funding": [ { @@ -10693,20 +10642,20 @@ "type": "tidelift" } ], - "time": "2023-08-14T13:04:17+00:00" + "time": "2023-09-10T17:22:50+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "684b36ff415e1381d4a943c3ca2502cd2debad73" + "reference": "6172e4ae3534d25ee9e07eb487c20be7760fcc65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/684b36ff415e1381d4a943c3ca2502cd2debad73", - "reference": "684b36ff415e1381d4a943c3ca2502cd2debad73", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6172e4ae3534d25ee9e07eb487c20be7760fcc65", + "reference": "6172e4ae3534d25ee9e07eb487c20be7760fcc65", "shasum": "" }, "require": { @@ -10766,7 +10715,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.28" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.29" }, "funding": [ { @@ -10782,7 +10731,7 @@ "type": "tidelift" } ], - "time": "2023-08-24T13:38:36+00:00" + "time": "2023-09-12T10:09:58+00:00" }, { "name": "symfony/var-exporter", @@ -12022,16 +11971,16 @@ }, { "name": "firebase/php-jwt", - "version": "v6.8.1", + "version": "v6.9.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26" + "reference": "f03270e63eaccf3019ef0f32849c497385774e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5dbc8959427416b8ee09a100d7a8588c00fb2e26", - "reference": "5dbc8959427416b8ee09a100d7a8588c00fb2e26", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/f03270e63eaccf3019ef0f32849c497385774e11", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11", "shasum": "" }, "require": { @@ -12079,9 +12028,9 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v6.8.1" + "source": "https://github.com/firebase/php-jwt/tree/v6.9.0" }, - "time": "2023-07-14T18:33:00+00:00" + "time": "2023-10-05T00:24:42+00:00" }, { "name": "friendsofphp/proxy-manager-lts", @@ -12858,16 +12807,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.35", + "version": "1.10.38", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e730e5facb75ffe09dfb229795e8c01a459f26c3" + "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e730e5facb75ffe09dfb229795e8c01a459f26c3", - "reference": "e730e5facb75ffe09dfb229795e8c01a459f26c3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5302bb402c57f00fb3c2c015bac86e0827e4b691", + "reference": "5302bb402c57f00fb3c2c015bac86e0827e4b691", "shasum": "" }, "require": { @@ -12916,20 +12865,20 @@ "type": "tidelift" } ], - "time": "2023-09-19T15:27:56+00:00" + "time": "2023-10-06T14:19:14+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.14", + "version": "1.3.15", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "614acc10c522e319639bf38b0698a4a566665f04" + "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/614acc10c522e319639bf38b0698a4a566665f04", - "reference": "614acc10c522e319639bf38b0698a4a566665f04", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", + "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", "shasum": "" }, "require": { @@ -12966,28 +12915,28 @@ "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.14" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.15" }, - "time": "2023-08-25T09:46:39+00:00" + "time": "2023-10-09T18:58:39+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "1.3.2", + "version": "1.3.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "7332b90dfc291ac5b4b83fbca2081936faa1e3f9" + "reference": "383855999db6a7d65d0bf580ce2762e17188c2a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/7332b90dfc291ac5b4b83fbca2081936faa1e3f9", - "reference": "7332b90dfc291ac5b4b83fbca2081936faa1e3f9", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/383855999db6a7d65d0bf580ce2762e17188c2a5", + "reference": "383855999db6a7d65d0bf580ce2762e17188c2a5", "shasum": "" }, "require": { "ext-simplexml": "*", "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.18" + "phpstan/phpstan": "^1.10.36" }, "conflict": { "symfony/framework-bundle": "<3.0" @@ -12995,8 +12944,8 @@ "require-dev": { "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.3.11", + "phpstan/phpstan-strict-rules": "^1.5.1", "phpunit/phpunit": "^8.5.29 || ^9.5", "psr/container": "1.0 || 1.1.1", "symfony/config": "^5.4 || ^6.1", @@ -13007,7 +12956,8 @@ "symfony/http-foundation": "^5.4 || ^6.1", "symfony/messenger": "^5.4", "symfony/polyfill-php80": "^1.24", - "symfony/serializer": "^5.4" + "symfony/serializer": "^5.4", + "symfony/service-contracts": "^2.2.0" }, "type": "phpstan-extension", "extra": { @@ -13037,9 +12987,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.3.2" + "source": "https://github.com/phpstan/phpstan-symfony/tree/1.3.4" }, - "time": "2023-05-16T12:46:15+00:00" + "time": "2023-09-29T14:10:11+00:00" }, { "name": "sabberworm/php-css-parser", @@ -13679,16 +13629,16 @@ }, { "name": "symfony/http-client", - "version": "v5.4.26", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "19d48ef7f38e5057ed1789a503cd3eccef039bce" + "reference": "04784c66cbee613a827363ee1e65db65392893c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/19d48ef7f38e5057ed1789a503cd3eccef039bce", - "reference": "19d48ef7f38e5057ed1789a503cd3eccef039bce", + "url": "https://api.github.com/repos/symfony/http-client/zipball/04784c66cbee613a827363ee1e65db65392893c1", + "reference": "04784c66cbee613a827363ee1e65db65392893c1", "shasum": "" }, "require": { @@ -13750,7 +13700,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v5.4.26" + "source": "https://github.com/symfony/http-client/tree/v5.4.29" }, "funding": [ { @@ -13766,7 +13716,7 @@ "type": "tidelift" } ], - "time": "2023-07-03T12:14:50+00:00" + "time": "2023-09-14T20:49:15+00:00" }, { "name": "symfony/http-client-contracts", @@ -14333,5 +14283,5 @@ "ext-pcntl": "*", "ext-zip": "*" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/packages/application/Tests/Command/CronDumpToFileCommandTest.php b/packages/application/Tests/Command/CronDumpToFileCommandTest.php index 784fc7ae9..15477181f 100644 --- a/packages/application/Tests/Command/CronDumpToFileCommandTest.php +++ b/packages/application/Tests/Command/CronDumpToFileCommandTest.php @@ -6,23 +6,19 @@ use Draw\Component\Application\Cron\CronManager; use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -/** - * @covers \Draw\Component\Application\Cron\Command\CronDumpToFileCommand - */ +#[CoversClass(CronDumpToFileCommand::class)] class CronDumpToFileCommandTest extends TestCase { use CommandTestTrait; - /** - * @var CronManager&MockObject - */ - private CronManager $cronManager; + private CronManager&MockObject $cronManager; public function createCommand(): Command { @@ -36,12 +32,12 @@ public function getCommandName(): string return 'draw:cron:dump-to-file'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { yield ['filePath', InputArgument::REQUIRED]; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { yield ['override', null, InputOption::VALUE_NONE]; } diff --git a/packages/application/Tests/Configuration/DoctrineConfigurationRegistryTest.php b/packages/application/Tests/Configuration/DoctrineConfigurationRegistryTest.php index b06cccb20..e58256c37 100644 --- a/packages/application/Tests/Configuration/DoctrineConfigurationRegistryTest.php +++ b/packages/application/Tests/Configuration/DoctrineConfigurationRegistryTest.php @@ -11,11 +11,12 @@ use Draw\Component\Tester\DoctrineOrmTrait; use Draw\Contracts\Application\ConfigurationRegistryInterface; use Draw\Contracts\Application\Exception\ConfigurationIsNotAccessibleException; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Application\Configuration\DoctrineConfigurationRegistry - */ +#[CoversClass(DoctrineConfigurationRegistry::class)] class DoctrineConfigurationRegistryTest extends TestCase { use DoctrineOrmTrait; @@ -119,9 +120,7 @@ public function testHasNotSet(): void static::assertFalse($this->object->has('value')); } - /** - * @depends testHasNotSet - */ + #[Depends('testHasNotSet')] public function testGetDefault(): void { static::assertNull($this->object->get('value')); @@ -136,25 +135,19 @@ public function testSet(): void $this->addToAssertionCount(1); } - /** - * @depends testSet - */ + #[Depends('testSet')] public function testHasSet(): void { static::assertTrue($this->object->has('value')); } - /** - * @depends testHasSet - */ + #[Depends('testHasSet')] public function testGetSet(): void { static::assertSame('the-value', $this->object->get('value')); } - /** - * @depends testHasSet - */ + #[Depends('testHasSet')] public function testDelete(): void { $this->object->delete('value'); @@ -162,17 +155,13 @@ public function testDelete(): void $this->addToAssertionCount(1); } - /** - * @depends testDelete - */ + #[Depends('testDelete')] public function testHasAfterDelete(): void { static::assertFalse($this->object->has('value')); } - /** - * @depends testGetSet - */ + #[Depends('testGetSet')] public function testGetValueChangeFromOtherScope(): void { $this->object->set('value', 'the-value'); @@ -191,9 +180,7 @@ public function testGetValueChangeFromOtherScope(): void static::assertSame('new-value', $this->object->get('value')); } - /** - * @depends testGetSet - */ + #[Depends('testGetSet')] public function testGetValueInvalidState(): void { $this->object->set('value', 'the-value'); @@ -214,7 +201,7 @@ public function testGetValueInvalidState(): void static::assertSame('new-value', $this->object->get('value')); } - public function provideTestSetGetKeepType(): iterable + public static function provideTestSetGetKeepType(): iterable { yield 'string' => [ 'value', @@ -237,9 +224,7 @@ public function provideTestSetGetKeepType(): iterable ]; } - /** - * @dataProvider provideTestSetGetKeepType - */ + #[DataProvider('provideTestSetGetKeepType')] public function testSetGetKeepType(mixed $value): void { $this->object->set('value', $value); diff --git a/packages/application/Tests/Configuration/Entity/ConfigTest.php b/packages/application/Tests/Configuration/Entity/ConfigTest.php index 86dbd0a50..bf91e769d 100644 --- a/packages/application/Tests/Configuration/Entity/ConfigTest.php +++ b/packages/application/Tests/Configuration/Entity/ConfigTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Application\Tests\Configuration\Entity; use Draw\Component\Application\Configuration\Entity\Config; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Application\Configuration\Entity\Config - */ +#[CoversClass(Config::class)] class ConfigTest extends TestCase { private Config $entity; diff --git a/packages/application/Tests/Cron/CronManagerTest.php b/packages/application/Tests/Cron/CronManagerTest.php index 47df0ac17..984258554 100644 --- a/packages/application/Tests/Cron/CronManagerTest.php +++ b/packages/application/Tests/Cron/CronManagerTest.php @@ -4,11 +4,10 @@ use Draw\Component\Application\Cron\CronManager; use Draw\Component\Application\Cron\Job; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Application\Cron\CronManager - */ +#[CoversClass(CronManager::class)] class CronManagerTest extends TestCase { private CronManager $service; diff --git a/packages/application/Tests/Cron/JobTest.php b/packages/application/Tests/Cron/JobTest.php index 0d4349869..2d3b44ee7 100644 --- a/packages/application/Tests/Cron/JobTest.php +++ b/packages/application/Tests/Cron/JobTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Application\Tests\Cron; use Draw\Component\Application\Cron\Job; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Application\Cron\Job - */ +#[CoversClass(Job::class)] class JobTest extends TestCase { private const DEFAULT_NAME = 'name'; diff --git a/packages/application/Tests/Versioning/Command/UpdateDeployedVersionCommandTest.php b/packages/application/Tests/Versioning/Command/UpdateDeployedVersionCommandTest.php index 761b4c94a..a76b0d505 100644 --- a/packages/application/Tests/Versioning/Command/UpdateDeployedVersionCommandTest.php +++ b/packages/application/Tests/Versioning/Command/UpdateDeployedVersionCommandTest.php @@ -6,21 +6,17 @@ use Draw\Component\Application\Versioning\VersionManager; use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; -/** - * @covers \Draw\Component\Application\Versioning\Command\UpdateDeployedVersionCommand - */ +#[CoversClass(UpdateDeployedVersionCommand::class)] class UpdateDeployedVersionCommandTest extends TestCase { use CommandTestTrait; - /** - * @var VersionManager&MockObject - */ - private VersionManager $versionManager; + private VersionManager&MockObject $versionManager; public function createCommand(): Command { @@ -34,12 +30,12 @@ public function getCommandName(): string return 'draw:application:update-deployed-version'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { return []; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { return []; } diff --git a/packages/application/Tests/Versioning/Event/FetchRunningVersionEventTest.php b/packages/application/Tests/Versioning/Event/FetchRunningVersionEventTest.php index 880177095..8b23ef976 100644 --- a/packages/application/Tests/Versioning/Event/FetchRunningVersionEventTest.php +++ b/packages/application/Tests/Versioning/Event/FetchRunningVersionEventTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Application\Tests\Versioning\Event; use Draw\Component\Application\Versioning\Event\FetchRunningVersionEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\Application\Versioning\Event\FetchRunningVersionEvent - */ +#[CoversClass(FetchRunningVersionEvent::class)] class FetchRunningVersionEventTest extends TestCase { private FetchRunningVersionEvent $event; diff --git a/packages/application/Tests/Versioning/EventListener/FetchRunningVersionListenerTest.php b/packages/application/Tests/Versioning/EventListener/FetchRunningVersionListenerTest.php index 531de26a3..1dab2b09a 100644 --- a/packages/application/Tests/Versioning/EventListener/FetchRunningVersionListenerTest.php +++ b/packages/application/Tests/Versioning/EventListener/FetchRunningVersionListenerTest.php @@ -5,12 +5,11 @@ use Draw\Component\Application\Versioning\Event\FetchRunningVersionEvent; use Draw\Component\Application\Versioning\EventListener\FetchRunningVersionListener; use Draw\Component\Core\Reflection\ReflectionAccessor; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -/** - * @covers \Draw\Component\Application\Versioning\EventListener\FetchRunningVersionListener - */ +#[CoversClass(FetchRunningVersionListener::class)] class FetchRunningVersionListenerTest extends TestCase { private FetchRunningVersionListener $service; diff --git a/packages/application/Tests/Versioning/VersionManagerTest.php b/packages/application/Tests/Versioning/VersionManagerTest.php index 5533f569f..06d012410 100644 --- a/packages/application/Tests/Versioning/VersionManagerTest.php +++ b/packages/application/Tests/Versioning/VersionManagerTest.php @@ -7,26 +7,19 @@ use Draw\Component\Core\Reflection\ReflectionAccessor; use Draw\Contracts\Application\ConfigurationRegistryInterface; use Draw\Contracts\Application\VersionVerificationInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -/** - * @covers \Draw\Component\Application\Versioning\VersionManager - */ +#[CoversClass(VersionManager::class)] class VersionManagerTest extends TestCase { private VersionManager $service; - /** - * @var ConfigurationRegistryInterface&MockObject - */ - private ConfigurationRegistryInterface $configurationRegistry; + private ConfigurationRegistryInterface&MockObject $configurationRegistry; - /** - * @var EventDispatcherInterface&MockObject - */ - private EventDispatcherInterface $eventDispatcher; + private MockObject&EventDispatcherInterface $eventDispatcher; protected function setUp(): void { diff --git a/packages/application/composer.json b/packages/application/composer.json index 28d8fece1..e259d687b 100644 --- a/packages/application/composer.json +++ b/packages/application/composer.json @@ -16,7 +16,7 @@ "symfony/event-dispatcher": "^5.4.3" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "draw/tester": "^0.10", "symfony/cache": "^5.4.3", "symfony/console": "^5.4.3" diff --git a/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php b/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php index 4eb55965a..90b46f32d 100644 --- a/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php +++ b/packages/aws-tool-kit/Tests/Command/CloudWatchLogsDownloadCommandTest.php @@ -7,23 +7,21 @@ use Draw\Component\Core\Reflection\ReflectionAccessor; use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; +use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; -/** - * @covers \Draw\Component\AwsToolKit\Command\CloudWatchLogsDownloadCommand - */ +#[CoversClass(CloudWatchLogsDownloadCommand::class)] class CloudWatchLogsDownloadCommandTest extends TestCase { use CommandTestTrait; + use MockTrait; - /** - * @var CloudWatchLogsClient&MockObject - */ - private CloudWatchLogsClient $cloudWatchLogsClient; + private CloudWatchLogsClient&MockObject $cloudWatchLogsClient; public function createCommand(): Command { @@ -44,14 +42,14 @@ public function getCommandName(): string return 'draw:aws:cloud-watch-logs:download'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { yield ['logGroupName', InputArgument::REQUIRED, null]; yield ['logStreamName', InputArgument::REQUIRED, null]; yield ['output', InputArgument::REQUIRED, null]; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { yield ['startTime', null, InputOption::VALUE_REQUIRED, '- 1 days']; yield ['endTime', null, InputOption::VALUE_REQUIRED, 'now']; @@ -102,9 +100,11 @@ public function testExecuteNewFile(): void $this->cloudWatchLogsClient ->expects(static::exactly(2)) ->method('getLogEvents') - ->withConsecutive( - [$logEvents], - [$logEvents + ['nextToken' => 'next-token']] + ->with( + ...static::withConsecutive( + [$logEvents], + [$logEvents + ['nextToken' => 'next-token']] + ) ) ->willReturnOnConsecutiveCalls( [ diff --git a/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php b/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php index 654b26493..d3b19b2fe 100644 --- a/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php +++ b/packages/aws-tool-kit/Tests/EventListener/NewestInstanceRoleListenerCheckTest.php @@ -6,6 +6,7 @@ use Draw\Component\AwsToolKit\EventListener\NewestInstanceRoleCheckListener; use Draw\Component\AwsToolKit\Imds\ImdsClientInterface; use Draw\Component\Core\Reflection\ReflectionAccessor; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Event\ConsoleCommandEvent; @@ -13,22 +14,12 @@ use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -/** - * @covers \Draw\Component\AwsToolKit\EventListener\NewestInstanceRoleCheckListener - */ +#[CoversClass(NewestInstanceRoleCheckListener::class)] class NewestInstanceRoleListenerCheckTest extends TestCase { private NewestInstanceRoleCheckListener $service; - /** - * @var Ec2Client&MockObject - */ - private Ec2Client $ec2Client; - - /** - * @var ImdsClientInterface&MockObject - */ - private ImdsClientInterface $imdsClient; + private ImdsClientInterface&MockObject $imdsClient; protected function setUp(): void { @@ -262,10 +253,10 @@ private function mockEc2ClientDescribeInstances( ReflectionAccessor::setPropertyValue( $this->service, 'ec2Client', - $this->ec2Client = $ec2Client + $ec2Client ); - $invocationMocker = $this->ec2Client + $invocationMocker = $ec2Client ->expects(static::once()) ->method('describeInstances') ->with( diff --git a/packages/aws-tool-kit/Tests/Imds/ImdsClientV1Test.php b/packages/aws-tool-kit/Tests/Imds/ImdsClientV1Test.php index 593a0e081..fa6dee3a0 100644 --- a/packages/aws-tool-kit/Tests/Imds/ImdsClientV1Test.php +++ b/packages/aws-tool-kit/Tests/Imds/ImdsClientV1Test.php @@ -3,22 +3,18 @@ namespace Draw\Component\AwsToolKit\Tests\Imds; use Draw\Component\AwsToolKit\Imds\ImdsClientV1; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\ResponseInterface; -/** - * @covers \Draw\Component\AwsToolKit\Imds\ImdsClientV1 - */ +#[CoversClass(ImdsClientV1::class)] class ImdsClientV1Test extends TestCase { private ImdsClientV1 $imdsClientV1; - /** - * @var HttpClientInterface&MockObject - */ - private HttpClientInterface $httpClient; + private HttpClientInterface&MockObject $httpClient; protected function setUp(): void { diff --git a/packages/aws-tool-kit/Tests/Imds/ImdsClientV2Test.php b/packages/aws-tool-kit/Tests/Imds/ImdsClientV2Test.php index 34cd6eaa8..79b680143 100644 --- a/packages/aws-tool-kit/Tests/Imds/ImdsClientV2Test.php +++ b/packages/aws-tool-kit/Tests/Imds/ImdsClientV2Test.php @@ -3,22 +3,21 @@ namespace Draw\Component\AwsToolKit\Tests\Imds; use Draw\Component\AwsToolKit\Imds\ImdsClientV2; +use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\ResponseInterface; -/** - * @covers \Draw\Component\AwsToolKit\Imds\ImdsClientV2 - */ +#[CoversClass(ImdsClientV2::class)] class ImdsClientV2Test extends TestCase { + use MockTrait; + private ImdsClientV2 $imdsClientV1; - /** - * @var HttpClientInterface&MockObject - */ - private HttpClientInterface $httpClient; + private HttpClientInterface&MockObject $httpClient; protected function setUp(): void { @@ -46,25 +45,27 @@ public function testGetCurrentInstanceId(): void $this->httpClient ->expects(static::exactly(2)) ->method('request') - ->withConsecutive( - [ - 'PUT', - 'http://169.254.169.254/latest/api/token', + ->with( + ...static::withConsecutive( [ - 'headers' => [ - 'X-aws-ec2-metadata-token-ttl-seconds' => 3600, + 'PUT', + 'http://169.254.169.254/latest/api/token', + [ + 'headers' => [ + 'X-aws-ec2-metadata-token-ttl-seconds' => 3600, + ], ], ], - ], - [ - 'GET', - 'http://169.254.169.254/latest/meta-data/instance-id', [ - 'headers' => [ - 'X-aws-ec2-metadata-token' => $token, + 'GET', + 'http://169.254.169.254/latest/meta-data/instance-id', + [ + 'headers' => [ + 'X-aws-ec2-metadata-token' => $token, + ], ], - ], - ] + ] + ) ) ->willReturnOnConsecutiveCalls( $tokenResponse, diff --git a/packages/aws-tool-kit/composer.json b/packages/aws-tool-kit/composer.json index 3e3476b1e..fbe369b6a 100644 --- a/packages/aws-tool-kit/composer.json +++ b/packages/aws-tool-kit/composer.json @@ -12,7 +12,7 @@ "require-dev": { "draw/core": "^0.10", "draw/tester": "^0.10", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "symfony/cache": "^5.4.3", "symfony/http-client": "^5.4.3", "symfony/http-client-contracts": "^2.5" diff --git a/packages/console/Tests/Command/PurgeExecutionCommandTest.php b/packages/console/Tests/Command/PurgeExecutionCommandTest.php index e0a59df53..2e990d9ad 100644 --- a/packages/console/Tests/Command/PurgeExecutionCommandTest.php +++ b/packages/console/Tests/Command/PurgeExecutionCommandTest.php @@ -6,28 +6,23 @@ use Draw\Component\Console\Command\PurgeExecutionCommand; use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; +use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputOption; -/** - * @covers \Draw\Component\Console\Command\PurgeExecutionCommand - */ +#[CoversClass(PurgeExecutionCommand::class)] class PurgeExecutionCommandTest extends TestCase { use CommandTestTrait; + use MockTrait; - /** - * @var Connection&MockObject - */ - private Connection $connection; + private Connection&MockObject $connection; - /** - * @var LoggerInterface&MockObject - */ - private LoggerInterface $logger; + private LoggerInterface&MockObject $logger; public function createCommand(): Command { @@ -42,12 +37,12 @@ public function getCommandName(): string return 'draw:console:purge-execution'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { return []; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { yield [ 'delay', @@ -95,34 +90,38 @@ public function testExecute(): void static::exactly(3) ) ->method('debug') - ->withConsecutive( - [ - 'Purging all records before {delay}, {batch_size} at the time, sleeping {seconds} per batch.', - ['delay' => $date, 'batch_size' => 1000, 'seconds' => 0], - ], - [ - 'Sleeping for {seconds} seconds during purge.', - ['seconds' => 0], - ], - [ - 'Successfully purged {record_count} records.', - ['record_count' => 1002], - ] + ->with( + ...static::withConsecutive( + [ + 'Purging all records before {delay}, {batch_size} at the time, sleeping {seconds} per batch.', + ['delay' => $date, 'batch_size' => 1000, 'seconds' => 0], + ], + [ + 'Sleeping for {seconds} seconds during purge.', + ['seconds' => 0], + ], + [ + 'Successfully purged {record_count} records.', + ['record_count' => 1002], + ] + ) ); $this->connection->expects(static::exactly(2)) ->method('executeStatement') - ->withConsecutive( - [ - 'DELETE FROM command__execution WHERE state = ? AND updated_at < ? LIMIT ?', - ['terminated', new \DateTime($date), 1000], - ['string', 'datetime', 'integer'], - ], - [ - 'DELETE FROM command__execution WHERE state = ? AND updated_at < ? LIMIT ?', - ['terminated', new \DateTime($date), 1000], - ['string', 'datetime', 'integer'], - ] + ->with( + ...static::withConsecutive( + [ + 'DELETE FROM command__execution WHERE state = ? AND updated_at < ? LIMIT ?', + ['terminated', new \DateTime($date), 1000], + ['string', 'datetime', 'integer'], + ], + [ + 'DELETE FROM command__execution WHERE state = ? AND updated_at < ? LIMIT ?', + ['terminated', new \DateTime($date), 1000], + ['string', 'datetime', 'integer'], + ] + ) ) ->willReturnOnConsecutiveCalls(1000, 2); diff --git a/packages/console/Tests/Entity/ExecutionTest.php b/packages/console/Tests/Entity/ExecutionTest.php index 8ba6ee770..02e42cf1c 100644 --- a/packages/console/Tests/Entity/ExecutionTest.php +++ b/packages/console/Tests/Entity/ExecutionTest.php @@ -5,11 +5,10 @@ use Doctrine\ORM\Event\PreUpdateEventArgs; use Draw\Component\Console\Entity\Execution; use Draw\Component\Core\DateTimeUtils; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Console\Entity\Execution - */ +#[CoversClass(Execution::class)] class ExecutionTest extends TestCase { private Execution $entity; diff --git a/packages/console/Tests/Event/CommandErrorEventTest.php b/packages/console/Tests/Event/CommandErrorEventTest.php index 838977655..380650b08 100644 --- a/packages/console/Tests/Event/CommandErrorEventTest.php +++ b/packages/console/Tests/Event/CommandErrorEventTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Console\Tests\Event; use Draw\Component\Console\Event\CommandErrorEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\Console\Event\CommandErrorEvent - */ +#[CoversClass(CommandErrorEvent::class)] class CommandErrorEventTest extends TestCase { private CommandErrorEvent $event; diff --git a/packages/console/Tests/EventListener/CommandFlowListenerTest.php b/packages/console/Tests/EventListener/CommandFlowListenerTest.php index 1877b117e..fea814787 100644 --- a/packages/console/Tests/EventListener/CommandFlowListenerTest.php +++ b/packages/console/Tests/EventListener/CommandFlowListenerTest.php @@ -16,6 +16,8 @@ use Draw\Component\Core\Reflection\ReflectionAccessor; use Draw\Component\Tester\DoctrineOrmTrait; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -32,9 +34,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -/** - * @covers \Draw\Component\Console\EventListener\CommandFlowListener - */ +#[CoversClass(CommandFlowListener::class)] class CommandFlowListenerTest extends TestCase { use DoctrineOrmTrait; @@ -534,9 +534,7 @@ public function testLogCommandStartNoExecutionId(): void $this->object->logCommandStart($event); } - /** - * @depends testGenerateFromDatabaseReal - */ + #[Depends('testGenerateFromDatabaseReal')] public function testLogCommandStart(Execution $execution): void { $this->eventDispatcher @@ -621,9 +619,7 @@ public function testLogCommandTerminateNoExecutionId(): void $this->object->logCommandTerminate($event); } - /** - * @depends testGenerateFromDatabaseReal - */ + #[Depends('testGenerateFromDatabaseReal')] public function testLogCommandTerminate(Execution $execution): void { $event = new Event\ConsoleTerminateEvent( @@ -646,9 +642,7 @@ public function testLogCommandTerminate(Execution $execution): void static::assertSame($output, $execution->getOutput()); } - /** - * @depends testGenerateFromDatabaseReal - */ + #[Depends('testGenerateFromDatabaseReal')] public function testLogCommandTerminateLongOutput(Execution $execution): void { $event = new Event\ConsoleTerminateEvent( @@ -692,9 +686,7 @@ public function testLogCommandErrorNoExecutionId(): void $this->object->logCommandError($event); } - /** - * @depends testGenerateFromDatabaseReal - */ + #[Depends('testGenerateFromDatabaseReal')] public function testLogCommandError(Execution $execution): void { $event = new Event\ConsoleErrorEvent( @@ -745,9 +737,7 @@ public function testLogCommandError(Execution $execution): void static::assertNull($execution->getAutoAcknowledgeReason()); } - /** - * @depends testGenerateFromDatabaseReal - */ + #[Depends('testGenerateFromDatabaseReal')] public function testLogCommandErrorAutoAcknowledge(Execution $execution): void { $event = new Event\ConsoleErrorEvent( @@ -781,9 +771,7 @@ public function testLogCommandErrorAutoAcknowledge(Execution $execution): void static::assertSame($reason, $execution->getAutoAcknowledgeReason()); } - /** - * @depends testGenerateFromDatabaseReal - */ + #[Depends('testGenerateFromDatabaseReal')] public function testLogCommandTerminateDisabled(Execution $execution): void { $event = new Event\ConsoleTerminateEvent( @@ -805,9 +793,7 @@ public function testLogCommandTerminateDisabled(Execution $execution): void static::assertSame(Execution::STATE_DISABLED, $execution->getState()); } - /** - * @depends testGenerateFromDatabaseReal - */ + #[Depends('testGenerateFromDatabaseReal')] public function testLogCommandTerminateDisabledIgnored(Execution $execution): void { $event = new Event\ConsoleTerminateEvent( diff --git a/packages/console/Tests/Output/BufferedConsoleOutputTest.php b/packages/console/Tests/Output/BufferedConsoleOutputTest.php index a5ce0ea1c..23f293014 100644 --- a/packages/console/Tests/Output/BufferedConsoleOutputTest.php +++ b/packages/console/Tests/Output/BufferedConsoleOutputTest.php @@ -4,14 +4,13 @@ use Draw\Component\Console\Output\BufferedConsoleOutput; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\OutputInterface; -/** - * @covers \Draw\Component\Console\Output\BufferedConsoleOutput - */ +#[CoversClass(BufferedConsoleOutput::class)] class BufferedConsoleOutputTest extends TestCase { use MockTrait; diff --git a/packages/console/composer.json b/packages/console/composer.json index b36772c31..9c06a76c0 100644 --- a/packages/console/composer.json +++ b/packages/console/composer.json @@ -16,7 +16,7 @@ "require-dev": { "doctrine/orm": "^2.11", "draw/tester": "^0.10", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "symfony/cache": "^5.4.3" }, "minimum-stability": "dev", diff --git a/packages/core/Tests/DateTimeUtilsTest.php b/packages/core/Tests/DateTimeUtilsTest.php index b2e526915..1997804a3 100644 --- a/packages/core/Tests/DateTimeUtilsTest.php +++ b/packages/core/Tests/DateTimeUtilsTest.php @@ -7,7 +7,7 @@ class DateTimeUtilsTest extends TestCase { - public function provideTestIsSameTimestamp(): array + public static function provideTestIsSameTimestamp(): array { return [ 'both-null' => [ @@ -62,7 +62,7 @@ public function testIsSameTimestamp( ); } - public function provideTestToDateTimeX(): array + public static function provideTestToDateTimeX(): array { return [ 'null' => [null], @@ -105,7 +105,7 @@ public function testToDateTime(?\DateTimeInterface $dateTimeInterface): void static::assertNotSame($dateTimeInterface, $dateTime); } - public function provideTestMillisecondDiff(): array + public static function provideTestMillisecondDiff(): array { return [ 'now compare' => ['now', null, 0], diff --git a/packages/core/Tests/FilterExpression/EvaluatorTest.php b/packages/core/Tests/FilterExpression/EvaluatorTest.php index 909043ed0..178b73abc 100644 --- a/packages/core/Tests/FilterExpression/EvaluatorTest.php +++ b/packages/core/Tests/FilterExpression/EvaluatorTest.php @@ -23,7 +23,7 @@ protected function setUp(): void $this->object = new Evaluator(); } - public function provideExecute(): iterable + public static function provideExecute(): iterable { yield 'simple-match' => [ (new Query())->where(new ConstraintExpression('[property1]', new EqualTo('value1'))), diff --git a/packages/core/Tests/FilterExpression/Expression/CompositeExpressionEvaluatorTest.php b/packages/core/Tests/FilterExpression/Expression/CompositeExpressionEvaluatorTest.php index d87f5153d..0bef8e938 100644 --- a/packages/core/Tests/FilterExpression/Expression/CompositeExpressionEvaluatorTest.php +++ b/packages/core/Tests/FilterExpression/Expression/CompositeExpressionEvaluatorTest.php @@ -7,20 +7,16 @@ use Draw\Component\Core\FilterExpression\Expression\CompositeExpressionEvaluator; use Draw\Component\Core\FilterExpression\Expression\ConstraintExpression; use Draw\Component\Core\FilterExpression\Expression\ExpressionEvaluator; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Core\FilterExpression\Expression\CompositeExpressionEvaluator - */ +#[CoversClass(CompositeExpressionEvaluator::class)] class CompositeExpressionEvaluatorTest extends TestCase { private CompositeExpressionEvaluator $object; - /** - * @var Evaluator&MockObject - */ - private Evaluator $evaluator; + private Evaluator&MockObject $evaluator; protected function setUp(): void { diff --git a/packages/core/Tests/FilterExpression/Expression/ConstraintExpressionEvaluatorTest.php b/packages/core/Tests/FilterExpression/Expression/ConstraintExpressionEvaluatorTest.php index 5200d11e6..d92c2d094 100644 --- a/packages/core/Tests/FilterExpression/Expression/ConstraintExpressionEvaluatorTest.php +++ b/packages/core/Tests/FilterExpression/Expression/ConstraintExpressionEvaluatorTest.php @@ -5,11 +5,10 @@ use Draw\Component\Core\FilterExpression\Expression\CompositeExpression; use Draw\Component\Core\FilterExpression\Expression\ConstraintExpressionEvaluator; use Draw\Component\Core\FilterExpression\Expression\ExpressionEvaluator; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Core\FilterExpression\Expression\ConstraintExpressionEvaluator - */ +#[CoversClass(ConstraintExpressionEvaluator::class)] class ConstraintExpressionEvaluatorTest extends TestCase { private ConstraintExpressionEvaluator $object; diff --git a/packages/core/Tests/FilterExpression/QueryTest.php b/packages/core/Tests/FilterExpression/QueryTest.php index 6e52c0675..4daf79c62 100644 --- a/packages/core/Tests/FilterExpression/QueryTest.php +++ b/packages/core/Tests/FilterExpression/QueryTest.php @@ -5,11 +5,10 @@ use Draw\Component\Core\FilterExpression\Expression\CompositeExpression; use Draw\Component\Core\FilterExpression\Expression\Expression; use Draw\Component\Core\FilterExpression\Query; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Core\FilterExpression\Query - */ +#[CoversClass(Query::class)] class QueryTest extends TestCase { private Query $object; diff --git a/packages/core/Tests/Reflection/ReflectionAccessorTest.php b/packages/core/Tests/Reflection/ReflectionAccessorTest.php index acbfc18fe..98693734e 100644 --- a/packages/core/Tests/Reflection/ReflectionAccessorTest.php +++ b/packages/core/Tests/Reflection/ReflectionAccessorTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Core\Tests\Reflection; use Draw\Component\Core\Reflection\ReflectionAccessor; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Core\Reflection\ReflectionAccessor - */ +#[CoversClass(ReflectionAccessor::class)] class ReflectionAccessorTest extends TestCase { private static ?string $privateStaticProperty = null; diff --git a/packages/core/composer.json b/packages/core/composer.json index 4cad1ac26..05dc09d68 100644 --- a/packages/core/composer.json +++ b/packages/core/composer.json @@ -10,7 +10,7 @@ "symfony/validator": "^5.4.3" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/doctrine-extra/composer.json b/packages/doctrine-extra/composer.json index a1fbe5d61..17fd676e2 100644 --- a/packages/doctrine-extra/composer.json +++ b/packages/doctrine-extra/composer.json @@ -18,7 +18,7 @@ "doctrine/dbal": "^3.3", "doctrine/collections": "^1.0", "doctrine/data-fixtures": "^1.5", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php b/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php index 9a030d805..01e719aae 100644 --- a/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php +++ b/packages/fixer/Tests/ClassPrivateStaticCallFixerTest.php @@ -15,7 +15,7 @@ protected function setUp(): void $this->object = new ClassPrivateStaticCallFixer(); } - public function provideTestFix(): iterable + public static function provideTestFix(): iterable { foreach (glob(__DIR__.'/fixtures/ClassPrivateStaticCallFixerTest/in/*.php') as $inFile) { $outFile = str_replace('/in/', '/out/', $inFile); diff --git a/packages/fixer/Tests/ClassStaticCallFixerTest.php b/packages/fixer/Tests/ClassStaticCallFixerTest.php index e0b76c75b..7be3667a0 100644 --- a/packages/fixer/Tests/ClassStaticCallFixerTest.php +++ b/packages/fixer/Tests/ClassStaticCallFixerTest.php @@ -15,7 +15,7 @@ protected function setUp(): void $this->object = new ClassStaticCallFixer(); } - public function provideTestFix(): iterable + public static function provideTestFix(): iterable { foreach (glob(__DIR__.'/fixtures/ClassStaticCallFixerTest/in/*.php') as $inFile) { $outFile = str_replace('/in/', '/out/', $inFile); diff --git a/packages/fixer/composer.json b/packages/fixer/composer.json index fdc8e7c69..ef2f93529 100644 --- a/packages/fixer/composer.json +++ b/packages/fixer/composer.json @@ -15,7 +15,7 @@ "friendsofphp/php-cs-fixer": "^3.13" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/framework-extra-bundle/Tests/Bridge/Monolog/Processor/RequestHeadersProcessorTest.php b/packages/framework-extra-bundle/Tests/Bridge/Monolog/Processor/RequestHeadersProcessorTest.php index e158bd459..944da4320 100644 --- a/packages/framework-extra-bundle/Tests/Bridge/Monolog/Processor/RequestHeadersProcessorTest.php +++ b/packages/framework-extra-bundle/Tests/Bridge/Monolog/Processor/RequestHeadersProcessorTest.php @@ -9,7 +9,7 @@ class RequestHeadersProcessorTest extends TestCase { - public function provideTestInvoke(): iterable + public static function provideTestInvoke(): iterable { $requestHeaders = [ $header1 = uniqid('header1-') => [ diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddCommandExecutionOptionsCompilerPassTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddCommandExecutionOptionsCompilerPassTest.php index 378d5b567..d038891f3 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddCommandExecutionOptionsCompilerPassTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddCommandExecutionOptionsCompilerPassTest.php @@ -4,14 +4,13 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\AddCommandExecutionOptionsCompilerPass; use Draw\Component\Console\EventListener\CommandFlowListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; -/** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\AddCommandExecutionOptionsCompilerPass - */ +#[CoversClass(AddCommandExecutionOptionsCompilerPass::class)] class AddCommandExecutionOptionsCompilerPassTest extends TestCase { private AddCommandExecutionOptionsCompilerPass $compilerPass; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddNewestInstanceRoleCommandOptionPassTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddNewestInstanceRoleCommandOptionPassTest.php index 5fb09d738..11750d593 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddNewestInstanceRoleCommandOptionPassTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/AddNewestInstanceRoleCommandOptionPassTest.php @@ -4,14 +4,13 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\AddNewestInstanceRoleCommandOptionPass; use Draw\Component\AwsToolKit\EventListener\NewestInstanceRoleCheckListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; -/** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\AddNewestInstanceRoleCommandOptionPass - */ +#[CoversClass(AddNewestInstanceRoleCommandOptionPass::class)] class AddNewestInstanceRoleCommandOptionPassTest extends TestCase { private AddNewestInstanceRoleCommandOptionPass $compilerPass; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/UserCheckerDecoratorPassTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/UserCheckerDecoratorPassTest.php index d4021bc70..a77b5da73 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/UserCheckerDecoratorPassTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Compiler/UserCheckerDecoratorPassTest.php @@ -4,14 +4,13 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\UserCheckerDecoratorPass; use Draw\Component\Security\Core\User\EventDrivenUserChecker; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; -/** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Compiler\UserCheckerDecoratorPass - */ +#[CoversClass(UserCheckerDecoratorPass::class)] class UserCheckerDecoratorPassTest extends TestCase { private UserCheckerDecoratorPass $compilerPass; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php index 4873028bb..cc210a67e 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php @@ -20,7 +20,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestInvalidConfiguration(): iterable + public static function provideTestInvalidConfiguration(): iterable { yield [ ['invalid' => true], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/DrawFrameworkExtraExtensionTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/DrawFrameworkExtraExtensionTest.php index bf5caf89d..b2ccdcebd 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/DrawFrameworkExtraExtensionTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/DrawFrameworkExtraExtensionTest.php @@ -18,8 +18,8 @@ public function getConfiguration(): array return []; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { - return []; + yield [null]; } } diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php index 6597dda6d..9b226989c 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php @@ -9,12 +9,12 @@ use Draw\Component\AwsToolKit\Imds\ImdsClientInterface; use Draw\Component\AwsToolKit\Imds\ImdsClientV1; use Draw\Component\AwsToolKit\Imds\ImdsClientV2; +use PHPUnit\Framework\Attributes\CoversClass; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\AwsToolKitIntegration - * * @property AwsToolKitIntegration $integration */ +#[CoversClass(AwsToolKitIntegration::class)] class AwsToolKitIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -37,7 +37,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield 'imds_version_1' => [ [ diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php index 816b3d93c..2a0313c5e 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php @@ -8,13 +8,13 @@ use Draw\Component\Application\Configuration\DoctrineConfigurationRegistry; use Draw\Component\Application\Configuration\Entity\Config; use Draw\Contracts\Application\ConfigurationRegistryInterface; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\ContainerBuilder; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ConfigurationIntegration - * * @property ConfigurationIntegration $integration */ +#[CoversClass(ConfigurationIntegration::class)] class ConfigurationIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -77,7 +77,7 @@ public function testPrepend(): void ); } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php index 688d21b2d..2a3a46be8 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php @@ -8,14 +8,14 @@ use Draw\Component\Console\Command\PurgeExecutionCommand; use Draw\Component\Console\Entity\Execution; use Draw\Component\Console\EventListener\CommandFlowListener; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ConsoleIntegration - * * @property ConsoleIntegration $integration */ +#[CoversClass(ConsoleIntegration::class)] class ConsoleIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -80,7 +80,7 @@ public function testPrepend(): void ); } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [ diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php index 0c6d423f8..14adb775b 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php @@ -6,13 +6,13 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\Application\Cron\Command\CronDumpToFileCommand; use Draw\Component\Application\Cron\CronManager; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Definition; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\CronIntegration - * * @property CronIntegration $integration */ +#[CoversClass(CronIntegration::class)] class CronIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -32,7 +32,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [ diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php index 5bdac91c9..39d1a9602 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php @@ -5,12 +5,12 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\DoctrineExtraIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\DoctrineExtra\ORM\EntityHandler; +use PHPUnit\Framework\Attributes\CoversClass; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ConfigurationIntegration - * * @property DoctrineExtraIntegration $integration */ +#[CoversClass(DoctrineExtraIntegration::class)] class DoctrineExtraIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -28,7 +28,7 @@ public function getDefaultConfiguration(): array return []; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php index 982abd8db..dbe68771f 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php @@ -6,12 +6,12 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\FeatureIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\Application\Feature\FeatureInitializer; +use PHPUnit\Framework\Attributes\CoversClass; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\FeatureIntegration - * * @property ConfigurationIntegration $integration */ +#[CoversClass(FeatureIntegration::class)] class FeatureIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -29,7 +29,7 @@ public function getDefaultConfiguration(): array return []; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/IntegrationTestCase.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/IntegrationTestCase.php index b26e8e150..1325fc108 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/IntegrationTestCase.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/IntegrationTestCase.php @@ -15,10 +15,7 @@ abstract class IntegrationTestCase extends TestCase { - /** - * @var IntegrationInterface|PrependIntegrationInterface - */ - protected IntegrationInterface $integration; + protected IntegrationInterface|PrependIntegrationInterface $integration; abstract public function createIntegration(): IntegrationInterface; @@ -26,7 +23,7 @@ abstract public function getConfigurationSectionName(): string; abstract public function getDefaultConfiguration(): array; - abstract public function provideTestLoad(): iterable; + abstract public static function provideTestLoad(): iterable; protected function setUp(): void { diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php index 2f926d237..d7e74af6d 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php @@ -7,13 +7,13 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LogIntegration; use Draw\Component\Log\Monolog\Processor\DelayProcessor; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Bridge\Monolog\Processor\ConsoleCommandProcessor; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LogIntegration - * * @property LogIntegration $integration */ +#[CoversClass(LogIntegration::class)] class LogIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -54,7 +54,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield 'all' => [ [ diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php index 81456100d..18bfe6b2a 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php @@ -5,13 +5,13 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LoggerIntegration; use Draw\Bundle\FrameworkExtraBundle\Logger\EventListener\SlowRequestLoggerListener; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Definition; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LoggerIntegration - * * @property LoggerIntegration $integration */ +#[CoversClass(LoggerIntegration::class)] class LoggerIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -35,7 +35,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield 'default' => []; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php index 0b20eb977..1ec1cce08 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php @@ -11,16 +11,16 @@ use Draw\Component\Mailer\EventListener\EmailSubjectFromHtmlTitleListener; use Draw\Component\Mailer\EventListener\EmailWriterListener; use Draw\Component\Mailer\Twig\TranslationExtension; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension; use Symfony\Bundle\TwigBundle\DependencyInjection\TwigExtension; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\MailerIntegration - * * @property MailerIntegration $integration */ +#[CoversClass(MailerIntegration::class)] class MailerIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -99,7 +99,7 @@ public function testPrepend(): void ); } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { $defaultServices = [ new ServiceConfiguration( diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php index e93130acb..9896460fd 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php @@ -35,16 +35,16 @@ use Draw\Component\Messenger\Versioning\EventListener\StopOnNewVersionListener; use Draw\Contracts\Messenger\EnvelopeFinderInterface; use Draw\Contracts\Messenger\TransportRepositoryInterface; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\MessengerIntegration - * * @property MessengerIntegration $integration */ +#[CoversClass(MessengerIntegration::class)] class MessengerIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -101,7 +101,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { $defaultServices = [ new ServiceConfiguration( diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php index f9cd90e88..d697c59b4 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php @@ -134,7 +134,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [ @@ -200,7 +200,7 @@ public function provideTestLoad(): iterable 'draw.open_api.schema_builder', [SchemaBuilderInterface::class], function (Definition $definition): void { - $this->assertSame(SymfonySchemaBuilder::class, $definition->getClass()); + static::assertSame(SymfonySchemaBuilder::class, $definition->getClass()); } ), new ServiceConfiguration( @@ -397,14 +397,14 @@ function (Definition $definition): void { 'draw.open_api.controller.open_api_controller', [OpenApiController::class], function (Definition $definition): void { - $this->assertSame( + static::assertSame( [ 'controller.service_arguments' => [[]], ], $definition->getTags() ); - $this->assertSame( + static::assertSame( '/test/sandbox', $definition->getArgument('$sandboxUrl') ); @@ -430,7 +430,7 @@ function (Definition $definition): void { 'draw.open_api.naming.aliases_class_naming_filter', [AliasesClassNamingFilter::class], function (Definition $definition): void { - $this->assertSame( + static::assertSame( [ ['class' => 'App\\Entity\\', 'alias' => ''], ['class' => 'App\\DTO\\', 'alias' => ''], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php index ac3b2f6b8..ae95f843d 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php @@ -7,12 +7,12 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ProcessIntegration; use Draw\Component\Process\ProcessFactory; use Draw\Contracts\Process\ProcessFactoryInterface; +use PHPUnit\Framework\Attributes\CoversClass; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ProcessIntegration - * * @property ConsoleIntegration $integration */ +#[CoversClass(ProcessIntegration::class)] class ProcessIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -30,7 +30,7 @@ public function getDefaultConfiguration(): array return []; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php index 4b288962d..a9bbe271d 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php @@ -11,13 +11,13 @@ use Draw\Component\Security\Core\EventListener\SystemMessengerAuthenticatorListener; use Draw\Component\Security\Http\EventListener\RoleRestrictedAuthenticatorListener; use Draw\Component\Security\Jwt\JwtEncoder; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Definition; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\SecurityIntegration - * * @property SecurityIntegration $integration */ +#[CoversClass(SecurityIntegration::class)] class SecurityIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -59,7 +59,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { $defaultServices = [ new ServiceConfiguration( diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php index 39b22d6e6..0ada50c23 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php @@ -12,13 +12,13 @@ use Draw\Component\Application\SystemMonitoring\Bridge\Symfony\Messenger\MessengerStatusProvider; use Draw\Component\Application\SystemMonitoring\Command\SystemStatusesCommand; use Draw\Component\Application\SystemMonitoring\System; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\ContainerBuilder; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\AwsToolKitIntegration - * * @property SystemMonitoringIntegration $integration */ +#[CoversClass(SystemMonitoringIntegration::class)] class SystemMonitoringIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -75,7 +75,7 @@ public function testPrepend(): void ); } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [ diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php index 74118506b..226c8a47e 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php @@ -5,12 +5,12 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\TesterIntegration; use Draw\Component\Tester\Command\TestsCoverageCheckCommand; +use PHPUnit\Framework\Attributes\CoversClass; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\TesterIntegration - * * @property TesterIntegration $integration */ +#[CoversClass(TesterIntegration::class)] class TesterIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -28,7 +28,7 @@ public function getDefaultConfiguration(): array return []; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php index bfd5079e4..3cfa7ffbe 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php @@ -6,12 +6,12 @@ use Draw\Component\Validator\Constraints\PhpCallableValidator; use Draw\Component\Validator\Constraints\RemoteFileExistsValidator; use Draw\Component\Validator\Constraints\ValueIsNotUsedValidator; +use PHPUnit\Framework\Attributes\CoversClass; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ValidatorIntegration - * * @property ValidatorIntegration $integration */ +#[CoversClass(ValidatorIntegration::class)] class ValidatorIntegrationTest extends IntegrationTestCase { public function createIntegration(): ValidatorIntegration @@ -29,7 +29,7 @@ public function getDefaultConfiguration(): array return []; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php index 0a64f168a..c4c1bbd70 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php @@ -8,14 +8,14 @@ use Draw\Component\Application\Versioning\EventListener\FetchRunningVersionListener; use Draw\Component\Application\Versioning\VersionManager; use Draw\Contracts\Application\VersionVerificationInterface; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Parameter; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\VersioningIntegration - * * @property VersioningIntegration $integration */ +#[CoversClass(VersioningIntegration::class)] class VersioningIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -33,7 +33,7 @@ public function getDefaultConfiguration(): array return []; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php index 2e35e5bde..184f9d18f 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php @@ -6,12 +6,12 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\WorkflowIntegration; use Draw\Component\Workflow\EventListener\AddTransitionNameToContextListener; use Draw\Component\Workflow\EventListener\AddUserToContextListener; +use PHPUnit\Framework\Attributes\CoversClass; /** - * @covers \Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\WorkflowIntegration - * * @property WorkflowIntegration $integration */ +#[CoversClass(WorkflowIntegration::class)] class WorkflowIntegrationTest extends IntegrationTestCase { public function createIntegration(): IntegrationInterface @@ -29,7 +29,7 @@ public function getDefaultConfiguration(): array return []; } - public function provideTestLoad(): iterable + public static function provideTestLoad(): iterable { yield [ [], diff --git a/packages/framework-extra-bundle/Tests/DrawFrameworkExtraBundleTest.php b/packages/framework-extra-bundle/Tests/DrawFrameworkExtraBundleTest.php index bee80a446..add419c3d 100644 --- a/packages/framework-extra-bundle/Tests/DrawFrameworkExtraBundleTest.php +++ b/packages/framework-extra-bundle/Tests/DrawFrameworkExtraBundleTest.php @@ -14,6 +14,7 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Factory\Security\JwtAuthenticatorFactory; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Factory\Security\MessengerMessageAuthenticatorFactory; use Draw\Bundle\FrameworkExtraBundle\DrawFrameworkExtraBundle; +use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\TestCase; use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension; use Symfony\Component\DependencyInjection\Compiler\PassConfig; @@ -21,6 +22,8 @@ class DrawFrameworkExtraBundleTest extends TestCase { + use MockTrait; + private DrawFrameworkExtraBundle $bundle; protected function setUp(): void @@ -35,36 +38,54 @@ public function testBuild(): void $containerBuilder ->expects(static::exactly(9)) ->method('addCompilerPass') - ->withConsecutive( - [ - static::isInstanceOf(TagIfExpressionCompilerPass::class), - ], - [ - static::isInstanceOf(LoggerDecoratorPass::class), - ], - [ - static::isInstanceOf(UserCheckerDecoratorPass::class), - ], - [ - static::isInstanceOf(MessengerBrokerCompilerPass::class), - ], - [ - static::isInstanceOf(AddNewestInstanceRoleCommandOptionPass::class), - ], - [ - static::isInstanceOf(AddCommandExecutionOptionsCompilerPass::class), - ], - [ - static::isInstanceOf(EmailWriterCompilerPass::class), - ], - [ - static::isInstanceOf(MessengerTransportNamesCompilerPass::class), - PassConfig::TYPE_BEFORE_OPTIMIZATION, - -1, - ], - [ - static::isInstanceOf(JmsDoctrineObjectConstructionCompilerPass::class), - ], + ->with( + ...static::withConsecutive( + [ + static::isInstanceOf(TagIfExpressionCompilerPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + 0, + ], + [ + static::isInstanceOf(LoggerDecoratorPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + -1, + ], + [ + static::isInstanceOf(UserCheckerDecoratorPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + 0, + ], + [ + static::isInstanceOf(MessengerBrokerCompilerPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + 0, + ], + [ + static::isInstanceOf(AddNewestInstanceRoleCommandOptionPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + 0, + ], + [ + static::isInstanceOf(AddCommandExecutionOptionsCompilerPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + 0, + ], + [ + static::isInstanceOf(EmailWriterCompilerPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + 0, + ], + [ + static::isInstanceOf(MessengerTransportNamesCompilerPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + -1, + ], + [ + static::isInstanceOf(JmsDoctrineObjectConstructionCompilerPass::class), + PassConfig::TYPE_BEFORE_OPTIMIZATION, + 0, + ], + ) ) ->willReturnSelf(); @@ -83,9 +104,11 @@ public function testBuild(): void $extension ->expects(static::exactly(2)) ->method('addAuthenticatorFactory') - ->withConsecutive( - [static::isInstanceOf(JwtAuthenticatorFactory::class)], - [static::isInstanceOf(MessengerMessageAuthenticatorFactory::class)], + ->with( + ...static::withConsecutive( + [static::isInstanceOf(JwtAuthenticatorFactory::class)], + [static::isInstanceOf(MessengerMessageAuthenticatorFactory::class)], + ) ); $this->bundle->build($containerBuilder); diff --git a/packages/framework-extra-bundle/composer.json b/packages/framework-extra-bundle/composer.json index 154df29b8..39cc64387 100644 --- a/packages/framework-extra-bundle/composer.json +++ b/packages/framework-extra-bundle/composer.json @@ -38,7 +38,7 @@ "draw/workflow": "^0.10", "monolog/monolog": "^2.4.0", "pelago/emogrifier": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "psr/log": "@stable", "symfony/event-dispatcher": "^5.4.3", "symfony/http-foundation": "^5.4.3", diff --git a/packages/log/composer.json b/packages/log/composer.json index e8a4c4006..2d1cc324d 100644 --- a/packages/log/composer.json +++ b/packages/log/composer.json @@ -15,7 +15,7 @@ "psr/log": "^2 || ^3" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/mailer/Tests/Command/SendTestEmailCommandTest.php b/packages/mailer/Tests/Command/SendTestEmailCommandTest.php index b689ba754..e1b48b203 100644 --- a/packages/mailer/Tests/Command/SendTestEmailCommandTest.php +++ b/packages/mailer/Tests/Command/SendTestEmailCommandTest.php @@ -5,6 +5,7 @@ use Draw\Component\Mailer\Command\SendTestEmailCommand; use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; @@ -12,17 +13,12 @@ use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mime\Email; -/** - * @covers \Draw\Component\Mailer\Command\SendTestEmailCommand - */ +#[CoversClass(SendTestEmailCommand::class)] class SendTestEmailCommandTest extends TestCase { use CommandTestTrait; - /** - * @var MailerInterface&MockObject - */ - private MailerInterface $mailer; + private MailerInterface&MockObject $mailer; public function createCommand(): Command { @@ -36,7 +32,7 @@ public function getCommandName(): string return 'draw:mailer:send-test-email'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { yield [ 'to', @@ -44,7 +40,7 @@ public function provideTestArgument(): iterable ]; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { return []; } diff --git a/packages/mailer/Tests/Email/CallToActionEmailTest.php b/packages/mailer/Tests/Email/CallToActionEmailTest.php index 6df0a0bb9..313c65adf 100644 --- a/packages/mailer/Tests/Email/CallToActionEmailTest.php +++ b/packages/mailer/Tests/Email/CallToActionEmailTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Mailer\Tests\Email; use Draw\Component\Mailer\Email\CallToActionEmail; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Mailer\Email\CallToActionEmail - */ +#[CoversClass(CallToActionEmail::class)] class CallToActionEmailTest extends TestCase { private CallToActionEmail $object; diff --git a/packages/mailer/Tests/EmailWriter/DefaultFromEmailWriterTest.php b/packages/mailer/Tests/EmailWriter/DefaultFromEmailWriterTest.php index e012b637d..fb2f53358 100644 --- a/packages/mailer/Tests/EmailWriter/DefaultFromEmailWriterTest.php +++ b/packages/mailer/Tests/EmailWriter/DefaultFromEmailWriterTest.php @@ -4,13 +4,12 @@ use Draw\Component\Mailer\EmailWriter\DefaultFromEmailWriter; use Draw\Component\Mailer\EmailWriter\EmailWriterInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Mime\Address; use Symfony\Component\Mime\Email; -/** - * @covers \Draw\Component\Mailer\EmailWriter\DefaultFromEmailWriter - */ +#[CoversClass(DefaultFromEmailWriter::class)] class DefaultFromEmailWriterTest extends TestCase { private DefaultFromEmailWriter $object; diff --git a/packages/mailer/Tests/EventListener/EmailCssInlinerListenerTest.php b/packages/mailer/Tests/EventListener/EmailCssInlinerListenerTest.php index 42828c592..b5130a8be 100644 --- a/packages/mailer/Tests/EventListener/EmailCssInlinerListenerTest.php +++ b/packages/mailer/Tests/EventListener/EmailCssInlinerListenerTest.php @@ -3,6 +3,7 @@ namespace Draw\Component\Mailer\Tests\EventListener; use Draw\Component\Mailer\EventListener\EmailCssInlinerListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -12,9 +13,7 @@ use Symfony\Component\Mime\Email; use Symfony\Component\Mime\RawMessage; -/** - * @covers \Draw\Component\Mailer\EventListener\EmailCssInlinerListener - */ +#[CoversClass(EmailCssInlinerListener::class)] class EmailCssInlinerListenerTest extends TestCase { private EmailCssInlinerListener $object; diff --git a/packages/mailer/Tests/EventListener/EmailSubjectFromHtmlTitleListenerTest.php b/packages/mailer/Tests/EventListener/EmailSubjectFromHtmlTitleListenerTest.php index a94d4c913..bd74f3dc9 100644 --- a/packages/mailer/Tests/EventListener/EmailSubjectFromHtmlTitleListenerTest.php +++ b/packages/mailer/Tests/EventListener/EmailSubjectFromHtmlTitleListenerTest.php @@ -3,6 +3,7 @@ namespace Draw\Component\Mailer\Tests\EventListener; use Draw\Component\Mailer\EventListener\EmailSubjectFromHtmlTitleListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Mailer\Envelope; @@ -11,9 +12,7 @@ use Symfony\Component\Mime\Email; use Symfony\Component\Mime\RawMessage; -/** - * @covers \Draw\Component\Mailer\EventListener\EmailSubjectFromHtmlTitleListener - */ +#[CoversClass(EmailSubjectFromHtmlTitleListener::class)] class EmailSubjectFromHtmlTitleListenerTest extends TestCase { private EmailSubjectFromHtmlTitleListener $object; diff --git a/packages/mailer/Tests/EventListener/EmailWriterListenerTest.php b/packages/mailer/Tests/EventListener/EmailWriterListenerTest.php index 934d852ed..c8986641a 100644 --- a/packages/mailer/Tests/EventListener/EmailWriterListenerTest.php +++ b/packages/mailer/Tests/EventListener/EmailWriterListenerTest.php @@ -5,6 +5,7 @@ use Draw\Component\Mailer\EmailWriter\EmailWriterInterface; use Draw\Component\Mailer\EventListener\EmailWriterListener; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; @@ -19,19 +20,14 @@ use Symfony\Component\Mime\Message; use Symfony\Component\Mime\RawMessage; -/** - * @covers \Draw\Component\Mailer\EventListener\EmailWriterListener - */ +#[CoversClass(EmailWriterListener::class)] class EmailWriterListenerTest extends TestCase { use MockTrait; private EmailWriterListener $object; - /** - * @var ContainerInterface&MockObject - */ - private ContainerInterface $serviceLocator; + private ContainerInterface&MockObject $serviceLocator; protected function setUp(): void { @@ -131,9 +127,11 @@ public function testComposeMessage(): void $this->serviceLocator ->expects(static::exactly(2)) ->method('get') - ->withConsecutive( - [$writer2], - [$writer1] + ->with( + ...static::withConsecutive( + [$writer2], + [$writer1] + ) ) ->willReturn( $emailWriter = $this->createMockWithExtraMethods(EmailWriterInterface::class, ['method1', 'method2']) diff --git a/packages/mailer/Tests/Twig/TranslationExtensionTest.php b/packages/mailer/Tests/Twig/TranslationExtensionTest.php index 5521da2c6..d6f952005 100644 --- a/packages/mailer/Tests/Twig/TranslationExtensionTest.php +++ b/packages/mailer/Tests/Twig/TranslationExtensionTest.php @@ -3,23 +3,22 @@ namespace Draw\Component\Mailer\Tests\Twig; use Draw\Component\Mailer\Twig\TranslationExtension; +use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Contracts\Translation\TranslatorInterface; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; -/** - * @covers \Draw\Component\Mailer\Twig\TranslationExtension - */ +#[CoversClass(TranslationExtension::class)] class TranslationExtensionTest extends TestCase { + use MockTrait; + private TranslationExtension $object; - /** - * @var TranslatorInterface&MockObject - */ - private TranslatorInterface $translator; + private TranslatorInterface&MockObject $translator; protected function setUp(): void { @@ -96,9 +95,11 @@ public function testTransMultipleMessage(): void $this->translator ->expects(static::exactly(2)) ->method('trans') - ->withConsecutive( - [$message1], - [$message2] + ->with( + ...static::withConsecutive( + [$message1], + [$message2] + ) ) ->willReturnOnConsecutiveCalls( $message1, diff --git a/packages/mailer/composer.json b/packages/mailer/composer.json index 5d240e796..b6b81c45a 100644 --- a/packages/mailer/composer.json +++ b/packages/mailer/composer.json @@ -18,7 +18,7 @@ "require-dev": { "draw/tester": "^0.10", "pelago/emogrifier": "^6.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/messenger/Tests/AutoStamp/EventListener/AutoStampEnvelopeListenerTest.php b/packages/messenger/Tests/AutoStamp/EventListener/AutoStampEnvelopeListenerTest.php index a4618ee93..774abda40 100644 --- a/packages/messenger/Tests/AutoStamp/EventListener/AutoStampEnvelopeListenerTest.php +++ b/packages/messenger/Tests/AutoStamp/EventListener/AutoStampEnvelopeListenerTest.php @@ -4,14 +4,13 @@ use Draw\Component\Messenger\AutoStamp\EventListener\AutoStampEnvelopeListener; use Draw\Component\Messenger\AutoStamp\Message\StampingAwareInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Event\SendMessageToTransportsEvent; -/** - * @covers \Draw\Component\Messenger\AutoStamp\EventListener\AutoStampEnvelopeListener - */ +#[CoversClass(AutoStampEnvelopeListener::class)] class AutoStampEnvelopeListenerTest extends TestCase implements StampingAwareInterface { private AutoStampEnvelopeListener $object; diff --git a/packages/messenger/Tests/Broker/BrokerTest.php b/packages/messenger/Tests/Broker/BrokerTest.php index 7995df911..3d907b7c4 100644 --- a/packages/messenger/Tests/Broker/BrokerTest.php +++ b/packages/messenger/Tests/Broker/BrokerTest.php @@ -6,32 +6,28 @@ use Draw\Component\Messenger\Broker\Event\BrokerRunningEvent; use Draw\Component\Messenger\Broker\Event\BrokerStartedEvent; use Draw\Component\Messenger\Broker\Event\NewConsumerProcessEvent; +use Draw\Component\Tester\MockTrait; use Draw\Contracts\Process\ProcessFactoryInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Process\Process; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -/** - * @covers \Draw\Component\Messenger\Broker\Broker - */ +#[CoversClass(Broker::class)] class BrokerTest extends TestCase { + use MockTrait; + private Broker $service; private string $context; private string $consolePath; - /** - * @var ProcessFactoryInterface&MockObject - */ - private ProcessFactoryInterface $processFactory; + private ProcessFactoryInterface&MockObject $processFactory; - /** - * @var EventDispatcherInterface&MockObject - */ - private EventDispatcherInterface $eventDispatcher; + private EventDispatcherInterface&MockObject $eventDispatcher; protected function setUp(): void { @@ -60,61 +56,63 @@ public function testStart(): void $this->eventDispatcher ->expects(static::exactly($concurrent * 4)) ->method('dispatch') - ->withConsecutive( - [ - static::callback(function (BrokerStartedEvent $event) use ($concurrent, $timeout) { - $this->assertSame( - $this->service, - $event->getBroker() - ); - - $this->assertSame( - $concurrent, - $event->getConcurrent() - ); - - $this->assertSame( - $timeout, - $event->getTimeout() - ); - - return true; - }), - ], - [ - static::callback(function (BrokerRunningEvent $event) { - $this->assertSame( - $this->service, - $event->getBroker() - ); - - return true; - }), - ], - [ - static::callback(function (NewConsumerProcessEvent $event) use ($receiver) { - static::assertSame( - $this->context, - $event->getContext() - ); - - $event->setReceivers([$receiver]); - - return true; - }), - ], - [ - static::callback(function (BrokerRunningEvent $event) { - $this->assertSame( - $this->service, - $event->getBroker() - ); - - $this->service->stop(); - - return true; - }), - ], + ->with( + ...static::withConsecutive( + [ + static::callback(function (BrokerStartedEvent $event) use ($concurrent, $timeout) { + $this->assertSame( + $this->service, + $event->getBroker() + ); + + $this->assertSame( + $concurrent, + $event->getConcurrent() + ); + + $this->assertSame( + $timeout, + $event->getTimeout() + ); + + return true; + }), + ], + [ + static::callback(function (BrokerRunningEvent $event) { + $this->assertSame( + $this->service, + $event->getBroker() + ); + + return true; + }), + ], + [ + static::callback(function (NewConsumerProcessEvent $event) use ($receiver) { + static::assertSame( + $this->context, + $event->getContext() + ); + + $event->setReceivers([$receiver]); + + return true; + }), + ], + [ + static::callback(function (BrokerRunningEvent $event) { + $this->assertSame( + $this->service, + $event->getBroker() + ); + + $this->service->stop(); + + return true; + }), + ], + ) ) ->willReturnArgument(0); diff --git a/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php b/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php index 368264e37..c704edbed 100644 --- a/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php +++ b/packages/messenger/Tests/Broker/Command/StartMessengerBrokerCommandTest.php @@ -8,15 +8,14 @@ use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; use Draw\Contracts\Process\ProcessFactoryInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\InvalidOptionException; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\EventDispatcher\EventDispatcher; -/** - * @covers \Draw\Component\Messenger\Broker\Command\StartMessengerBrokerCommand - */ +#[CoversClass(StartMessengerBrokerCommand::class)] class StartMessengerBrokerCommandTest extends TestCase { use CommandTestTrait; @@ -41,12 +40,12 @@ public function getCommandName(): string return 'draw:messenger:start-broker'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { return []; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { yield [ 'context', diff --git a/packages/messenger/Tests/Broker/Event/BrokerRunningEventTest.php b/packages/messenger/Tests/Broker/Event/BrokerRunningEventTest.php index 074b31e74..326a85a59 100644 --- a/packages/messenger/Tests/Broker/Event/BrokerRunningEventTest.php +++ b/packages/messenger/Tests/Broker/Event/BrokerRunningEventTest.php @@ -4,12 +4,11 @@ use Draw\Component\Messenger\Broker\Broker; use Draw\Component\Messenger\Broker\Event\BrokerRunningEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\Messenger\Broker\Event\BrokerRunningEvent - */ +#[CoversClass(BrokerRunningEvent::class)] class BrokerRunningEventTest extends TestCase { private BrokerRunningEvent $event; diff --git a/packages/messenger/Tests/Broker/Event/BrokerStartedEventTest.php b/packages/messenger/Tests/Broker/Event/BrokerStartedEventTest.php index 12ef86301..96fd2543d 100644 --- a/packages/messenger/Tests/Broker/Event/BrokerStartedEventTest.php +++ b/packages/messenger/Tests/Broker/Event/BrokerStartedEventTest.php @@ -4,12 +4,11 @@ use Draw\Component\Messenger\Broker\Broker; use Draw\Component\Messenger\Broker\Event\BrokerStartedEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\Messenger\Broker\Event\BrokerStartedEvent - */ +#[CoversClass(BrokerStartedEvent::class)] class BrokerStartedEventTest extends TestCase { private BrokerStartedEvent $event; diff --git a/packages/messenger/Tests/Broker/Event/NewConsumerProcessEventTest.php b/packages/messenger/Tests/Broker/Event/NewConsumerProcessEventTest.php index 10105097f..fb15fa516 100644 --- a/packages/messenger/Tests/Broker/Event/NewConsumerProcessEventTest.php +++ b/packages/messenger/Tests/Broker/Event/NewConsumerProcessEventTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Messenger\Tests\Broker\Event; use Draw\Component\Messenger\Broker\Event\NewConsumerProcessEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\Messenger\Broker\Event\NewConsumerProcessEvent - */ +#[CoversClass(NewConsumerProcessEvent::class)] class NewConsumerProcessEventTest extends TestCase { private NewConsumerProcessEvent $event; diff --git a/packages/messenger/Tests/Broker/EventListener/BrokerDefaultValuesListenerTest.php b/packages/messenger/Tests/Broker/EventListener/BrokerDefaultValuesListenerTest.php index 0f2c04aad..53d280f72 100644 --- a/packages/messenger/Tests/Broker/EventListener/BrokerDefaultValuesListenerTest.php +++ b/packages/messenger/Tests/Broker/EventListener/BrokerDefaultValuesListenerTest.php @@ -4,12 +4,11 @@ use Draw\Component\Messenger\Broker\Event\NewConsumerProcessEvent; use Draw\Component\Messenger\Broker\EventListener\BrokerDefaultValuesListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -/** - * @covers \Draw\Component\Messenger\Broker\EventListener\BrokerDefaultValuesListener - */ +#[CoversClass(BrokerDefaultValuesListener::class)] class BrokerDefaultValuesListenerTest extends TestCase { private BrokerDefaultValuesListener $service; diff --git a/packages/messenger/Tests/Broker/EventListener/StopBrokerOnSigtermSignalListenerTest.php b/packages/messenger/Tests/Broker/EventListener/StopBrokerOnSigtermSignalListenerTest.php index 304c2420a..0f0ab09e6 100644 --- a/packages/messenger/Tests/Broker/EventListener/StopBrokerOnSigtermSignalListenerTest.php +++ b/packages/messenger/Tests/Broker/EventListener/StopBrokerOnSigtermSignalListenerTest.php @@ -5,11 +5,10 @@ use Draw\Component\Messenger\Broker\Broker; use Draw\Component\Messenger\Broker\Event\BrokerStartedEvent; use Draw\Component\Messenger\Broker\EventListener\StopBrokerOnSigtermSignalListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Messenger\Broker\EventListener\StopBrokerOnSigtermSignalListener - */ +#[CoversClass(StopBrokerOnSigtermSignalListener::class)] class StopBrokerOnSigtermSignalListenerTest extends TestCase { private StopBrokerOnSigtermSignalListener $service; diff --git a/packages/messenger/Tests/DoctrineMessageBusHook/Entity/MessageHolderTraitTest.php b/packages/messenger/Tests/DoctrineMessageBusHook/Entity/MessageHolderTraitTest.php index 0be6de3c1..f3860eba7 100644 --- a/packages/messenger/Tests/DoctrineMessageBusHook/Entity/MessageHolderTraitTest.php +++ b/packages/messenger/Tests/DoctrineMessageBusHook/Entity/MessageHolderTraitTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Messenger\Tests\DoctrineMessageBusHook\Entity; use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderTrait - */ +#[CoversClass(MessageHolderTrait::class)] class MessageHolderTraitTest extends TestCase { use MessageHolderTrait; diff --git a/packages/messenger/Tests/DoctrineMessageBusHook/EnvelopeFactory/BasicEnvelopeFactoryTest.php b/packages/messenger/Tests/DoctrineMessageBusHook/EnvelopeFactory/BasicEnvelopeFactoryTest.php index 54b0f9464..4fbc3e4df 100644 --- a/packages/messenger/Tests/DoctrineMessageBusHook/EnvelopeFactory/BasicEnvelopeFactoryTest.php +++ b/packages/messenger/Tests/DoctrineMessageBusHook/EnvelopeFactory/BasicEnvelopeFactoryTest.php @@ -5,6 +5,7 @@ use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderInterface; use Draw\Component\Messenger\DoctrineMessageBusHook\EnvelopeFactory\BasicEnvelopeFactory; use Draw\Component\Messenger\DoctrineMessageBusHook\Event\EnvelopeCreatedEvent; +use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; @@ -12,6 +13,7 @@ class BasicEnvelopeFactoryTest extends TestCase { + use MockTrait; private BasicEnvelopeFactory $object; /** @@ -39,28 +41,30 @@ public function testCreateEnvelopes(): void $this->eventDispatcher ->expects(static::exactly(2)) ->method('dispatch') - ->withConsecutive( - [ - static::callback( - function (EnvelopeCreatedEvent $event) use ($messages, $messageHolder, $newEnvelope) { - $this->assertSame($messageHolder, $event->getMessageHolder()); - $this->assertSame($messages[0], $event->getEnvelope()->getMessage()); - $event->setEnvelope($newEnvelope); + ->with( + ...static::withConsecutive( + [ + static::callback( + function (EnvelopeCreatedEvent $event) use ($messages, $messageHolder, $newEnvelope) { + $this->assertSame($messageHolder, $event->getMessageHolder()); + $this->assertSame($messages[0], $event->getEnvelope()->getMessage()); + $event->setEnvelope($newEnvelope); - return true; - } - ), - ], - [ - static::callback( - function (EnvelopeCreatedEvent $event) use ($messages, $messageHolder) { - $this->assertSame($messageHolder, $event->getMessageHolder()); - $this->assertSame($messages[1], $event->getEnvelope()->getMessage()); + return true; + } + ), + ], + [ + static::callback( + function (EnvelopeCreatedEvent $event) use ($messages, $messageHolder) { + $this->assertSame($messageHolder, $event->getMessageHolder()); + $this->assertSame($messages[1], $event->getEnvelope()->getMessage()); - return true; - } - ), - ] + return true; + } + ), + ] + ) ) ->willReturnArgument(0); diff --git a/packages/messenger/Tests/DoctrineMessageBusHook/Event/EnvelopeCreatedEventTest.php b/packages/messenger/Tests/DoctrineMessageBusHook/Event/EnvelopeCreatedEventTest.php index 611627903..0aba573a7 100644 --- a/packages/messenger/Tests/DoctrineMessageBusHook/Event/EnvelopeCreatedEventTest.php +++ b/packages/messenger/Tests/DoctrineMessageBusHook/Event/EnvelopeCreatedEventTest.php @@ -4,22 +4,18 @@ use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderInterface; use Draw\Component\Messenger\DoctrineMessageBusHook\Event\EnvelopeCreatedEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\Messenger\DoctrineMessageBusHook\Event\EnvelopeCreatedEvent - */ +#[CoversClass(EnvelopeCreatedEvent::class)] class EnvelopeCreatedEventTest extends TestCase { private EnvelopeCreatedEvent $object; - /** - * @var MessageHolderInterface&MockObject - */ - private MessageHolderInterface $messageHolder; + private MessageHolderInterface&MockObject $messageHolder; private Envelope $envelope; diff --git a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php index a3d002c17..0569a7405 100644 --- a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php +++ b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/DoctrineBusMessageListenerTest.php @@ -15,35 +15,25 @@ use Draw\Component\Messenger\DoctrineMessageBusHook\EventListener\DoctrineBusMessageListener; use Draw\Component\Messenger\DoctrineMessageBusHook\Message\LifeCycleAwareMessageInterface; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Contracts\Service\ResetInterface; -/** - * @covers \Draw\Component\Messenger\DoctrineMessageBusHook\EventListener\DoctrineBusMessageListener - */ +#[CoversClass(DoctrineBusMessageListener::class)] class DoctrineBusMessageListenerTest extends TestCase { use MockTrait; private DoctrineBusMessageListener $object; - /** - * @var EnvelopeFactoryInterface&MockObject - */ - private EnvelopeFactoryInterface $envelopeFactory; + private EnvelopeFactoryInterface&MockObject $envelopeFactory; - /** - * @var MessageBusInterface&MockObject - */ - private MessageBusInterface $messageBus; + private MessageBusInterface&MockObject $messageBus; - /** - * @var EntityManagerInterface&MockObject - */ - private EntityManagerInterface $entityManager; + private EntityManagerInterface&MockObject $entityManager; protected function setUp(): void { diff --git a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDelayStampListenerTest.php b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDelayStampListenerTest.php index b4a90f144..c400f89b6 100644 --- a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDelayStampListenerTest.php +++ b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDelayStampListenerTest.php @@ -5,14 +5,13 @@ use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderInterface; use Draw\Component\Messenger\DoctrineMessageBusHook\Event\EnvelopeCreatedEvent; use Draw\Component\Messenger\DoctrineMessageBusHook\EventListener\EnvelopeFactoryDelayStampListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Stamp\DelayStamp; -/** - * @covers \Draw\Component\Messenger\DoctrineMessageBusHook\EventListener\EnvelopeFactoryDelayStampListener - */ +#[CoversClass(EnvelopeFactoryDelayStampListener::class)] class EnvelopeFactoryDelayStampListenerTest extends TestCase { private EnvelopeFactoryDelayStampListener $object; diff --git a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDispatchAfterCurrentBusStampListenerTest.php b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDispatchAfterCurrentBusStampListenerTest.php index 82bc8ab1e..1f6fbe8de 100644 --- a/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDispatchAfterCurrentBusStampListenerTest.php +++ b/packages/messenger/Tests/DoctrineMessageBusHook/EventListener/EnvelopeFactoryDispatchAfterCurrentBusStampListenerTest.php @@ -5,14 +5,13 @@ use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderInterface; use Draw\Component\Messenger\DoctrineMessageBusHook\Event\EnvelopeCreatedEvent; use Draw\Component\Messenger\DoctrineMessageBusHook\EventListener\EnvelopeFactoryDispatchAfterCurrentBusStampListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Stamp\DispatchAfterCurrentBusStamp; -/** - * @covers \Draw\Component\Messenger\DoctrineMessageBusHook\EventListener\EnvelopeFactoryDispatchAfterCurrentBusStampListener - */ +#[CoversClass(EnvelopeFactoryDispatchAfterCurrentBusStampListener::class)] class EnvelopeFactoryDispatchAfterCurrentBusStampListenerTest extends TestCase { private EnvelopeFactoryDispatchAfterCurrentBusStampListener $object; diff --git a/packages/messenger/Tests/Entity/DrawMessageTagTraitTest.php b/packages/messenger/Tests/Entity/DrawMessageTagTraitTest.php index 9edad6e04..00f4f9e8e 100644 --- a/packages/messenger/Tests/Entity/DrawMessageTagTraitTest.php +++ b/packages/messenger/Tests/Entity/DrawMessageTagTraitTest.php @@ -4,23 +4,17 @@ use Draw\Component\Messenger\Transport\Entity\DrawMessageInterface; use Draw\Component\Messenger\Transport\Entity\DrawMessageTagTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Messenger\Transport\Entity\DrawMessageTagTrait - */ +#[CoversClass(DrawMessageTagTrait::class)] class DrawMessageTagTraitTest extends TestCase { - /** - * @var DrawMessageTagTrait|object - */ - private object $entity; + private Tag $entity; protected function setUp(): void { - $this->entity = new class() { - use DrawMessageTagTrait; - }; + $this->entity = new Tag(); } public function testNameMutator(): void @@ -65,3 +59,8 @@ public function testToString(): void ); } } + +class Tag +{ + use DrawMessageTagTrait; +} diff --git a/packages/messenger/Tests/Entity/DrawMessageTraitTest.php b/packages/messenger/Tests/Entity/DrawMessageTraitTest.php index 32e575c2e..cc899284b 100644 --- a/packages/messenger/Tests/Entity/DrawMessageTraitTest.php +++ b/packages/messenger/Tests/Entity/DrawMessageTraitTest.php @@ -4,23 +4,17 @@ use Draw\Component\Messenger\Transport\Entity\DrawMessageTagInterface; use Draw\Component\Messenger\Transport\Entity\DrawMessageTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Messenger\Transport\Entity\DrawMessageTrait - */ +#[CoversClass(DrawMessageTrait::class)] class DrawMessageTraitTest extends TestCase { - /** - * @var DrawMessageTrait|object - */ - private object $entity; + private Message $entity; protected function setUp(): void { - $this->entity = new class() { - use DrawMessageTrait; - }; + $this->entity = new Message(); } public function testIdMutator(): void @@ -182,3 +176,8 @@ public function testToString(): void ); } } + +class Message +{ + use DrawMessageTrait; +} diff --git a/packages/messenger/Tests/EventListener/StopOnNewVersionListenerTest.php b/packages/messenger/Tests/EventListener/StopOnNewVersionListenerTest.php index 2ed93a48f..ffd32fb59 100644 --- a/packages/messenger/Tests/EventListener/StopOnNewVersionListenerTest.php +++ b/packages/messenger/Tests/EventListener/StopOnNewVersionListenerTest.php @@ -8,15 +8,14 @@ use Draw\Component\Messenger\Versioning\EventListener\StopOnNewVersionListener; use Draw\Contracts\Application\Exception\VersionInformationIsNotAccessibleException; use Draw\Contracts\Application\VersionVerificationInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Messenger\Event\WorkerRunningEvent; use Symfony\Component\Messenger\Event\WorkerStartedEvent; use Symfony\Component\Messenger\Worker; -/** - * @covers \Draw\Component\Messenger\Versioning\EventListener\StopOnNewVersionListener - */ +#[CoversClass(StopOnNewVersionListener::class)] class StopOnNewVersionListenerTest extends TestCase implements VersionVerificationInterface { private StopOnNewVersionListener $service; diff --git a/packages/messenger/Tests/Exception/MessageNotFoundExceptionTest.php b/packages/messenger/Tests/Exception/MessageNotFoundExceptionTest.php index 9b31ddf26..c0d1611e4 100644 --- a/packages/messenger/Tests/Exception/MessageNotFoundExceptionTest.php +++ b/packages/messenger/Tests/Exception/MessageNotFoundExceptionTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Messenger\Tests\Exception; use Draw\Contracts\Messenger\Exception\MessageNotFoundException; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Contracts\Messenger\Exception\MessageNotFoundException - */ +#[CoversClass(MessageNotFoundException::class)] class MessageNotFoundExceptionTest extends TestCase { private MessageNotFoundException $exception; diff --git a/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php b/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php index 925ba3334..e305c9c12 100644 --- a/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php +++ b/packages/messenger/Tests/Expirable/Command/PurgeExpiredMessageCommandTest.php @@ -8,6 +8,7 @@ use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; @@ -15,18 +16,13 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Messenger\Transport\TransportInterface; -/** - * @covers \Draw\Component\Messenger\Expirable\Command\PurgeExpiredMessageCommand - */ +#[CoversClass(PurgeExpiredMessageCommand::class)] class PurgeExpiredMessageCommandTest extends TestCase { use CommandTestTrait; use MockTrait; - /** - * @var TransportRepository&MockObject - */ - private TransportRepository $transportRepository; + private TransportRepository&MockObject $transportRepository; public function createCommand(): Command { @@ -40,7 +36,7 @@ public function getCommandName(): string return 'draw:messenger:purge-obsolete-messages'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { yield [ 'transport', @@ -48,7 +44,7 @@ public function provideTestArgument(): iterable ]; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { yield [ 'delay', @@ -82,9 +78,11 @@ public function testExecute(): void $this->transportRepository ->expects(static::exactly(2)) ->method('get') - ->withConsecutive( - [$transportNames[0]], - [$transportNames[1]] + ->with( + ...static::withConsecutive( + [$transportNames[0]], + [$transportNames[1]] + ) ) ->willReturnOnConsecutiveCalls( $transport1 = $this->createMock(PurgeableTransportInterface::class), diff --git a/packages/messenger/Tests/Expirable/Stamp/ExpirationStampTest.php b/packages/messenger/Tests/Expirable/Stamp/ExpirationStampTest.php index f54633f21..967b5ff1f 100644 --- a/packages/messenger/Tests/Expirable/Stamp/ExpirationStampTest.php +++ b/packages/messenger/Tests/Expirable/Stamp/ExpirationStampTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Messenger\Tests\Expirable\Stamp; use Draw\Component\Messenger\Expirable\Stamp\ExpirationStamp; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Stamp\StampInterface; -/** - * @covers \Draw\Component\Messenger\Expirable\Stamp\ExpirationStamp - */ +#[CoversClass(ExpirationStamp::class)] class ExpirationStampTest extends TestCase { private ExpirationStamp $entity; diff --git a/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php b/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php index 7eb8732f4..eaa378a85 100644 --- a/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php +++ b/packages/messenger/Tests/ManualTrigger/Action/ClickMessageActionTest.php @@ -9,6 +9,7 @@ use Draw\Component\Messenger\Searchable\Stamp\FoundFromTransportStamp; use Draw\Component\Messenger\Searchable\TransportRepository; use Draw\Contracts\Messenger\Exception\MessageNotFoundException; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -27,37 +28,20 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Contracts\Translation\TranslatorInterface; -/** - * @covers \Draw\Component\Messenger\ManualTrigger\Action\ClickMessageAction - */ +#[CoversClass(ClickMessageAction::class)] class ClickMessageActionTest extends TestCase { private ClickMessageAction $object; - /** - * @var MessageBusInterface&MockObject - */ - private MessageBusInterface $messageBus; + private MessageBusInterface&MockObject $messageBus; - /** - * @var EnvelopeFinder&MockObject - */ - private EnvelopeFinder $envelopeFinder; + private EnvelopeFinder&MockObject $envelopeFinder; - /** - * @var EventDispatcherInterface&MockObject - */ - private EventDispatcherInterface $eventDispatcher; + private EventDispatcherInterface&MockObject $eventDispatcher; - /** - * @var TranslatorInterface&MockObject - */ - private TranslatorInterface $translator; + private TranslatorInterface&MockObject $translator; - /** - * @var TransportRepository&MockObject - */ - private TransportRepository $transportRepository; + private TransportRepository&MockObject $transportRepository; private Request $request; @@ -87,7 +71,7 @@ public function testConstants(): void ); } - public function provideTestClickEnvelopeError(): iterable + public static function provideTestClickEnvelopeError(): iterable { yield 'not-found' => [ null, diff --git a/packages/messenger/Tests/ManualTrigger/Event/MessageLinkErrorEventTest.php b/packages/messenger/Tests/ManualTrigger/Event/MessageLinkErrorEventTest.php index 5e0903ec2..bca69ba57 100644 --- a/packages/messenger/Tests/ManualTrigger/Event/MessageLinkErrorEventTest.php +++ b/packages/messenger/Tests/ManualTrigger/Event/MessageLinkErrorEventTest.php @@ -3,14 +3,13 @@ namespace Draw\Component\Messenger\Tests\ManualTrigger\Event; use Draw\Component\Messenger\ManualTrigger\Event\MessageLinkErrorEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\Messenger\ManualTrigger\Event\MessageLinkErrorEvent - */ +#[CoversClass(MessageLinkErrorEvent::class)] class MessageLinkErrorEventTest extends TestCase { private MessageLinkErrorEvent $event; diff --git a/packages/messenger/Tests/ManualTrigger/EventListener/StampManuallyTriggeredEnvelopeListenerTest.php b/packages/messenger/Tests/ManualTrigger/EventListener/StampManuallyTriggeredEnvelopeListenerTest.php index bfad314d0..a9bdc7f51 100644 --- a/packages/messenger/Tests/ManualTrigger/EventListener/StampManuallyTriggeredEnvelopeListenerTest.php +++ b/packages/messenger/Tests/ManualTrigger/EventListener/StampManuallyTriggeredEnvelopeListenerTest.php @@ -5,14 +5,14 @@ use Draw\Component\Messenger\ManualTrigger\EventListener\StampManuallyTriggeredEnvelopeListener; use Draw\Component\Messenger\ManualTrigger\Message\ManuallyTriggeredInterface; use Draw\Component\Messenger\ManualTrigger\Stamp\ManualTriggerStamp; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Event\SendMessageToTransportsEvent; -/** - * @covers \Draw\Component\Messenger\ManualTrigger\EventListener\StampManuallyTriggeredEnvelopeListener - */ +#[CoversClass(StampManuallyTriggeredEnvelopeListener::class)] class StampManuallyTriggeredEnvelopeListenerTest extends TestCase { private StampManuallyTriggeredEnvelopeListener $service; @@ -42,7 +42,7 @@ public function testGetSubscribedEvents(): void ); } - public function provideTestHandleManuallyTriggeredMessage(): iterable + public static function provideTestHandleManuallyTriggeredMessage(): iterable { yield 'no-stamp-message-object' => [ new Envelope((object) []), @@ -50,19 +50,17 @@ public function provideTestHandleManuallyTriggeredMessage(): iterable ]; yield 'stamp-manually-triggered' => [ - new Envelope($this->createMock(ManuallyTriggeredInterface::class)), + new Envelope(new class() implements ManuallyTriggeredInterface {}), 1, ]; yield 'already-stamp-manually-triggered' => [ - new Envelope($this->createMock(ManuallyTriggeredInterface::class), [new ManualTriggerStamp()]), + new Envelope(new class() implements ManuallyTriggeredInterface {}, [new ManualTriggerStamp()]), 1, ]; } - /** - * @dataProvider provideTestHandleManuallyTriggeredMessage - */ + #[DataProvider('provideTestHandleManuallyTriggeredMessage')] public function testHandleManuallyTriggeredMessage(Envelope $envelope, int $expectedCount): void { $this->service->handleManuallyTriggeredMessage($event = new SendMessageToTransportsEvent($envelope)); diff --git a/packages/messenger/Tests/ManualTrigger/Message/RedirectToRouteMessageTraitTest.php b/packages/messenger/Tests/ManualTrigger/Message/RedirectToRouteMessageTraitTest.php index 9638274da..02a79fc9f 100644 --- a/packages/messenger/Tests/ManualTrigger/Message/RedirectToRouteMessageTraitTest.php +++ b/packages/messenger/Tests/ManualTrigger/Message/RedirectToRouteMessageTraitTest.php @@ -3,13 +3,12 @@ namespace Draw\Component\Messenger\Tests\ManualTrigger\Message; use Draw\Component\Messenger\ManualTrigger\Message\RedirectToRouteMessageTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -/** - * @covers \Draw\Component\Messenger\ManualTrigger\Message\RedirectToRouteMessageTrait - */ +#[CoversClass(RedirectToRouteMessageTrait::class)] class RedirectToRouteMessageTraitTest extends TestCase { use RedirectToRouteMessageTrait; diff --git a/packages/messenger/Tests/ManualTrigger/MessageHandler/RedirectToRouteMessageHandlerTest.php b/packages/messenger/Tests/ManualTrigger/MessageHandler/RedirectToRouteMessageHandlerTest.php index 72b082386..126ae1d1d 100644 --- a/packages/messenger/Tests/ManualTrigger/MessageHandler/RedirectToRouteMessageHandlerTest.php +++ b/packages/messenger/Tests/ManualTrigger/MessageHandler/RedirectToRouteMessageHandlerTest.php @@ -4,14 +4,13 @@ use Draw\Component\Messenger\ManualTrigger\Message\RedirectToRouteMessageInterface; use Draw\Component\Messenger\ManualTrigger\MessageHandler\RedirectToRouteMessageHandler; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Messenger\Handler\MessageHandlerInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -/** - * @covers \Draw\Component\Messenger\ManualTrigger\MessageHandler\RedirectToRouteMessageHandler; - */ +#[CoversClass(RedirectToRouteMessageHandler::class)] class RedirectToRouteMessageHandlerTest extends TestCase { private RedirectToRouteMessageHandler $service; diff --git a/packages/messenger/Tests/ManualTrigger/Stamp/ManualTriggerStampTest.php b/packages/messenger/Tests/ManualTrigger/Stamp/ManualTriggerStampTest.php index b06707654..cbc388dde 100644 --- a/packages/messenger/Tests/ManualTrigger/Stamp/ManualTriggerStampTest.php +++ b/packages/messenger/Tests/ManualTrigger/Stamp/ManualTriggerStampTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Messenger\Tests\ManualTrigger\Stamp; use Draw\Component\Messenger\ManualTrigger\Stamp\ManualTriggerStamp; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Stamp\StampInterface; -/** - * @covers \Draw\Component\Messenger\ManualTrigger\Stamp\ManualTriggerStamp - */ +#[CoversClass(ManualTriggerStamp::class)] class ManualTriggerStampTest extends TestCase { private ManualTriggerStamp $entity; diff --git a/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php b/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php index dc7267d82..464b13f63 100644 --- a/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php +++ b/packages/messenger/Tests/Searchable/EnvelopeFinderTest.php @@ -7,25 +7,21 @@ use Draw\Component\Messenger\Searchable\TransportRepository; use Draw\Component\Tester\MockTrait; use Draw\Contracts\Messenger\Exception\MessageNotFoundException; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Transport\Receiver\ListableReceiverInterface; use Symfony\Component\Messenger\Transport\TransportInterface; -/** - * @covers \Draw\Component\Messenger\Searchable\EnvelopeFinder - */ +#[CoversClass(EnvelopeFinder::class)] class EnvelopeFinderTest extends TestCase { use MockTrait; private EnvelopeFinder $service; - /** - * @var TransportRepository&MockObject - */ - private TransportRepository $transportRepository; + private TransportRepository&MockObject $transportRepository; protected function setUp(): void { diff --git a/packages/messenger/Tests/Searchable/Stamp/FindFromTransportStampTest.php b/packages/messenger/Tests/Searchable/Stamp/FindFromTransportStampTest.php index 6ed681777..ca8a8235d 100644 --- a/packages/messenger/Tests/Searchable/Stamp/FindFromTransportStampTest.php +++ b/packages/messenger/Tests/Searchable/Stamp/FindFromTransportStampTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Messenger\Tests\Searchable\Stamp; use Draw\Component\Messenger\Searchable\Stamp\FoundFromTransportStamp; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Stamp\StampInterface; -/** - * @covers \Draw\Component\Messenger\Searchable\Stamp\FoundFromTransportStamp - */ +#[CoversClass(FoundFromTransportStamp::class)] class FindFromTransportStampTest extends TestCase { private FoundFromTransportStamp $entity; diff --git a/packages/messenger/Tests/Searchable/Stamp/SearchableTagStampTest.php b/packages/messenger/Tests/Searchable/Stamp/SearchableTagStampTest.php index d62b70ca5..cb4a0deb5 100644 --- a/packages/messenger/Tests/Searchable/Stamp/SearchableTagStampTest.php +++ b/packages/messenger/Tests/Searchable/Stamp/SearchableTagStampTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Messenger\Tests\Searchable\Stamp; use Draw\Component\Messenger\Searchable\Stamp\SearchableTagStamp; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Stamp\StampInterface; -/** - * @covers \Draw\Component\Messenger\Searchable\Stamp\SearchableTagStamp - */ +#[CoversClass(SearchableTagStamp::class)] class SearchableTagStampTest extends TestCase { private SearchableTagStamp $entity; diff --git a/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php b/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php index caa71ac6d..eba4d1b92 100644 --- a/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php +++ b/packages/messenger/Tests/SerializerEventDispatcher/Event/BaseSerializerEventTest.php @@ -11,7 +11,7 @@ class BaseSerializerEventTest extends TestCase { - public function provideTestConstruct(): iterable + public static function provideTestConstruct(): iterable { yield [PostDecodeEvent::class]; yield [PostEncodeEvent::class]; diff --git a/packages/messenger/Tests/SerializerEventDispatcher/EventDispatcherSerializerDecoratorTest.php b/packages/messenger/Tests/SerializerEventDispatcher/EventDispatcherSerializerDecoratorTest.php index 8a8eaab77..0e9186c46 100644 --- a/packages/messenger/Tests/SerializerEventDispatcher/EventDispatcherSerializerDecoratorTest.php +++ b/packages/messenger/Tests/SerializerEventDispatcher/EventDispatcherSerializerDecoratorTest.php @@ -6,6 +6,7 @@ use Draw\Component\Messenger\SerializerEventDispatcher\Event\PostEncodeEvent; use Draw\Component\Messenger\SerializerEventDispatcher\Event\PreEncodeEvent; use Draw\Component\Messenger\SerializerEventDispatcher\EventDispatcherSerializerDecorator; +use Draw\Component\Tester\MockTrait; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Messenger\Envelope; @@ -14,6 +15,8 @@ class EventDispatcherSerializerDecoratorTest extends TestCase { + use MockTrait; + private EventDispatcherSerializerDecorator $object; private MockObject&SerializerInterface $serializer; @@ -67,9 +70,11 @@ public function testEncode(): void $this->eventDispatcher ->expects(static::exactly(2)) ->method('dispatch') - ->withConsecutive( - [new PreEncodeEvent($envelope)], - [new PostEncodeEvent($envelope)] + ->with( + ...static::withConsecutive( + [new PreEncodeEvent($envelope)], + [new PostEncodeEvent($envelope)] + ) ) ->willReturnArgument(0); diff --git a/packages/messenger/Tests/Transport/DrawTransportFactoryTest.php b/packages/messenger/Tests/Transport/DrawTransportFactoryTest.php index 17b36a77e..8fb7e94c9 100644 --- a/packages/messenger/Tests/Transport/DrawTransportFactoryTest.php +++ b/packages/messenger/Tests/Transport/DrawTransportFactoryTest.php @@ -5,13 +5,13 @@ use Draw\Component\Messenger\Tests\TestCase; use Draw\Component\Messenger\Transport\DrawTransport; use Draw\Component\Messenger\Transport\DrawTransportFactory; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\Messenger\Exception\InvalidArgumentException; use Symfony\Component\Messenger\Exception\TransportException; use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer; -/** - * @covers \Draw\Component\Messenger\Transport\DrawTransportFactory - */ +#[CoversClass(DrawTransportFactory::class)] class DrawTransportFactoryTest extends TestCase { private DrawTransportFactory $service; @@ -85,7 +85,7 @@ public function testBuildConfigurationExtraOptionsInQuery(): void $this->service::buildConfiguration($dsn, []); } - public function provideTestBuildConfiguration(): iterable + public static function provideTestBuildConfiguration(): iterable { yield 'default' => [ 'draw://default', @@ -241,9 +241,7 @@ public function provideTestBuildConfiguration(): iterable ]; } - /** - * @dataProvider provideTestBuildConfiguration - */ + #[DataProvider('provideTestBuildConfiguration')] public function testBuildConfiguration(string $dsn, array $options, array $expectedResult): void { $result = $this->service::buildConfiguration($dsn, $options); @@ -257,7 +255,7 @@ public function testBuildConfiguration(string $dsn, array $options, array $expec ); } - public function provideTestSupports(): iterable + public static function provideTestSupports(): iterable { yield 'draw' => [ 'draw://', @@ -280,9 +278,7 @@ public function provideTestSupports(): iterable ]; } - /** - * @dataProvider provideTestSupports - */ + #[DataProvider('provideTestSupports')] public function testSupports(string $dsn, bool $support): void { static::assertSame( diff --git a/packages/messenger/Tests/Transport/DrawTransportTest.php b/packages/messenger/Tests/Transport/DrawTransportTest.php index 5b02f8bc5..aea201f70 100644 --- a/packages/messenger/Tests/Transport/DrawTransportTest.php +++ b/packages/messenger/Tests/Transport/DrawTransportTest.php @@ -11,6 +11,11 @@ use Draw\Component\Messenger\Transport\DrawTransport; use Draw\Component\Messenger\Transport\DrawTransportFactory; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\AfterClass; +use PHPUnit\Framework\Attributes\BeforeClass; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; use Symfony\Component\Messenger\Envelope; use Symfony\Component\Messenger\Exception\TransportException; use Symfony\Component\Messenger\Stamp\RedeliveryStamp; @@ -21,20 +26,17 @@ use Symfony\Component\Messenger\Transport\SetupableTransportInterface; use Symfony\Component\Messenger\Transport\TransportInterface; -/** - * @covers \Draw\Component\Messenger\Transport\DrawTransport - */ +#[CoversClass(DrawTransport::class)] class DrawTransportTest extends TestCase { use MockTrait; private DrawTransport $service; - /** - * @beforeClass - * - * @afterClass - */ + #[ + BeforeClass, + AfterClass + ] public static function cleanUp(): void { try { @@ -96,9 +98,7 @@ public function testSetup(): void static::assertTrue(true); } - /** - * @depends testSetup - */ + #[Depends('testSetup')] public function testSendException(): void { $driverConnection = $this->mockProperty( @@ -117,9 +117,7 @@ public function testSendException(): void $this->service->send(new Envelope(new \stdClass())); } - /** - * @depends testSetup - */ + #[Depends('testSetup')] public function testSend(): Envelope { $envelope = $this->service->send(new Envelope( @@ -132,9 +130,7 @@ public function testSend(): Envelope return $envelope; } - /** - * @depends testSend - */ + #[Depends('testSend')] public function testFindByTag(Envelope $referencedEnvelope): void { $envelopes = $this->service->findByTag('tag1'); @@ -148,9 +144,7 @@ public function testFindByTag(Envelope $referencedEnvelope): void ); } - /** - * @depends testSend - */ + #[Depends('testSend')] public function testFindByTags(Envelope $referencedEnvelope): void { $envelopes = $this->service->findByTags(['tag1', 'tag2']); @@ -164,9 +158,7 @@ public function testFindByTags(Envelope $referencedEnvelope): void ); } - /** - * @depends testSetup - */ + #[Depends('testSetup')] public function testFindByTagsNoTags(): void { $driverConnection = $this->mockProperty( @@ -181,17 +173,13 @@ public function testFindByTagsNoTags(): void static::assertEmpty($this->service->findByTags([])); } - /** - * @depends testSend - */ + #[Depends('testSend')] public function testFindByTagsNotMatch(): void { static::assertCount(0, $this->service->findByTags(['tag3'])); } - /** - * @depends testSend - */ + #[Depends('testSend')] public function testFindAfterAcknowledge(Envelope $referencedEnvelope): void { $foundEnvelope = $this->service->find($referencedEnvelope->last(TransportMessageIdStamp::class)->getId()); @@ -202,7 +190,7 @@ public function testFindAfterAcknowledge(Envelope $referencedEnvelope): void static::assertNull($this->service->find($foundEnvelope->last(TransportMessageIdStamp::class)->getId())); } - public function provideTestSendSearchableMessage(): iterable + public static function provideTestSendSearchableMessage(): iterable { yield 'uniqueness' => [ [ @@ -274,13 +262,13 @@ public function provideTestSendSearchableMessage(): iterable } /** - * @depends testSetup - * - * @dataProvider provideTestSendSearchableMessage - * * @param array|Envelope[] $insertEnvelopes * @param array|string[] $searchTags */ + #[ + Depends('testSetup'), + DataProvider('provideTestSendSearchableMessage') + ] public function testSendSearchableMessage(array $insertEnvelopes, array $searchTags, int $resultCount): void { static::cleanUp(); @@ -292,9 +280,7 @@ public function testSendSearchableMessage(array $insertEnvelopes, array $searchT static::assertCount($resultCount, $this->service->findByTags($searchTags)); } - /** - * @depends testSetup - */ + #[Depends('testSetup')] public function testPurgeObsoleteMessages(): void { static::cleanUp(); diff --git a/packages/messenger/composer.json b/packages/messenger/composer.json index e3176e9c5..47fe7e8ea 100644 --- a/packages/messenger/composer.json +++ b/packages/messenger/composer.json @@ -32,7 +32,7 @@ "colinodell/psr-testlogger": "^1.1", "doctrine/orm": "^2.11", "draw/tester": "^0.10", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "psr/log": "@stable" }, "suggest": { diff --git a/packages/open-api/Tests/Command/InstallSandboxCommandTest.php b/packages/open-api/Tests/Command/InstallSandboxCommandTest.php index 7cc6c48db..44e4e518e 100644 --- a/packages/open-api/Tests/Command/InstallSandboxCommandTest.php +++ b/packages/open-api/Tests/Command/InstallSandboxCommandTest.php @@ -6,15 +6,14 @@ use Draw\Component\Tester\Application\CommandDataTester; use Draw\Component\Tester\Application\CommandTestTrait; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Filesystem\Filesystem; -/** - * @covers \Draw\Component\OpenApi\Command\InstallSandboxCommand - */ +#[CoversClass(InstallSandboxCommand::class)] class InstallSandboxCommandTest extends TestCase { use CommandTestTrait; @@ -30,7 +29,7 @@ public function getCommandName(): string return 'draw:open-api:install-sandbox'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { yield [ 'path', @@ -38,7 +37,7 @@ public function provideTestArgument(): iterable ]; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { yield [ 'tag', diff --git a/packages/open-api/Tests/Event/PreDumpRootSchemaEventTest.php b/packages/open-api/Tests/Event/PreDumpRootSchemaEventTest.php index f2f7aae34..eea1e09c4 100644 --- a/packages/open-api/Tests/Event/PreDumpRootSchemaEventTest.php +++ b/packages/open-api/Tests/Event/PreDumpRootSchemaEventTest.php @@ -4,12 +4,11 @@ use Draw\Component\OpenApi\Event\PreDumpRootSchemaEvent; use Draw\Component\OpenApi\Schema\Root; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Contracts\EventDispatcher\Event; -/** - * @covers \Draw\Component\OpenApi\Event\PreDumpRootSchemaEvent - */ +#[CoversClass(PreDumpRootSchemaEvent::class)] class PreDumpRootSchemaEventTest extends TestCase { private PreDumpRootSchemaEvent $object; diff --git a/packages/open-api/Tests/Event/PreSerializerResponseEventTest.php b/packages/open-api/Tests/Event/PreSerializerResponseEventTest.php index 89ebbe17d..10d9ec6b6 100644 --- a/packages/open-api/Tests/Event/PreSerializerResponseEventTest.php +++ b/packages/open-api/Tests/Event/PreSerializerResponseEventTest.php @@ -5,11 +5,10 @@ use Draw\Component\OpenApi\Event\PreSerializerResponseEvent; use Draw\Component\OpenApi\Serializer\Serialization; use JMS\Serializer\SerializationContext; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\OpenApi\Event\PreSerializerResponseEvent - */ +#[CoversClass(PreSerializerResponseEvent::class)] class PreSerializerResponseEventTest extends TestCase { private PreSerializerResponseEvent $object; diff --git a/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php b/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php index ecc40007b..cc5adfb24 100644 --- a/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php +++ b/packages/open-api/Tests/EventListener/BaseCleanerTestCase.php @@ -10,13 +10,13 @@ abstract class BaseCleanerTestCase extends TestCase { - abstract public function getFixtureDir(): string; + abstract public static function getFixtureDir(): string; abstract public function clean(CleanEvent $cleanEvent): void; - public function provideTestClean(): iterable + public static function provideTestClean(): iterable { - foreach (glob(__DIR__.'/fixture/cleaner/'.$this->getFixtureDir().'/*-dirty.json') as $file) { + foreach (glob(__DIR__.'/fixture/cleaner/'.static::getFixtureDir().'/*-dirty.json') as $file) { yield str_replace('-dirty.json', '', basename($file)) => [$file, str_replace('dirty.json', 'clean.json', $file)]; } } diff --git a/packages/open-api/Tests/EventListener/DefinitionAliasCleanerListenerTest.php b/packages/open-api/Tests/EventListener/DefinitionAliasCleanerListenerTest.php index d5a85cc89..ac4e20446 100644 --- a/packages/open-api/Tests/EventListener/DefinitionAliasCleanerListenerTest.php +++ b/packages/open-api/Tests/EventListener/DefinitionAliasCleanerListenerTest.php @@ -14,7 +14,7 @@ protected function setUp(): void $this->object = new DefinitionAliasCleanerListener(); } - public function getFixtureDir(): string + public static function getFixtureDir(): string { return 'DefinitionAliasCleanerListener'; } diff --git a/packages/open-api/Tests/EventListener/DuplicateDefinitionAliasSchemaCleanerListenerTest.php b/packages/open-api/Tests/EventListener/DuplicateDefinitionAliasSchemaCleanerListenerTest.php index 3f8c2d069..fb745394f 100644 --- a/packages/open-api/Tests/EventListener/DuplicateDefinitionAliasSchemaCleanerListenerTest.php +++ b/packages/open-api/Tests/EventListener/DuplicateDefinitionAliasSchemaCleanerListenerTest.php @@ -4,10 +4,9 @@ use Draw\Component\OpenApi\Event\CleanEvent; use Draw\Component\OpenApi\EventListener\DuplicateDefinitionAliasSchemaCleanerListener; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * @covers \Draw\Component\OpenApi\EventListener\DuplicateDefinitionAliasSchemaCleanerListener - */ +#[CoversClass(DuplicateDefinitionAliasSchemaCleanerListener::class)] class DuplicateDefinitionAliasSchemaCleanerListenerTest extends BaseCleanerTestCase { private DuplicateDefinitionAliasSchemaCleanerListener $object; @@ -17,7 +16,7 @@ protected function setUp(): void $this->object = new DuplicateDefinitionAliasSchemaCleanerListener(); } - public function getFixtureDir(): string + public static function getFixtureDir(): string { return 'DuplicateDefinitionAliasSchemaCleanerListener'; } diff --git a/packages/open-api/Tests/EventListener/RequestQueryParameterFetcherListenerTest.php b/packages/open-api/Tests/EventListener/RequestQueryParameterFetcherListenerTest.php index 8a40c8741..02ea01397 100644 --- a/packages/open-api/Tests/EventListener/RequestQueryParameterFetcherListenerTest.php +++ b/packages/open-api/Tests/EventListener/RequestQueryParameterFetcherListenerTest.php @@ -4,6 +4,8 @@ use Draw\Component\OpenApi\EventListener\RequestQueryParameterFetcherListener; use Draw\Component\OpenApi\Schema\QueryParameter; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; @@ -12,9 +14,7 @@ use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelInterface; -/** - * @covers \Draw\Component\OpenApi\EventListener\RequestQueryParameterFetcherListener - */ +#[CoversClass(RequestQueryParameterFetcherListener::class)] class RequestQueryParameterFetcherListenerTest extends TestCase { private RequestQueryParameterFetcherListener $object; @@ -101,9 +101,9 @@ public function testOnKernelControllerAttributeConflict(): void $this->object->onKernelController($event); } - public function provideOnKernelController(): iterable + public static function provideOnKernelController(): iterable { - foreach ((new \ReflectionObject($this))->getMethods() as $reflectionMethod) { + foreach ((new \ReflectionClass(static::class))->getMethods() as $reflectionMethod) { if (str_starts_with($reflectionMethod->getName(), 'actionTest')) { $parameters = $reflectionMethod->getParameters(); @@ -200,9 +200,7 @@ public function actionTestBooleanFalseFalse( ): void { } - /** - * @dataProvider provideOnKernelController - */ + #[DataProvider('provideOnKernelController')] public function testOnKernelController(string $methodName, mixed $value, mixed $expectedValue): void { $controllerEvent = new ControllerEvent( diff --git a/packages/open-api/Tests/EventListener/RequestValidationListenerTest.php b/packages/open-api/Tests/EventListener/RequestValidationListenerTest.php index 1e5a2b92c..3ad0fe64e 100644 --- a/packages/open-api/Tests/EventListener/RequestValidationListenerTest.php +++ b/packages/open-api/Tests/EventListener/RequestValidationListenerTest.php @@ -6,6 +6,8 @@ use Draw\Component\OpenApi\Exception\ConstraintViolationListException; use Draw\Component\OpenApi\Request\ValueResolver\RequestBody; use Draw\Component\OpenApi\Schema\QueryParameter; +use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -20,17 +22,14 @@ use Symfony\Component\Validator\ConstraintViolationListInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; -/** - * @covers \Draw\Component\OpenApi\EventListener\RequestValidationListener - */ +#[CoversClass(RequestValidationListener::class)] class RequestValidationListenerTest extends TestCase { + use MockTrait; + private RequestValidationListener $object; - /** - * @var ValidatorInterface&MockObject - */ - private ValidatorInterface $validator; + private ValidatorInterface&MockObject $validator; protected function setUp(): void { @@ -169,9 +168,11 @@ public function testOnKernelControllerWithError(): void $this->validator ->expects(static::exactly(2)) ->method('validate') - ->withConsecutive( - [$bodyObject, null, $groups], - [$parameterObject, $queryParameter->constraints] + ->with( + ...static::withConsecutive( + [$bodyObject, null, $groups], + [$parameterObject, $queryParameter->constraints, null] + ) ) ->willReturnOnConsecutiveCalls( $bodyViolationList = new ConstraintViolationList(), diff --git a/packages/open-api/Tests/EventListener/ResponseApiExceptionListenerTest.php b/packages/open-api/Tests/EventListener/ResponseApiExceptionListenerTest.php index 49771b91a..755613049 100644 --- a/packages/open-api/Tests/EventListener/ResponseApiExceptionListenerTest.php +++ b/packages/open-api/Tests/EventListener/ResponseApiExceptionListenerTest.php @@ -9,6 +9,8 @@ use Draw\Component\OpenApi\Schema\PathItem; use Draw\Component\OpenApi\Schema\Response as OpenResponse; use Draw\Component\OpenApi\Schema\Root; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; @@ -20,9 +22,7 @@ use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolationList; -/** - * @covers \Draw\Component\OpenApi\EventListener\ResponseApiExceptionListener - */ +#[CoversClass(ResponseApiExceptionListener::class)] class ResponseApiExceptionListenerTest extends TestCase { private ResponseApiExceptionListener $object; @@ -210,7 +210,7 @@ public function testOnKernelExceptionDefaultStatusCode500(): void ); } - public function provideOnKernelExceptionStatusCode(): iterable + public static function provideOnKernelExceptionStatusCode(): iterable { yield 'ChangeDefault' => [ new \Exception(), @@ -250,10 +250,9 @@ public function jsonSerialize(): void } /** - * @dataProvider provideOnKernelExceptionStatusCode - * * @param array $errorCodes */ + #[DataProvider('provideOnKernelExceptionStatusCode')] public function testOnKernelExceptionErrorCode(\Throwable $throwable, array $errorCodes, int $errorCode): void { $this->exceptionEvent = new ExceptionEvent( diff --git a/packages/open-api/Tests/EventListener/ResponseSerializerListenerTest.php b/packages/open-api/Tests/EventListener/ResponseSerializerListenerTest.php index 7561f7a52..1fbc5ba5a 100644 --- a/packages/open-api/Tests/EventListener/ResponseSerializerListenerTest.php +++ b/packages/open-api/Tests/EventListener/ResponseSerializerListenerTest.php @@ -8,6 +8,7 @@ use JMS\Serializer\ContextFactory\SerializationContextFactoryInterface; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -21,27 +22,16 @@ use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -/** - * @covers \Draw\Component\OpenApi\EventListener\ResponseSerializerListener - */ +#[CoversClass(ResponseSerializerListener::class)] class ResponseSerializerListenerTest extends TestCase { private ResponseSerializerListener $object; - /** - * @var SerializerInterface&MockObject - */ - private SerializerInterface $serializer; + private SerializerInterface&MockObject $serializer; - /** - * @var SerializationContextFactoryInterface&MockObject - */ - private SerializationContextFactoryInterface $serializationContextFactory; + private SerializationContextFactoryInterface&MockObject $serializationContextFactory; - /** - * @var EventDispatcherInterface&MockObject - */ - private EventDispatcherInterface $eventDispatcher; + private EventDispatcherInterface&MockObject $eventDispatcher; protected function setUp(): void { diff --git a/packages/open-api/Tests/EventListener/SchemaAddDefaultHeadersListenerTest.php b/packages/open-api/Tests/EventListener/SchemaAddDefaultHeadersListenerTest.php index 3eac70db8..766022d74 100644 --- a/packages/open-api/Tests/EventListener/SchemaAddDefaultHeadersListenerTest.php +++ b/packages/open-api/Tests/EventListener/SchemaAddDefaultHeadersListenerTest.php @@ -5,12 +5,11 @@ use Draw\Component\OpenApi\Event\PreDumpRootSchemaEvent; use Draw\Component\OpenApi\EventListener\SchemaAddDefaultHeadersListener; use JMS\Serializer\ArrayTransformerInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -/** - * @covers \Draw\Component\OpenApi\EventListener\SchemaAddDefaultHeadersListener - */ +#[CoversClass(SchemaAddDefaultHeadersListener::class)] class SchemaAddDefaultHeadersListenerTest extends TestCase { private SchemaAddDefaultHeadersListener $object; diff --git a/packages/open-api/Tests/EventListener/UnReferenceCleanerListenerTest.php b/packages/open-api/Tests/EventListener/UnReferenceCleanerListenerTest.php index 53b74b6cc..322c508db 100644 --- a/packages/open-api/Tests/EventListener/UnReferenceCleanerListenerTest.php +++ b/packages/open-api/Tests/EventListener/UnReferenceCleanerListenerTest.php @@ -17,7 +17,7 @@ protected function setUp(): void ]); } - public function getFixtureDir(): string + public static function getFixtureDir(): string { return 'UnReferenceCleanerListener'; } diff --git a/packages/open-api/Tests/Exception/ConstraintViolationListExceptionTest.php b/packages/open-api/Tests/Exception/ConstraintViolationListExceptionTest.php index f08060793..6524306da 100644 --- a/packages/open-api/Tests/Exception/ConstraintViolationListExceptionTest.php +++ b/packages/open-api/Tests/Exception/ConstraintViolationListExceptionTest.php @@ -3,13 +3,12 @@ namespace Draw\Component\OpenApi\Tests\Exception; use Draw\Component\OpenApi\Exception\ConstraintViolationListException; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\Exception\ValidatorException; -/** - * @covers \Draw\Component\OpenApi\Exception\ConstraintViolationListException - */ +#[CoversClass(ConstraintViolationListException::class)] class ConstraintViolationListExceptionTest extends TestCase { private ConstraintViolationListException $object; diff --git a/packages/open-api/Tests/Exception/ExtractionImpossibleExceptionTest.php b/packages/open-api/Tests/Exception/ExtractionImpossibleExceptionTest.php index 09e79f2b5..6ae8ef109 100644 --- a/packages/open-api/Tests/Exception/ExtractionImpossibleExceptionTest.php +++ b/packages/open-api/Tests/Exception/ExtractionImpossibleExceptionTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\OpenApi\Tests\Exception; use Draw\Component\OpenApi\Exception\ExtractionImpossibleException; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\OpenApi\Exception\ExtractionImpossibleException - */ +#[CoversClass(ExtractionImpossibleException::class)] class ExtractionImpossibleExceptionTest extends TestCase { private ExtractionImpossibleException $object; diff --git a/packages/open-api/Tests/Extraction/Extractor/Constraint/NotBlankConstraintExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/Constraint/NotBlankConstraintExtractorTest.php index 5e4d9e55d..e7416b98f 100644 --- a/packages/open-api/Tests/Extraction/Extractor/Constraint/NotBlankConstraintExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/Constraint/NotBlankConstraintExtractorTest.php @@ -6,14 +6,14 @@ use Draw\Component\OpenApi\Extraction\Extractor\Constraint\NotBlankConstraintExtractor; use Draw\Component\OpenApi\Schema\QueryParameter; use Draw\Component\OpenApi\Schema\Schema; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraints\IsNull; use Symfony\Component\Validator\Constraints\NotBlank; -/** - * @covers \Draw\Component\OpenApi\Extraction\Extractor\Constraint\NotBlankConstraintExtractor - */ +#[CoversClass(NotBlankConstraintExtractor::class)] class NotBlankConstraintExtractorTest extends TestCase { private NotBlankConstraintExtractor $object; @@ -23,7 +23,7 @@ protected function setUp(): void $this->object = new NotBlankConstraintExtractor(); } - public function provideTestSupport(): iterable + public static function provideTestSupport(): iterable { yield 'other-constraint' => [ new IsNull(), @@ -36,9 +36,7 @@ public function provideTestSupport(): iterable ]; } - /** - * @dataProvider provideTestSupport - */ + #[DataProvider('provideTestSupport')] public function testSupport(Constraint $constraint, bool $expected): void { static::assertSame($expected, $this->object->supportConstraint($constraint)); diff --git a/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php index 16e988eb9..67fa2b2fc 100644 --- a/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/JmsSerializer/PropertiesExtractorTest.php @@ -14,17 +14,17 @@ use JMS\Serializer\Naming\SerializedNameAnnotationStrategy; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerBuilder; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventDispatcher; -/** - * @covers \Draw\Component\OpenApi\Extraction\Extractor\JmsSerializer\PropertiesExtractor - */ +#[CoversClass(PropertiesExtractor::class)] class PropertiesExtractorTest extends TestCase { private PropertiesExtractor $jmsExtractor; - public function provideTestCanExtract(): iterable + public static function provideTestCanExtract(): iterable { return [ [null, null, false], @@ -47,9 +47,7 @@ protected function setUp(): void ); } - /** - * @dataProvider provideTestCanExtract - */ + #[DataProvider('provideTestCanExtract')] public function testCanExtract(mixed $source, mixed $type, bool $canBeExtract): void { if (null !== $source) { diff --git a/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php index 1751a69dc..29952aeb8 100644 --- a/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/OpenApi/RootSchemaExtractorTest.php @@ -11,7 +11,7 @@ class RootSchemaExtractorTest extends TestCase { - public function provideTestCanExtract(): array + public static function provideTestCanExtract(): array { return [ [[], new Root(), false], diff --git a/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php index 785572aed..5986cfc13 100644 --- a/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php @@ -22,7 +22,7 @@ protected function setUp(): void $this->phpDocOperationExtractor = new OperationExtractor(); } - public function provideTestCanExtract(): iterable + public static function provideTestCanExtract(): iterable { $reflectionMethod = new \ReflectionMethod(__NAMESPACE__.'\PhpDocOperationExtractorStubService', 'operation'); diff --git a/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php b/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php index 8c89e12dc..06cb596a7 100644 --- a/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php +++ b/packages/open-api/Tests/Extraction/Extractor/TypeSchemaExtractorTest.php @@ -20,7 +20,7 @@ protected function setUp(): void $this->object = new TypeSchemaExtractor(); } - public function provideTestCanExtract(): iterable + public static function provideTestCanExtract(): iterable { yield 'invalid-target' => [ 'string', diff --git a/packages/open-api/Tests/Mock/Controller/TestController.php b/packages/open-api/Tests/Mock/Controller/TestController.php index 34de2bd54..e04ca149d 100644 --- a/packages/open-api/Tests/Mock/Controller/TestController.php +++ b/packages/open-api/Tests/Mock/Controller/TestController.php @@ -5,7 +5,7 @@ use Draw\Component\OpenApi\Request\ValueResolver\RequestBody; use Draw\Component\OpenApi\Schema as OpenApi; use Draw\Component\OpenApi\Serializer\Serialization; -use Draw\Component\OpenApi\Tests\Mock\Model\Test; +use Draw\Component\OpenApi\Tests\Mock\Model\TestClass; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Validator\Constraints as Assert; @@ -14,7 +14,7 @@ class TestController /** * @param string $param1 param1 description * - * @return Test The created test entity + * @return TestClass The created test entity */ #[Route(path: '/tests', methods: ['POST'])] #[OpenApi\Operation(operationId: 'createTest', tags: ['test'])] @@ -34,10 +34,10 @@ class TestController #[OpenApi\Header(name: 'X-Draw', description: 'Description of the header', type: 'string')] public function createAction( #[RequestBody(deserializationGroups: ['Included'])] - Test $test, + TestClass $test, #[OpenApi\QueryParameter] string $param1 = 'default' - ): Test { + ): TestClass { $test->setProperty($param1); return $test; diff --git a/packages/open-api/Tests/Mock/Model/Test.php b/packages/open-api/Tests/Mock/Model/TestClass.php similarity index 98% rename from packages/open-api/Tests/Mock/Model/Test.php rename to packages/open-api/Tests/Mock/Model/TestClass.php index 9555d4bc4..74c6551c5 100644 --- a/packages/open-api/Tests/Mock/Model/Test.php +++ b/packages/open-api/Tests/Mock/Model/TestClass.php @@ -5,7 +5,7 @@ use JMS\Serializer\Annotation as Serializer; use Symfony\Component\Validator\Constraints as Assert; -class Test +class TestClass { /** * Property description. diff --git a/packages/open-api/Tests/Naming/AliasesClassNamingFilterTest.php b/packages/open-api/Tests/Naming/AliasesClassNamingFilterTest.php index 10c86f01d..1bece4c8f 100644 --- a/packages/open-api/Tests/Naming/AliasesClassNamingFilterTest.php +++ b/packages/open-api/Tests/Naming/AliasesClassNamingFilterTest.php @@ -4,11 +4,10 @@ use Draw\Component\OpenApi\Naming\AliasesClassNamingFilter; use Draw\Component\OpenApi\Naming\ClassNamingFilterInterface; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\OpenApi\Naming\AliasesClassNamingFilter - */ +#[CoversClass(AliasesClassNamingFilter::class)] class AliasesClassNamingFilterTest extends TestCase { private AliasesClassNamingFilter $object; diff --git a/packages/open-api/Tests/OpenApiTest.php b/packages/open-api/Tests/OpenApiTest.php index 7ff17ee95..59883017a 100644 --- a/packages/open-api/Tests/OpenApiTest.php +++ b/packages/open-api/Tests/OpenApiTest.php @@ -7,11 +7,11 @@ use Draw\Component\OpenApi\Extraction\ExtractorInterface; use Draw\Component\OpenApi\OpenApi; use Draw\Component\OpenApi\Schema\Root; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\OpenApi\OpenApi - */ +#[CoversClass(OpenApi::class)] class OpenApiTest extends TestCase { private OpenApi $object; @@ -21,16 +21,14 @@ protected function setUp(): void $this->object = new OpenApi(); } - public function provideTestExtractSwaggerSchema(): iterable + public static function provideTestExtractSwaggerSchema(): iterable { foreach (glob(__DIR__.'/fixture/schema/*.json') as $file) { yield basename($file) => [$file]; } } - /** - * @dataProvider provideTestExtractSwaggerSchema - */ + #[DataProvider('provideTestExtractSwaggerSchema')] public function testExtractSwaggerSchema(string $file): void { $schema = $this->object->extract(file_get_contents($file)); diff --git a/packages/open-api/Tests/Request/ParamConverter/DeserializeBodyParamConverterTest.php b/packages/open-api/Tests/Request/ParamConverter/DeserializeBodyParamConverterTest.php index 7d5688846..d44d6377c 100644 --- a/packages/open-api/Tests/Request/ParamConverter/DeserializeBodyParamConverterTest.php +++ b/packages/open-api/Tests/Request/ParamConverter/DeserializeBodyParamConverterTest.php @@ -8,6 +8,8 @@ use JMS\Serializer\Exception\LogicException; use JMS\Serializer\Exception\UnsupportedFormatException; use JMS\Serializer\SerializerInterface; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; @@ -16,17 +18,12 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; -/** - * @covers \Draw\Component\OpenApi\Request\ParamConverter\DeserializeBodyParamConverter - */ +#[CoversClass(DeserializeBodyParamConverter::class)] class DeserializeBodyParamConverterTest extends TestCase { private DeserializeBodyParamConverter $object; - /** - * @var SerializerInterface&MockObject - */ - private SerializerInterface $serializer; + private SerializerInterface&MockObject $serializer; protected function setUp(): void { @@ -169,7 +166,7 @@ public function testApply(): void ); } - public function provideTestApplyAssignPropertiesFromAttribute(): iterable + public static function provideTestApplyAssignPropertiesFromAttribute(): iterable { yield 'simple' => [ ['id' => 'id'], @@ -204,9 +201,7 @@ public function provideTestApplyAssignPropertiesFromAttribute(): iterable ]; } - /** - * @dataProvider provideTestApplyAssignPropertiesFromAttribute - */ + #[DataProvider('provideTestApplyAssignPropertiesFromAttribute')] public function testApplyAssignPropertiesFromAttribute( array $propertiesMap, array $requestAttributes, diff --git a/packages/open-api/Tests/Serializer/SerializationTest.php b/packages/open-api/Tests/Serializer/SerializationTest.php index e7e5b129b..84525aa69 100644 --- a/packages/open-api/Tests/Serializer/SerializationTest.php +++ b/packages/open-api/Tests/Serializer/SerializationTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\OpenApi\Tests\Serializer; use Draw\Component\OpenApi\Serializer\Serialization; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\OpenApi\Serializer\Serialization - */ +#[CoversClass(Serialization::class)] class SerializationTest extends TestCase { private Serialization $object; diff --git a/packages/open-api/Tests/Versioning/RouteDefaultApiRouteVersionMatcherTest.php b/packages/open-api/Tests/Versioning/RouteDefaultApiRouteVersionMatcherTest.php index b803281e5..d724ff7af 100644 --- a/packages/open-api/Tests/Versioning/RouteDefaultApiRouteVersionMatcherTest.php +++ b/packages/open-api/Tests/Versioning/RouteDefaultApiRouteVersionMatcherTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\OpenApi\Tests\Versioning; use Draw\Component\OpenApi\Versioning\RouteDefaultApiRouteVersionMatcher; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Routing\Route; -/** - * @covers \Draw\Component\OpenApi\Versioning\RouteDefaultApiRouteVersionMatcher - */ +#[CoversClass(RouteDefaultApiRouteVersionMatcher::class)] class RouteDefaultApiRouteVersionMatcherTest extends TestCase { public function testMatchVersionTrue(): void diff --git a/packages/open-api/composer.json b/packages/open-api/composer.json index d7a8fcdab..98ffb9e9c 100644 --- a/packages/open-api/composer.json +++ b/packages/open-api/composer.json @@ -18,7 +18,7 @@ "draw/tester": "^0.10", "doctrine/common": "^3.1", "doctrine/orm": "^2.11", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "sensio/framework-extra-bundle": "^5.6 || ^6.2" }, "conflict": { diff --git a/packages/process/composer.json b/packages/process/composer.json index 38325d702..e6cb4a1fb 100644 --- a/packages/process/composer.json +++ b/packages/process/composer.json @@ -15,7 +15,7 @@ "symfony/process": "^5.4.3" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php b/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php index cda486190..87509b79c 100644 --- a/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php +++ b/packages/profiling/Tests/Sql/SqlAssertionBuilderTest.php @@ -17,7 +17,7 @@ protected function setUp(): void $this->assertionBuilder = new SqlAssertionBuilder(); } - public function provideTestAssertCountEquals(): iterable + public static function provideTestAssertCountEquals(): iterable { yield [0, new DataTester((object) ['sql' => new SqlMetric([])]), false]; yield [1, new DataTester((object) ['sql' => new SqlMetric(['query'])]), false]; @@ -34,7 +34,7 @@ public function testProvideAssertCountEquals(int $expectedCount, DataTester $dat $this->invoke($dataTester, $shouldFail); } - public function provideTestAssertCountGreaterThanOrEqual(): \Generator + public static function provideTestAssertCountGreaterThanOrEqual(): \Generator { yield [0, new DataTester((object) ['sql' => new SqlMetric([])]), false]; yield [0, new DataTester((object) ['sql' => new SqlMetric(['query'])]), false]; @@ -51,7 +51,7 @@ public function testAssertCountGreaterThanOrEqual(int $expectedCount, DataTester $this->invoke($dataTester, $shouldFail); } - public function provideTestAssertCountLessThanOrEqual(): \Generator + public static function provideTestAssertCountLessThanOrEqual(): \Generator { yield [1, new DataTester((object) ['sql' => new SqlMetric([])]), false]; yield [0, new DataTester((object) ['sql' => new SqlMetric([])]), false]; diff --git a/packages/profiling/composer.json b/packages/profiling/composer.json index 554610a7a..570392c40 100644 --- a/packages/profiling/composer.json +++ b/packages/profiling/composer.json @@ -11,7 +11,7 @@ ], "require-dev": { "draw/tester": "^0.10", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^9.0 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/packages/security/Tests/Core/Event/CheckPostAuthEventTest.php b/packages/security/Tests/Core/Event/CheckPostAuthEventTest.php index b504c0fb7..a886c0e06 100644 --- a/packages/security/Tests/Core/Event/CheckPostAuthEventTest.php +++ b/packages/security/Tests/Core/Event/CheckPostAuthEventTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Security\Tests\Core\Event; use Draw\Component\Security\Core\Event\CheckPostAuthEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Core\User\UserInterface; -/** - * @covers \Draw\Component\Security\Core\Event\CheckPostAuthEvent - */ +#[CoversClass(CheckPostAuthEvent::class)] class CheckPostAuthEventTest extends TestCase { private CheckPostAuthEvent $event; diff --git a/packages/security/Tests/Core/Event/CheckPreAuthEventTest.php b/packages/security/Tests/Core/Event/CheckPreAuthEventTest.php index fde63693c..576d5d0ba 100644 --- a/packages/security/Tests/Core/Event/CheckPreAuthEventTest.php +++ b/packages/security/Tests/Core/Event/CheckPreAuthEventTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Security\Tests\Core\Event; use Draw\Component\Security\Core\Event\CheckPreAuthEvent; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Core\User\UserInterface; -/** - * @covers \Draw\Component\Security\Core\Event\CheckPreAuthEvent - */ +#[CoversClass(CheckPreAuthEvent::class)] class CheckPreAuthEventTest extends TestCase { private CheckPreAuthEvent $event; diff --git a/packages/security/Tests/Core/User/EventDrivenUserCheckerTest.php b/packages/security/Tests/Core/User/EventDrivenUserCheckerTest.php index b29afbf63..9757b5a9f 100644 --- a/packages/security/Tests/Core/User/EventDrivenUserCheckerTest.php +++ b/packages/security/Tests/Core/User/EventDrivenUserCheckerTest.php @@ -5,28 +5,21 @@ use Draw\Component\Security\Core\Event\CheckPostAuthEvent; use Draw\Component\Security\Core\Event\CheckPreAuthEvent; use Draw\Component\Security\Core\User\EventDrivenUserChecker; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -/** - * @covers \Draw\Component\Security\Core\User\EventDrivenUserChecker - */ +#[CoversClass(EventDrivenUserChecker::class)] class EventDrivenUserCheckerTest extends TestCase { private EventDrivenUserChecker $object; - /** - * @var UserCheckerInterface&MockObject - */ - private UserCheckerInterface $decoratedUserChecker; + private UserCheckerInterface&MockObject $decoratedUserChecker; - /** - * @var EventDispatcherInterface&MockObject - */ - private EventDispatcherInterface $eventDispatcher; + private EventDispatcherInterface&MockObject $eventDispatcher; protected function setUp(): void { diff --git a/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php b/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php index c7eec45cb..028c05edb 100644 --- a/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php +++ b/packages/security/Tests/Http/Authenticator/JwtAuthenticatorTest.php @@ -7,6 +7,7 @@ use Draw\Component\Security\Http\Authenticator\Passport\Badge\JwtPayloadBadge; use Draw\Component\Security\Jwt\JwtEncoder; use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; @@ -25,33 +26,22 @@ use Symfony\Component\Security\Http\Authenticator\Token\PostAuthenticationToken; use Symfony\Contracts\Translation\TranslatorInterface; -/** - * @covers \Draw\Component\Security\Http\Authenticator\JwtAuthenticator - */ +#[CoversClass(JwtAuthenticator::class)] class JwtAuthenticatorTest extends TestCase { use MockTrait; private JwtAuthenticator $object; - /** - * @var JwtEncoder&MockObject - */ - private JwtEncoder $jwtEncoder; + private JwtEncoder&MockObject $jwtEncoder; - /** - * @var UserProviderInterface&MockObject - */ - private UserProviderInterface $userProvider; + private UserProviderInterface&MockObject $userProvider; private string $userIdentifierPayloadKey; private string $userIdentifierGetter; - /** - * @var TranslatorInterface&MockObject - */ - private TranslatorInterface $translator; + private TranslatorInterface&MockObject $translator; protected function setUp(): void { @@ -385,7 +375,6 @@ public function testOnAuthenticationFailure(): void $messageData ) ); - static::fail('Expected Exception'); } catch (HttpException $error) { static::assertSame( Response::HTTP_FORBIDDEN, @@ -424,7 +413,6 @@ public function testOnAuthenticationFailureNoTranslator(): void $messageData ) ); - static::fail('Expected Exception'); } catch (HttpException $error) { static::assertSame( Response::HTTP_FORBIDDEN, diff --git a/packages/security/Tests/Http/Authenticator/MessageAuthenticatorTest.php b/packages/security/Tests/Http/Authenticator/MessageAuthenticatorTest.php index 465945ec8..dfea8d63b 100644 --- a/packages/security/Tests/Http/Authenticator/MessageAuthenticatorTest.php +++ b/packages/security/Tests/Http/Authenticator/MessageAuthenticatorTest.php @@ -7,6 +7,7 @@ use Draw\Component\Security\Http\Message\AutoConnectInterface; use Draw\Component\Tester\MockTrait; use Draw\Contracts\Messenger\Exception\MessageNotFoundException; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; @@ -23,29 +24,18 @@ use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; use Symfony\Component\Security\Http\Authenticator\Token\PostAuthenticationToken; -/** - * @covers \Draw\Component\Security\Http\Authenticator\MessageAuthenticator - */ +#[CoversClass(MessageAuthenticator::class)] class MessageAuthenticatorTest extends TestCase { use MockTrait; private MessageAuthenticator $service; - /** - * @var EnvelopeFinder&MockObject - */ - private EnvelopeFinder $envelopeFinder; + private EnvelopeFinder&MockObject $envelopeFinder; - /** - * @var UserProviderInterface&MockObject - */ - private UserProviderInterface $userProvider; + private UserProviderInterface&MockObject $userProvider; - /** - * @var Security&MockObject - */ - private Security $security; + private Security&MockObject $security; protected function setUp(): void { @@ -249,7 +239,7 @@ public function testOnAuthenticationFailure(): void } /** - * This is form the parent abstract class but we test it as part of a contract test. + * This is form the parent abstract class, but we test it as part of a contract test. * * @see AbstractAuthenticator */ diff --git a/packages/security/Tests/Http/Authenticator/Passport/Badge/JwtPayloadBadgeTest.php b/packages/security/Tests/Http/Authenticator/Passport/Badge/JwtPayloadBadgeTest.php index fcd556042..44aae8a15 100644 --- a/packages/security/Tests/Http/Authenticator/Passport/Badge/JwtPayloadBadgeTest.php +++ b/packages/security/Tests/Http/Authenticator/Passport/Badge/JwtPayloadBadgeTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Security\Tests\Http\Authenticator\Passport\Badge; use Draw\Component\Security\Http\Authenticator\Passport\Badge\JwtPayloadBadge; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Security\Http\Authenticator\Passport\Badge\JwtPayloadBadge - */ +#[CoversClass(JwtPayloadBadge::class)] class JwtPayloadBadgeTest extends TestCase { private JwtPayloadBadge $entity; diff --git a/packages/security/Tests/Http/Authenticator/Passport/Badge/RoleRestrictedBadgeTest.php b/packages/security/Tests/Http/Authenticator/Passport/Badge/RoleRestrictedBadgeTest.php index ffef849ed..356495372 100644 --- a/packages/security/Tests/Http/Authenticator/Passport/Badge/RoleRestrictedBadgeTest.php +++ b/packages/security/Tests/Http/Authenticator/Passport/Badge/RoleRestrictedBadgeTest.php @@ -3,11 +3,10 @@ namespace Draw\Component\Security\Tests\Http\Authenticator\Passport\Badge; use Draw\Component\Security\Http\Authenticator\Passport\Badge\RoleRestrictedBadge; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Security\Http\Authenticator\Passport\Badge\RoleRestrictedBadge - */ +#[CoversClass(RoleRestrictedBadge::class)] class RoleRestrictedBadgeTest extends TestCase { private RoleRestrictedBadge $entity; diff --git a/packages/security/Tests/Http/EventListener/RoleRestrictedAuthenticatorListenerTest.php b/packages/security/Tests/Http/EventListener/RoleRestrictedAuthenticatorListenerTest.php index e532be6b7..02c361ba2 100644 --- a/packages/security/Tests/Http/EventListener/RoleRestrictedAuthenticatorListenerTest.php +++ b/packages/security/Tests/Http/EventListener/RoleRestrictedAuthenticatorListenerTest.php @@ -4,6 +4,7 @@ use Draw\Component\Security\Http\Authenticator\Passport\Badge\RoleRestrictedBadge; use Draw\Component\Security\Http\EventListener\RoleRestrictedAuthenticatorListener; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -15,22 +16,14 @@ use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport; use Symfony\Component\Security\Http\Event\CheckPassportEvent; -/** - * @covers \Draw\Component\Security\Http\EventListener\RoleRestrictedAuthenticatorListener - */ +#[CoversClass(RoleRestrictedAuthenticatorListener::class)] class RoleRestrictedAuthenticatorListenerTest extends TestCase { private RoleRestrictedAuthenticatorListener $service; - /** - * @var RoleHierarchyInterface&MockObject - */ - private RoleHierarchyInterface $roleHierarchy; + private RoleHierarchyInterface&MockObject $roleHierarchy; - /** - * @var UserInterface&MockObject - */ - private UserInterface $user; + private UserInterface&MockObject $user; protected function setUp(): void { diff --git a/packages/security/Tests/Jwt/JwtEncoderTest.php b/packages/security/Tests/Jwt/JwtEncoderTest.php index 64c35556c..9bfec2e06 100644 --- a/packages/security/Tests/Jwt/JwtEncoderTest.php +++ b/packages/security/Tests/Jwt/JwtEncoderTest.php @@ -5,11 +5,10 @@ use Draw\Component\Security\Jwt\JwtEncoder; use Firebase\JWT\ExpiredException; use Firebase\JWT\SignatureInvalidException; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Security\Jwt\JwtEncoder - */ +#[CoversClass(JwtEncoder::class)] class JwtEncoderTest extends TestCase { private JwtEncoder $service; diff --git a/packages/security/composer.json b/packages/security/composer.json index 39ea24fab..419d4394a 100644 --- a/packages/security/composer.json +++ b/packages/security/composer.json @@ -19,7 +19,7 @@ "draw/messenger": "^0.10", "draw/tester": "^0.10", "firebase/php-jwt": "^6.1", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "symfony/console": "^5.4.3", "symfony/messenger": "^5.4.3", "symfony/security-http": "^5.4.3", diff --git a/packages/sonata-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php b/packages/sonata-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php index 9691f3f1f..d14298b72 100644 --- a/packages/sonata-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/packages/sonata-extra-bundle/Tests/DependencyInjection/ConfigurationTest.php @@ -56,7 +56,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestInvalidConfiguration(): iterable + public static function provideTestInvalidConfiguration(): iterable { yield [ ['fix_menu_depth' => ['enabled' => []]], diff --git a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoActionEnabledTest.php b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoActionEnabledTest.php index ee7230f94..9e4a3a0c5 100644 --- a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoActionEnabledTest.php +++ b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoActionEnabledTest.php @@ -22,7 +22,7 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [AutoActionExtension::class]; diff --git a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoHelpEnabledTest.php b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoHelpEnabledTest.php index a24779a6d..2e71de8aa 100644 --- a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoHelpEnabledTest.php +++ b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionAutoHelpEnabledTest.php @@ -22,7 +22,7 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [AutoHelpListener::class]; diff --git a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionCanSecurityHandlerEnabledTest.php b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionCanSecurityHandlerEnabledTest.php index 1a6a57258..07935bc49 100644 --- a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionCanSecurityHandlerEnabledTest.php +++ b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionCanSecurityHandlerEnabledTest.php @@ -28,7 +28,7 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [CanSecurityHandler::class]; diff --git a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionFixMenuDeptEnabledTest.php b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionFixMenuDeptEnabledTest.php index e97150777..4d8434f49 100644 --- a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionFixMenuDeptEnabledTest.php +++ b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionFixMenuDeptEnabledTest.php @@ -22,7 +22,7 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [FixDepthMenuBuilderListener::class]; diff --git a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionSessionTimeoutEnabledTest.php b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionSessionTimeoutEnabledTest.php index 1524e9596..e7f6163e3 100644 --- a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionSessionTimeoutEnabledTest.php +++ b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionSessionTimeoutEnabledTest.php @@ -23,7 +23,7 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [SessionTimeoutRequestListener::class]; diff --git a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionTest.php b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionTest.php index b43e7ea94..4cbcd7634 100644 --- a/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionTest.php +++ b/packages/sonata-extra-bundle/Tests/DependencyInjection/DrawSonataExtraExtensionTest.php @@ -38,7 +38,7 @@ public function getConfiguration(): array return []; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield [AdminValueResolver::class]; yield [MonitoringBlockService::class]; diff --git a/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php b/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php index e0a3cb2a2..fe726018b 100644 --- a/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php +++ b/packages/sonata-extra-bundle/Tests/EventListener/SessionTimeoutRequestListenerTest.php @@ -3,6 +3,10 @@ namespace Draw\Bundle\SonataExtraBundle\Tests\EventListener; use Draw\Bundle\SonataExtraBundle\EventListener\SessionTimeoutRequestListener; +use Draw\Component\Tester\MockTrait; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -19,22 +23,16 @@ use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\User\UserInterface; -/** - * @covers \Draw\Bundle\SonataExtraBundle\EventListener\SessionTimeoutRequestListener - */ +#[CoversClass(SessionTimeoutRequestListener::class)] class SessionTimeoutRequestListenerTest extends TestCase { + use MockTrait; + private SessionTimeoutRequestListener $object; - /** - * @var MockObject|UrlGeneratorInterface - */ - private UrlGeneratorInterface $urlGenerator; + private MockObject&UrlGeneratorInterface $urlGenerator; - /** - * @var MockObject|Security - */ - private Security $security; + private MockObject&Security $security; protected function setUp(): void { @@ -89,63 +87,67 @@ public function testOnKernelRequestInvalidate(): void $this->object->onKernelRequestInvalidate($requestEvent); } - public function provideTestOnKernelRequestInvalidateNotInvalidate(): iterable + public static function provideTestOnKernelRequestInvalidateNotInvalidate(): iterable { - $request = $this->createMock(Request::class); - - $request - ->expects(static::any()) - ->method('hasSession') - ->willReturn(true); - - $request - ->expects(static::never()) - ->method('getSession'); + $request = new class() extends Request { + public function hasSession($skipIfUninitialized = false): bool + { + return true; + } + + public function getSession(): SessionInterface + { + throw new \RuntimeException('Should not be called'); + } + }; yield 'sub-request' => [ $request, HttpKernelInterface::SUB_REQUEST, ]; - $session = $this->createMock(SessionInterface::class); - - $session - ->expects(static::once()) - ->method('get') - ->with('draw_sonata_integration_last_used') - ->willReturn(time() - 60); - - $session - ->expects(static::never()) - ->method('invalidate'); - - $request = $this->createMock(Request::class); - - $request - ->expects(static::once()) - ->method('hasSession') - ->willReturn(true); - - $request - ->expects(static::once()) - ->method('getSession') - ->willReturn($session); + $request = new class() extends Request { + public function hasSession($skipIfUninitialized = false): bool + { + return true; + } + + public function getSession(): SessionInterface + { + return new class() extends Session { + public function get($name, $default = null): mixed + { + if ('draw_sonata_integration_last_used' === $name) { + return time() - 60; + } + + throw new \RuntimeException('Should not be called'); + } + + public function invalidate(?int $lifetime = null): bool + { + throw new \RuntimeException('Should not be called'); + } + }; + } + }; yield 'no-expired' => [ $request, HttpKernelInterface::MAIN_REQUEST, ]; - $request = $this->createMock(Request::class); + $request = new class() extends Request { + public function hasSession($skipIfUninitialized = false): bool + { + return false; + } - $request - ->expects(static::once()) - ->method('hasSession') - ->willReturn(false); - - $request - ->expects(static::never()) - ->method('getSession'); + public function getSession(): SessionInterface + { + throw new \RuntimeException('Should not be called'); + } + }; yield 'no-session' => [ $request, @@ -153,9 +155,8 @@ public function provideTestOnKernelRequestInvalidateNotInvalidate(): iterable ]; } - /** - * @dataProvider provideTestOnKernelRequestInvalidateNotInvalidate - */ + #[DoesNotPerformAssertions] + #[DataProvider('provideTestOnKernelRequestInvalidateNotInvalidate')] public function testOnKernelRequestInvalidateNotInvalidate(Request $request, int $requestType): void { $requestEvent = new RequestEvent( @@ -187,43 +188,44 @@ public function testOnKernelResponseSetLastUsed(): void ); } - public function provideTestOnKernelResponseSetLastUsedNoSet(): iterable + public static function provideTestOnKernelResponseSetLastUsedNoSet(): iterable { - $request = $this->createMock(Request::class); - - $request - ->expects(static::any()) - ->method('hasSession') - ->willReturn(true); - - $request - ->expects(static::never()) - ->method('getSession'); + $request = new class() extends Request { + public function hasSession($skipIfUninitialized = false): bool + { + return true; + } + + public function getSession(): SessionInterface + { + throw new \RuntimeException('Should not be called'); + } + }; yield 'sub-request' => [ $request, HttpKernelInterface::SUB_REQUEST, ]; - $request = $this->createMock(Request::class); - - $request - ->expects(static::once()) - ->method('hasSession') - ->willReturn(false); + $request = new class() extends Request { + public function hasSession($skipIfUninitialized = false): bool + { + return false; + } - $request - ->expects(static::never()) - ->method('getSession'); + public function getSession(): SessionInterface + { + throw new \RuntimeException('Should not be called'); + } + }; yield 'no-session' => [ $request, ]; } - /** - * @dataProvider provideTestOnKernelResponseSetLastUsedNoSet - */ + #[DoesNotPerformAssertions] + #[DataProvider('provideTestOnKernelResponseSetLastUsedNoSet')] public function testOnKernelResponseSetLastUsedNoSet( Request $request, int $requestType = HttpKernelInterface::MAIN_REQUEST @@ -257,9 +259,11 @@ public function testOnKernelResponseAddDialog(): void $this->urlGenerator->expects(static::exactly(2)) ->method('generate') - ->withConsecutive( - ['keep_alive'], - ['admin_login'] + ->with( + ...static::withConsecutive( + ['keep_alive'], + ['admin_login'] + ) ) ->willReturnOnConsecutiveCalls( '/admin/keep-alive', @@ -279,13 +283,42 @@ public function testOnKernelResponseAddDialog(): void ); } - public function provideTestOnKernelResponseAddDialogNoInjection(): iterable + public static function provideTestOnKernelResponseAddDialogNoInjection(): iterable { $response = new Response(); $response->headers->set('Content-Type', 'text/html'); $response->setContent('value'); - $user = $this->createMock(UserInterface::class); + $user = new class() implements UserInterface { + public function getRoles(): array + { + return []; + } + + public function getPassword(): ?string + { + return null; + } + + public function getSalt(): ?string + { + return null; + } + + public function eraseCredentials(): void + { + } + + public function getUsername(): ?string + { + return null; + } + + public function getUserIdentifier(): string + { + return ''; + } + }; yield 'no-user' => [ $response, diff --git a/packages/sonata-extra-bundle/composer.json b/packages/sonata-extra-bundle/composer.json index 8ae275245..7c9a4a5c9 100644 --- a/packages/sonata-extra-bundle/composer.json +++ b/packages/sonata-extra-bundle/composer.json @@ -11,7 +11,7 @@ }, "require-dev": { "draw/tester": "^0.10", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "sonata-project/admin-bundle": "^4.8", "sonata-project/doctrine-orm-admin-bundle": "^4.2" }, diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/ConfigurationTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/ConfigurationTest.php index 67820d86f..c97721e09 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/ConfigurationTest.php @@ -103,7 +103,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestInvalidConfiguration(): iterable + public static function provideTestInvalidConfiguration(): iterable { yield [ ['messenger' => ['queue_names' => 'test']], diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConfigurationEnabledTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConfigurationEnabledTest.php index a1b43c259..c287bc725 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConfigurationEnabledTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConfigurationEnabledTest.php @@ -3,10 +3,10 @@ namespace Draw\Bundle\SonataIntegrationBundle\Tests\DependencyInjection; use Draw\Bundle\SonataIntegrationBundle\Configuration\Admin\ConfigAdmin; +use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionConfigurationEnabledTest extends DrawSonataIntegrationExtensionTest { public function getConfiguration(): array @@ -20,7 +20,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield [ConfigAdmin::class]; } diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConsoleEnabledTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConsoleEnabledTest.php index 09dde3ef4..ea5c3f074 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConsoleEnabledTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionConsoleEnabledTest.php @@ -5,10 +5,10 @@ use Draw\Bundle\SonataIntegrationBundle\Console\Admin\ExecutionAdmin; use Draw\Bundle\SonataIntegrationBundle\Console\CommandRegistry; use Draw\Bundle\SonataIntegrationBundle\Console\Controller\ExecutionController; +use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionConsoleEnabledTest extends DrawSonataIntegrationExtensionTest { public function getConfiguration(): array @@ -22,7 +22,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield [ExecutionAdmin::class]; yield [CommandRegistry::class]; diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionMessengerEnabledTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionMessengerEnabledTest.php index 59a345618..fbf80c056 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionMessengerEnabledTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionMessengerEnabledTest.php @@ -2,16 +2,16 @@ namespace Draw\Bundle\SonataIntegrationBundle\Tests\DependencyInjection; +use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; use Draw\Bundle\SonataIntegrationBundle\Messenger\Admin\MessengerMessageAdmin; use Draw\Bundle\SonataIntegrationBundle\Messenger\EventListener\FinalizeContextQueueCountEventListener; use Draw\Bundle\SonataIntegrationBundle\Messenger\Security\CanShowMessageVoter; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionMessengerEnabledTest extends DrawSonataIntegrationExtensionTest { - private array $queueNames; + private static array $queueNames; public function getConfiguration(): array { @@ -19,13 +19,13 @@ public function getConfiguration(): array $configuration['messenger'] = [ 'enabled' => true, - 'queue_names' => $this->queueNames = [uniqid('queue-name-')], + 'queue_names' => self::$queueNames = [uniqid('queue-name-')], ]; return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield [MessengerMessageAdmin::class]; yield [FinalizeContextQueueCountEventListener::class]; @@ -44,7 +44,7 @@ public function testMessengerMessageAdminDefinition(): void $bindings = $definition->getBindings(); static::assertSame( - $this->queueNames, + self::$queueNames, $bindings['$queueNames']->getValues()[0] ); } diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionTest.php index 0ce7f5bb3..ddbd94f32 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionTest.php @@ -4,11 +4,10 @@ use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; use Draw\Component\Tester\DependencyInjection\ExtensionTestCase; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Extension\Extension; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionTest extends ExtensionTestCase { public function createExtension(): Extension @@ -34,8 +33,8 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { - return []; + yield [null]; } } diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledEmailEnabledTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledEmailEnabledTest.php index 4c8ae2660..c29d0ffba 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledEmailEnabledTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledEmailEnabledTest.php @@ -2,9 +2,10 @@ namespace Draw\Bundle\SonataIntegrationBundle\Tests\DependencyInjection; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; +use PHPUnit\Framework\Attributes\CoversClass; + +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionUser2faEnabledEmailEnabledTest extends DrawSonataIntegrationExtensionUser2faEnabledTest { public function getConfiguration(): array @@ -18,7 +19,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledTest.php index bf9274419..d5f88a6d4 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUser2faEnabledTest.php @@ -2,15 +2,15 @@ namespace Draw\Bundle\SonataIntegrationBundle\Tests\DependencyInjection; +use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; use Draw\Bundle\SonataIntegrationBundle\User\Controller\TwoFactorAuthenticationController; use Draw\Bundle\SonataIntegrationBundle\User\Extension\TwoFactorAuthenticationExtension; use Draw\Bundle\UserBundle\Tests\Fixtures\Entity\User; +use PHPUnit\Framework\Attributes\CoversClass; use Scheb\TwoFactorBundle\SchebTwoFactorBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionUser2faEnabledTest extends DrawSonataIntegrationExtensionUserEnabledTest { public function getConfiguration(): array @@ -24,7 +24,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserEnabledTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserEnabledTest.php index c173d4784..7d87d4e1d 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserEnabledTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserEnabledTest.php @@ -2,15 +2,15 @@ namespace Draw\Bundle\SonataIntegrationBundle\Tests\DependencyInjection; +use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; use Draw\Bundle\SonataIntegrationBundle\User\Admin\Extension\PasswordChangeEnforcerExtension; use Draw\Bundle\SonataIntegrationBundle\User\Block\UserCountBlock; use Draw\Bundle\SonataIntegrationBundle\User\Controller\LoginController; use Draw\Bundle\SonataIntegrationBundle\User\Twig\UserAdminExtension; use Draw\Bundle\SonataIntegrationBundle\User\Twig\UserAdminRuntime; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionUserEnabledTest extends DrawSonataIntegrationExtensionTest { public function getConfiguration(): array @@ -27,7 +27,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield [LoginController::class]; yield [UserCountBlock::class]; diff --git a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserLockEnabledTest.php b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserLockEnabledTest.php index d5372d16e..598766eaf 100644 --- a/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserLockEnabledTest.php +++ b/packages/sonata-integration-bundle/Tests/DependencyInjection/DrawSonataIntegrationExtensionUserLockEnabledTest.php @@ -3,14 +3,14 @@ namespace Draw\Bundle\SonataIntegrationBundle\Tests\DependencyInjection; use App\Sonata\Admin\UserAdmin; +use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; use Draw\Bundle\SonataIntegrationBundle\User\Admin\Extension\RefreshUserLockExtension; use Draw\Bundle\SonataIntegrationBundle\User\Admin\Extension\UnlockUserLockExtension; use Draw\Bundle\SonataIntegrationBundle\User\Admin\UserLockAdmin; use Draw\Bundle\SonataIntegrationBundle\User\Controller\RefreshUserLockController; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension - */ +#[CoversClass(DrawSonataIntegrationExtension::class)] class DrawSonataIntegrationExtensionUserLockEnabledTest extends DrawSonataIntegrationExtensionUserEnabledTest { public function getConfiguration(): array @@ -24,7 +24,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [UserLockAdmin::class]; diff --git a/packages/sonata-integration-bundle/Tests/User/Action/TwoFactorAuthenticationResendCodeActionTest.php b/packages/sonata-integration-bundle/Tests/User/Action/TwoFactorAuthenticationResendCodeActionTest.php index 9cb140ca5..0f2b43514 100644 --- a/packages/sonata-integration-bundle/Tests/User/Action/TwoFactorAuthenticationResendCodeActionTest.php +++ b/packages/sonata-integration-bundle/Tests/User/Action/TwoFactorAuthenticationResendCodeActionTest.php @@ -3,6 +3,7 @@ namespace Draw\Bundle\SonataIntegrationBundle\Tests\User\Action; use Draw\Bundle\SonataIntegrationBundle\User\Action\TwoFactorAuthenticationResendCodeAction; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; @@ -12,22 +13,14 @@ use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\User\UserInterface; -/** - * @covers \Draw\Bundle\SonataIntegrationBundle\User\Action\TwoFactorAuthenticationResendCodeAction - */ +#[CoversClass(TwoFactorAuthenticationResendCodeAction::class)] class TwoFactorAuthenticationResendCodeActionTest extends TestCase { private TwoFactorAuthenticationResendCodeAction $object; - /** - * @var CodeGeneratorInterface&MockObject - */ - private CodeGeneratorInterface $codeGenerator; + private CodeGeneratorInterface&MockObject $codeGenerator; - /** - * @var UrlGeneratorInterface&MockObject - */ - private UrlGeneratorInterface $urlGenerator; + private UrlGeneratorInterface&MockObject $urlGenerator; protected function setUp(): void { diff --git a/packages/sonata-integration-bundle/composer.json b/packages/sonata-integration-bundle/composer.json index b2c97b1ef..e889c566c 100644 --- a/packages/sonata-integration-bundle/composer.json +++ b/packages/sonata-integration-bundle/composer.json @@ -20,7 +20,7 @@ "draw/tester": "^0.10", "draw/user-bundle": "^0.10", "firebase/php-jwt": "^6.1", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "scheb/2fa-bundle": "^5.12", "scheb/2fa-email": "^5.12", "scheb/2fa-qr-code": "^5.12", diff --git a/packages/tester-bundle/Tests/DependencyInjection/Compiler/MessengerPassTest.php b/packages/tester-bundle/Tests/DependencyInjection/Compiler/MessengerPassTest.php index fed713177..43dce1145 100644 --- a/packages/tester-bundle/Tests/DependencyInjection/Compiler/MessengerPassTest.php +++ b/packages/tester-bundle/Tests/DependencyInjection/Compiler/MessengerPassTest.php @@ -4,13 +4,12 @@ use Draw\Bundle\TesterBundle\DependencyInjection\Compiler\MessengerPass; use Draw\Bundle\TesterBundle\Messenger\HandleMessagesMappingProvider; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; -/** - * @covers \Draw\Bundle\TesterBundle\DependencyInjection\Compiler\MessengerPass - */ +#[CoversClass(MessengerPass::class)] class MessengerPassTest extends TestCase { private MessengerPass $compilerPass; diff --git a/packages/tester-bundle/Tests/DependencyInjection/ConfigurationTest.php b/packages/tester-bundle/Tests/DependencyInjection/ConfigurationTest.php index 272c9e98d..47ab91400 100644 --- a/packages/tester-bundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/packages/tester-bundle/Tests/DependencyInjection/ConfigurationTest.php @@ -18,8 +18,11 @@ public function getDefaultConfiguration(): array return ['profiling' => ['enabled' => true]]; } - public function provideTestInvalidConfiguration(): iterable + public static function provideTestInvalidConfiguration(): iterable { - return []; + yield [ + ['invalid' => true], + 'Unrecognized option invalid under draw_tester. Available option is profiling.', + ]; } } diff --git a/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionTest.php b/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionTest.php index 323c35861..cf7004de5 100644 --- a/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionTest.php +++ b/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionTest.php @@ -24,7 +24,7 @@ public function getConfiguration(): array return []; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield [SqlProfiler::class]; yield [\Draw\Component\Profiling\Sql\SqlProfiler::class, SqlProfiler::class]; diff --git a/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionWithoutProfilingTest.php b/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionWithoutProfilingTest.php index 5f95993a5..269c1f4cb 100644 --- a/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionWithoutProfilingTest.php +++ b/packages/tester-bundle/Tests/DependencyInjection/DrawTesterExtensionWithoutProfilingTest.php @@ -12,9 +12,9 @@ public function getConfiguration(): array return ['profiling' => ['enabled' => false]]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { - yield from $this->removeProvidedService( + yield from static::removeProvidedService( [ SqlProfiler::class, \Draw\Component\Profiling\Sql\SqlProfiler::class, diff --git a/packages/tester-bundle/composer.json b/packages/tester-bundle/composer.json index 8044883ec..8a855bca5 100644 --- a/packages/tester-bundle/composer.json +++ b/packages/tester-bundle/composer.json @@ -14,7 +14,7 @@ }, "require-dev": { "draw/profiling": "^0.10", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "symfony/messenger": "^5.4.3", "symfony/yaml": "^5.4.3" }, diff --git a/packages/tester/Application/CommandTestTrait.php b/packages/tester/Application/CommandTestTrait.php index dc7811c81..aa060f42f 100644 --- a/packages/tester/Application/CommandTestTrait.php +++ b/packages/tester/Application/CommandTestTrait.php @@ -22,9 +22,9 @@ abstract public function createCommand(): Command; abstract public function getCommandName(): string; - abstract public function provideTestArgument(): iterable; + abstract public static function provideTestArgument(): iterable; - abstract public function provideTestOption(): iterable; + abstract public static function provideTestOption(): iterable; public static function setUpBeforeClass(): void { diff --git a/packages/tester/DependencyInjection/ConfigurationTestCase.php b/packages/tester/DependencyInjection/ConfigurationTestCase.php index 6ff41446e..6676cc57b 100644 --- a/packages/tester/DependencyInjection/ConfigurationTestCase.php +++ b/packages/tester/DependencyInjection/ConfigurationTestCase.php @@ -15,7 +15,7 @@ abstract public function createConfiguration(): ConfigurationInterface; abstract public function getDefaultConfiguration(): array; - abstract public function provideTestInvalidConfiguration(): iterable; + abstract public static function provideTestInvalidConfiguration(): iterable; protected function setUp(): void { diff --git a/packages/tester/DependencyInjection/ExtensionTestCase.php b/packages/tester/DependencyInjection/ExtensionTestCase.php index 8da9d3b76..a00d945e6 100644 --- a/packages/tester/DependencyInjection/ExtensionTestCase.php +++ b/packages/tester/DependencyInjection/ExtensionTestCase.php @@ -22,9 +22,9 @@ abstract public function createExtension(): Extension; */ abstract public function getConfiguration(): array; - abstract public function provideTestHasServiceDefinition(): iterable; + abstract public static function provideTestHasServiceDefinition(): iterable; - protected function removeProvidedService(array $idsToRemove, iterable $providedServices): iterable + protected static function removeProvidedService(array $idsToRemove, iterable $providedServices): iterable { foreach ($providedServices as $providedService) { if (!\in_array($providedService[0], $idsToRemove)) { @@ -53,7 +53,16 @@ public static function setUpBeforeClass(): void * * @param ?string $aliasOf If the id is a alias it's a alias of which service ? */ - public function testHasServiceDefinition(string $id, ?string $aliasOf = null): void + public function testServiceDefinition(?string $id, ?string $aliasOf = null): void + { + if (!$id) { + static::markTestSkipped('No service to test'); + } + + $this->assertServiceDefinition($id, $aliasOf); + } + + private function assertServiceDefinition(string $id, ?string $aliasOf = null): void { if ($aliasOf) { self::$aliases[] = $id; diff --git a/packages/tester/Http/Client.php b/packages/tester/Http/Client.php index 3465a321f..5952e96a0 100644 --- a/packages/tester/Http/Client.php +++ b/packages/tester/Http/Client.php @@ -13,7 +13,7 @@ class Client implements ClientInterface private RequestExecutionerInterface $requestExecutioner; /** - * @var array> + * @var array> */ private array $clientObservers = []; @@ -36,7 +36,7 @@ public function setRequestExecutioner(RequestExecutionerInterface $requestExecut $this->requestExecutioner = $requestExecutioner; } - public function registerObserver(ClientObserver $clientObserver, int $position = 0): void + public function registerObserver(ClientObserverInterface $clientObserver, int $position = 0): void { $this->clientObservers[$position][] = $clientObserver; } diff --git a/packages/tester/Http/ClientInterface.php b/packages/tester/Http/ClientInterface.php index b52c60029..3cff63ec6 100644 --- a/packages/tester/Http/ClientInterface.php +++ b/packages/tester/Http/ClientInterface.php @@ -12,11 +12,11 @@ public function getRequestExecutioner(): RequestExecutionerInterface; public function setRequestExecutioner(RequestExecutionerInterface $requestExecutioner); /** - * Register a observer that can be hooked in different step of the request flow. + * Register an observer that can be hooked in different step of the request flow. * * @param int $position The position in which the observer must be registered. Lower number are executed first */ - public function registerObserver(ClientObserver $clientObserver, int $position = 0): void; + public function registerObserver(ClientObserverInterface $clientObserver, int $position = 0): void; /** * This is a shortcut method that chain the ClientInterface::createRequest and the ClientInterface::send execution diff --git a/packages/tester/Http/ClientObserver.php b/packages/tester/Http/ClientObserver.php index 930a5971f..6448a6811 100644 --- a/packages/tester/Http/ClientObserver.php +++ b/packages/tester/Http/ClientObserver.php @@ -5,7 +5,7 @@ use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -abstract class ClientObserver +abstract class ClientObserver implements ClientObserverInterface { public function preSendRequest(RequestInterface $request): RequestInterface { diff --git a/packages/tester/Http/ClientObserverInterface.php b/packages/tester/Http/ClientObserverInterface.php new file mode 100644 index 000000000..6611444ee --- /dev/null +++ b/packages/tester/Http/ClientObserverInterface.php @@ -0,0 +1,27 @@ +registerSubscribers( + new class() implements TestFinishedSubscriber { + public function notify(TestFinished $event): void + { + Carbon::setTestNow(null); + } + }, + new class() implements TestSuiteFinishedSubscriber { + public function notify(TestSuiteFinished $event): void + { + Carbon::setTestNow(null); + } + } + ); + } +} diff --git a/packages/tester/PHPUnit/TestListener/CarbonResetTestListener.php b/packages/tester/PHPUnit/TestListener/CarbonResetTestListener.php deleted file mode 100644 index 6e13637bf..000000000 --- a/packages/tester/PHPUnit/TestListener/CarbonResetTestListener.php +++ /dev/null @@ -1,27 +0,0 @@ -getMockBuilder(ClientObserver::class) - ->setMethodsExcept([]) - ->getMockForAbstractClass(); + $mockClientObserver = $this->createMock(ClientObserverInterface::class); $mockClientObserver ->expects(static::once()) diff --git a/packages/tester/Tests/Http/Cookie/CookieJarTest.php b/packages/tester/Tests/Http/Cookie/CookieJarTest.php index 2ef9477bb..445e74eeb 100644 --- a/packages/tester/Tests/Http/Cookie/CookieJarTest.php +++ b/packages/tester/Tests/Http/Cookie/CookieJarTest.php @@ -227,7 +227,7 @@ public function testAddsCookiesFromResponseWithRequest(): void static::assertCount(1, $this->jar); } - public function provideTestReturnsCookiesMatchingRequests(): array + public static function provideTestReturnsCookiesMatchingRequests(): array { return [ ['https://example.com', 'foo=bar; baz=foobar'], @@ -336,7 +336,7 @@ public function testAddsCookiesWithEmptyPathFromResponse(): void static::assertTrue($newRequest->hasHeader('Cookie')); } - public function provideTestCookiePathWithEmptyCookiePath(): array + public static function provideTestCookiePathWithEmptyCookiePath(): array { return [ ['', '/'], diff --git a/packages/tester/Tests/Http/TestResponseTest.php b/packages/tester/Tests/Http/TestResponseTest.php index 15928ccba..01def8179 100644 --- a/packages/tester/Tests/Http/TestResponseTest.php +++ b/packages/tester/Tests/Http/TestResponseTest.php @@ -20,7 +20,7 @@ private function createTestResponse(ResponseInterface $response) return new TestResponse(new Request('GET', '/test'), $response); } - public function provideAssertSuccessful(): array + public static function provideAssertSuccessful(): array { return [ // 2xx @@ -109,7 +109,7 @@ public function testAssertStatusFail(): void $testResponse->assertStatus(666); } - public function provideAssertRedirectStatusCode(): array + public static function provideAssertRedirectStatusCode(): array { return [ // 2xx @@ -201,7 +201,7 @@ public function testAssertRedirectUriFail(): void $testResponse->assertRedirect('/redirect-to'); } - public function provideAssertHeader(): array + public static function provideAssertHeader(): array { return [ 'pass-one-value' => ['header', 'value', ['header' => ['value']], true], diff --git a/packages/tester/composer.json b/packages/tester/composer.json index 0a74631f2..7d8ec4b99 100644 --- a/packages/tester/composer.json +++ b/packages/tester/composer.json @@ -14,7 +14,7 @@ "ext-simplexml": "*", "draw/core": "^0.10", "guzzlehttp/psr7": "^1.8 || ^2.0", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "psr/http-message": "^1.0", "symfony/property-access": "^5.4.3" }, diff --git a/packages/user-bundle/Entity/SecurityUserInterface.php b/packages/user-bundle/Entity/SecurityUserInterface.php index 8cc0f08e7..c4db88949 100644 --- a/packages/user-bundle/Entity/SecurityUserInterface.php +++ b/packages/user-bundle/Entity/SecurityUserInterface.php @@ -7,10 +7,7 @@ interface SecurityUserInterface extends PasswordAuthenticatedUserInterface, UserInterface { - /** - * @return mixed - */ - public function getId(); + public function getId(): mixed; public function getUserIdentifier(): ?string; @@ -19,7 +16,7 @@ public function getPasswordUpdatedAt(): ?\DateTimeInterface; public function getPlainPassword(): ?string; /** - * Set the the plain (not encrypted) password to replace the current password upon save. + * Set the plain (not encrypted) password to replace the current password upon save. * * @param ?string $plainPassword The new password */ diff --git a/packages/user-bundle/Entity/SecurityUserTrait.php b/packages/user-bundle/Entity/SecurityUserTrait.php index 0836ac197..67292b7e0 100644 --- a/packages/user-bundle/Entity/SecurityUserTrait.php +++ b/packages/user-bundle/Entity/SecurityUserTrait.php @@ -87,7 +87,7 @@ public function setPlainPassword(?string $plainPassword): self { $this->plainPassword = $plainPassword; if ($this->plainPassword) { - // This is needed to flag a property modified to trigger what's is needed for the flush + // This is needed to flag a property modified to trigger what is needed for the flush // We want to make sure the date change in case the previous value is on the same second $this->passwordUpdatedAt = null; $this->setPasswordUpdatedAt(new \DateTimeImmutable()); diff --git a/packages/user-bundle/Tests/AccountLocker/Entity/LockableUserTraitTest.php b/packages/user-bundle/Tests/AccountLocker/Entity/LockableUserTraitTest.php index 1196bb0ec..863c057ff 100644 --- a/packages/user-bundle/Tests/AccountLocker/Entity/LockableUserTraitTest.php +++ b/packages/user-bundle/Tests/AccountLocker/Entity/LockableUserTraitTest.php @@ -9,11 +9,10 @@ use Draw\Bundle\UserBundle\Entity\UserLock; use Draw\Bundle\UserBundle\Message\TemporaryUnlockedMessage; use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderTrait - */ +#[CoversClass(MessageHolderTrait::class)] class LockableUserTraitTest extends TestCase { private UserStub $object; diff --git a/packages/user-bundle/Tests/AccountLocker/Entity/UserLockTest.php b/packages/user-bundle/Tests/AccountLocker/Entity/UserLockTest.php index 376925a09..d46a9098f 100644 --- a/packages/user-bundle/Tests/AccountLocker/Entity/UserLockTest.php +++ b/packages/user-bundle/Tests/AccountLocker/Entity/UserLockTest.php @@ -3,11 +3,11 @@ namespace Draw\Bundle\UserBundle\Tests\AccountLocker\Entity; use Draw\Bundle\UserBundle\Entity\UserLock; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Bundle\UserBundle\Entity\UserLock - */ +#[CoversClass(UserLock::class)] class UserLockTest extends TestCase { private UserLock $entity; @@ -32,7 +32,7 @@ public function testConstructorDefault(): void static::assertNull($this->entity->getUnlockUntil(), 'Unlock until must be null'); } - public function provideTestIsActive(): array + public static function provideTestIsActive(): array { return [ 'default' => [ @@ -66,9 +66,7 @@ public function provideTestIsActive(): array ]; } - /** - * @dataProvider provideTestIsActive - */ + #[DataProvider('provideTestIsActive')] public function testIsActive(UserLock $userLock, bool $expected): void { static::assertSame($expected, $userLock->isActive()); diff --git a/packages/user-bundle/Tests/DependencyInjection/ConfigurationTest.php b/packages/user-bundle/Tests/DependencyInjection/ConfigurationTest.php index 7948ce04a..3d016124c 100644 --- a/packages/user-bundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/ConfigurationTest.php @@ -68,7 +68,7 @@ public function getDefaultConfiguration(): array ]; } - public function provideTestInvalidConfiguration(): iterable + public static function provideTestInvalidConfiguration(): iterable { yield [ ['encrypt_password_listener' => 'string-not-supported'], diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionTest.php index 4cbdf515e..8fdcfbcbf 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionTest.php @@ -41,7 +41,7 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield [ConnectionTokensController::class]; yield [UserRequestInterceptedListener::class]; diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithAccountLockerEnabledTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithAccountLockerEnabledTest.php index ca63695b1..2943e21f4 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithAccountLockerEnabledTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithAccountLockerEnabledTest.php @@ -21,7 +21,7 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [AccountLocker::class]; diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEmailWritersEnabledTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEmailWritersEnabledTest.php index 7282afde1..bb809ce0d 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEmailWritersEnabledTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEmailWritersEnabledTest.php @@ -23,7 +23,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [ForgotPasswordEmailWriter::class]; diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faTest.php index 700c92614..57f7a7db2 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faTest.php @@ -21,7 +21,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [TwoFactorAuthenticationEntityListener::class]; diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faWithEnforcingRolesTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faWithEnforcingRolesTest.php index 07d71f008..bbc81c8c5 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faWithEnforcingRolesTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithEnforce2faWithEnforcingRolesTest.php @@ -15,9 +15,9 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { - yield from $this->removeProvidedService( + yield from static::removeProvidedService( [TwoFactorAuthenticationEnforcerInterface::class], parent::provideTestHasServiceDefinition() ); diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithOnboardingEnabledTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithOnboardingEnabledTest.php index 5a46958f4..b1b82db0a 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithOnboardingEnabledTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithOnboardingEnabledTest.php @@ -16,7 +16,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [NewUserSendEmailMessageHandler::class]; diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithPasswordChangeEnforcerEnabledTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithPasswordChangeEnforcerEnabledTest.php index 9841f4cab..d5710bee3 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithPasswordChangeEnforcerEnabledTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithPasswordChangeEnforcerEnabledTest.php @@ -18,7 +18,7 @@ public function getConfiguration(): array return $configuration; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { yield from parent::provideTestHasServiceDefinition(); yield [PasswordChangeEnforcerListener::class]; diff --git a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithoutEncryptPasswordListenerTest.php b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithoutEncryptPasswordListenerTest.php index d32762f5e..5979ac747 100644 --- a/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithoutEncryptPasswordListenerTest.php +++ b/packages/user-bundle/Tests/DependencyInjection/DrawUserExtensionWithoutEncryptPasswordListenerTest.php @@ -15,9 +15,9 @@ public function getConfiguration(): array ]; } - public function provideTestHasServiceDefinition(): iterable + public static function provideTestHasServiceDefinition(): iterable { - yield from $this->removeProvidedService( + yield from static::removeProvidedService( [ EncryptPasswordUserEntityListener::class, ], diff --git a/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php b/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php index 7de588ac4..fc3e95fcd 100644 --- a/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php +++ b/packages/user-bundle/Tests/EventListener/TwoFactorAuthenticationListenerTest.php @@ -65,14 +65,38 @@ public function testGetSubscribedEvents(): void ); } - public function provideTestCheckNeedToEnableTwoFactorAuthentication(): iterable + public static function provideTestCheckNeedToEnableTwoFactorAuthentication(): iterable { $request = new Request(); $request->attributes->set('_route', self::ENABLE_ROUTE); yield 'not-security-user' => [ new UserRequestInterceptionEvent( - $this->createMock(UserInterface::class), + new class() implements UserInterface { + public function getRoles(): array + { + return []; + } + + public function getPassword(): ?string + { + return null; + } + + public function getSalt(): ?string + { + return null; + } + + public function getUsername(): string + { + return ''; + } + + public function eraseCredentials(): void + { + } + }, $request ), false, @@ -81,7 +105,24 @@ public function provideTestCheckNeedToEnableTwoFactorAuthentication(): iterable yield 'not-two-factor-authentication-user' => [ new UserRequestInterceptionEvent( - $this->createMock(SecurityUserInterface::class), + new class() implements SecurityUserInterface, + TwoFactorAuthenticationUserInterface { + use ConfigurationTrait { + asOneTwoFActorAuthenticationProviderEnabled as originalAsOneProviderEnabled; + } + + use SecurityUserTrait; + + public function getId(): mixed + { + return 1; + } + + public function asOneTwoFActorAuthenticationProviderEnabled(): bool + { + return false; + } + }, $request ), false, @@ -98,7 +139,7 @@ public function provideTestCheckNeedToEnableTwoFactorAuthentication(): iterable use SecurityUserTrait; - public function getId() + public function getId(): mixed { return 1; } @@ -121,7 +162,7 @@ public function asOneTwoFActorAuthenticationProviderEnabled(): bool use ConfigurationTrait; use SecurityUserTrait; - public function getId() + public function getId(): mixed { return 1; } @@ -142,7 +183,7 @@ public function getId() use SecurityUserTrait; - public function getId() + public function getId(): mixed { return 1; } @@ -169,7 +210,7 @@ public function isForceEnablingTwoFactorAuthentication(): bool use SecurityUserTrait; - public function getId() + public function getId(): mixed { return 1; } @@ -195,7 +236,7 @@ public function isForceEnablingTwoFactorAuthentication(): bool } use SecurityUserTrait; - public function getId() + public function getId(): mixed { return 1; } diff --git a/packages/user-bundle/Tests/Message/TemporaryUnlockedMessageTest.php b/packages/user-bundle/Tests/Message/TemporaryUnlockedMessageTest.php index 937805abc..34d5f9cb1 100644 --- a/packages/user-bundle/Tests/Message/TemporaryUnlockedMessageTest.php +++ b/packages/user-bundle/Tests/Message/TemporaryUnlockedMessageTest.php @@ -8,11 +8,10 @@ use Draw\Bundle\UserBundle\Message\TemporaryUnlockedMessage; use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderInterface; use Draw\Component\Messenger\DoctrineMessageBusHook\Entity\MessageHolderTrait; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; -/** - * @covers \Draw\Bundle\UserBundle\Message\TemporaryUnlockedMessage - */ +#[CoversClass(TemporaryUnlockedMessage::class)] class TemporaryUnlockedMessageTest extends TestCase { private TemporaryUnlockedMessage $object; diff --git a/packages/user-bundle/composer.json b/packages/user-bundle/composer.json index 6d7352d5c..489caf2f7 100644 --- a/packages/user-bundle/composer.json +++ b/packages/user-bundle/composer.json @@ -26,7 +26,7 @@ "draw/messenger": "^0.10", "draw/tester": "^0.10", "firebase/php-jwt": "^6.1", - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "scheb/2fa-bundle": "^5.12", "scheb/2fa-qr-code": "^5.12", "scheb/2fa-totp": "^5.12" diff --git a/packages/validator/Tests/Constraints/PhpCallableTest.php b/packages/validator/Tests/Constraints/PhpCallableTest.php index debc87510..db182aeca 100644 --- a/packages/validator/Tests/Constraints/PhpCallableTest.php +++ b/packages/validator/Tests/Constraints/PhpCallableTest.php @@ -4,12 +4,11 @@ use Draw\Component\Validator\Constraints\PhpCallable; use Draw\Component\Validator\Constraints\PhpCallableValidator; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraint; -/** - * @covers \Draw\Component\Validator\Constraints\PhpCallable - */ +#[CoversClass(PhpCallable::class)] class PhpCallableTest extends TestCase { private PhpCallable $object; diff --git a/packages/validator/Tests/Constraints/PhpCallableValidatorTest.php b/packages/validator/Tests/Constraints/PhpCallableValidatorTest.php index 03611bec5..5cdf9a3c5 100644 --- a/packages/validator/Tests/Constraints/PhpCallableValidatorTest.php +++ b/packages/validator/Tests/Constraints/PhpCallableValidatorTest.php @@ -4,6 +4,8 @@ use Draw\Component\Validator\Constraints\PhpCallable; use Draw\Component\Validator\Constraints\PhpCallableValidator; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraints\IsTrue; @@ -12,9 +14,7 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Validation; -/** - * @covers \Draw\Component\Validator\Constraints\PhpCallableValidator - */ +#[CoversClass(PhpCallableValidator::class)] class PhpCallableValidatorTest extends TestCase { private PhpCallableValidator $object; @@ -49,7 +49,7 @@ public function testValidateInvalidConstraint(): void /** * @return array */ - public function provideTestValidate(): array + public static function provideTestValidate(): array { return [ 'execution-only' => [null, null, 0], @@ -60,9 +60,7 @@ public function provideTestValidate(): array ]; } - /** - * @dataProvider provideTestValidate - */ + #[DataProvider('provideTestValidate')] public function testValidate(mixed $value, ?Constraint $returnValueConstraint, int $violationsCount): void { $validator = Validation::createValidator(); diff --git a/packages/validator/Tests/Constraints/RemoteFileExistsTest.php b/packages/validator/Tests/Constraints/RemoteFileExistsTest.php index 0ec26735b..4bff8d3b3 100644 --- a/packages/validator/Tests/Constraints/RemoteFileExistsTest.php +++ b/packages/validator/Tests/Constraints/RemoteFileExistsTest.php @@ -3,12 +3,11 @@ namespace Draw\Component\Validator\Tests\Constraints; use Draw\Component\Validator\Constraints\RemoteFileExists; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraint; -/** - * @covers \Draw\Component\Validator\Constraints\RemoteFileExists - */ +#[CoversClass(RemoteFileExists::class)] class RemoteFileExistsTest extends TestCase { private RemoteFileExists $object; diff --git a/packages/validator/Tests/Constraints/RemoteFileExistsValidatorTest.php b/packages/validator/Tests/Constraints/RemoteFileExistsValidatorTest.php index 0f6782fd8..82b818e5f 100644 --- a/packages/validator/Tests/Constraints/RemoteFileExistsValidatorTest.php +++ b/packages/validator/Tests/Constraints/RemoteFileExistsValidatorTest.php @@ -4,15 +4,15 @@ use Draw\Component\Validator\Constraints\RemoteFileExists; use Draw\Component\Validator\Constraints\RemoteFileExistsValidator; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\ConstraintValidatorInterface; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Validation; -/** - * @covers \Draw\Component\Validator\Constraints\RemoteFileExistsValidator - */ +#[CoversClass(RemoteFileExistsValidator::class)] class RemoteFileExistsValidatorTest extends TestCase { private RemoteFileExistsValidator $object; @@ -47,7 +47,7 @@ public function testValidateInvalidConstraint(): void /** * @return array */ - public function provideFiles(): array + public static function provideFiles(): array { return [ 'url' => ['https://github.com', 0], @@ -57,9 +57,7 @@ public function provideFiles(): array ]; } - /** - * @dataProvider provideFiles - */ + #[DataProvider('provideFiles')] public function testValidate(string $file, int $violationsCount): void { $validator = Validation::createValidator(); diff --git a/packages/validator/Tests/Constraints/StrtotimeTest.php b/packages/validator/Tests/Constraints/StrtotimeTest.php index 7c5d56a50..b0159ec45 100644 --- a/packages/validator/Tests/Constraints/StrtotimeTest.php +++ b/packages/validator/Tests/Constraints/StrtotimeTest.php @@ -4,12 +4,11 @@ use Draw\Component\Validator\Constraints\PhpCallable; use Draw\Component\Validator\Constraints\Strtotime; +use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Constraints\Type; -/** - * @covers \Draw\Component\Validator\Constraints\Strtotime - */ +#[CoversClass(Strtotime::class)] class StrtotimeTest extends TestCase { private Strtotime $object; diff --git a/packages/validator/composer.json b/packages/validator/composer.json index f3d983f12..86aecaccf 100644 --- a/packages/validator/composer.json +++ b/packages/validator/composer.json @@ -13,7 +13,7 @@ "symfony/validator": "^5.4.3" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "doctrine/persistence": "^2.2 || ^3.0" }, "minimum-stability": "dev", diff --git a/packages/workflow/composer.json b/packages/workflow/composer.json index da69a35af..62fd1d6a6 100644 --- a/packages/workflow/composer.json +++ b/packages/workflow/composer.json @@ -15,7 +15,7 @@ "symfony/workflow": "^5.4.3" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", + "phpunit/phpunit": "^9.0 || ^10.0", "symfony/security-core": "^5.4.3" }, "minimum-stability": "dev", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index bb75ce9d4..1d2b5f30f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -16,14 +16,14 @@ parameters: path: packages/open-api/Tests/Extraction/Extractor/PhpDoc/OperationExtractorTest.php - - message: "#^Property Draw\\\\Component\\\\OpenApi\\\\Tests\\\\Mock\\\\Model\\\\Test\\:\\:\\$propertyFromBody is unused\\.$#" + message: "#^Property Draw\\\\Component\\\\OpenApi\\\\Tests\\\\Mock\\\\Model\\\\TestClass\\:\\:\\$propertyFromBody is unused\\.$#" count: 1 - path: packages/open-api/Tests/Mock/Model/Test.php + path: packages/open-api/Tests/Mock/Model/TestClass.php - - message: "#^Property Draw\\\\Component\\\\OpenApi\\\\Tests\\\\Mock\\\\Model\\\\Test\\:\\:\\$propertyGroupExclusion is unused\\.$#" + message: "#^Property Draw\\\\Component\\\\OpenApi\\\\Tests\\\\Mock\\\\Model\\\\TestClass\\:\\:\\$propertyGroupExclusion is unused\\.$#" count: 1 - path: packages/open-api/Tests/Mock/Model/Test.php + path: packages/open-api/Tests/Mock/Model/TestClass.php - message: "#^Strict comparison using \\=\\=\\= between null and string will always evaluate to false\\.$#" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a38095f70..93daf2a53 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,19 @@ - - - + + - - - + + + @@ -19,8 +21,8 @@ ./packages/*/Tests - - + + ./packages/* ./src @@ -34,9 +36,8 @@ ./packages/*/vendor tests - - - - - - \ No newline at end of file + + + + + diff --git a/symfony.lock b/symfony.lock index 798891f78..cc683a1b9 100644 --- a/symfony.lock +++ b/symfony.lock @@ -380,9 +380,6 @@ "sebastian/recursion-context": { "version": "4.0.4" }, - "sebastian/resource-operations": { - "version": "3.0.3" - }, "sebastian/type": { "version": "2.3.4" }, diff --git a/tests/Command/NullCommandTest.php b/tests/Command/NullCommandTest.php index 36a118198..52c8a01d9 100644 --- a/tests/Command/NullCommandTest.php +++ b/tests/Command/NullCommandTest.php @@ -26,12 +26,12 @@ public function getCommandName(): string return 'app:null'; } - public function provideTestArgument(): iterable + public static function provideTestArgument(): iterable { return []; } - public function provideTestOption(): iterable + public static function provideTestOption(): iterable { yield [ 'draw-execution-id', diff --git a/tests/Controller/PingActionTest.php b/tests/Controller/PingActionTest.php index fb6a55962..56a15d484 100644 --- a/tests/Controller/PingActionTest.php +++ b/tests/Controller/PingActionTest.php @@ -20,7 +20,7 @@ public function testPing(): void ); } - public function provideTestPingWithContext(): iterable + public static function provideTestPingWithContext(): iterable { yield 'error' => ['error', Response::HTTP_BAD_GATEWAY]; diff --git a/tests/Controller/fixtures/api-doc-scope-all.json b/tests/Controller/fixtures/api-doc-scope-all.json index f2a695290..89d9d8308 100644 --- a/tests/Controller/fixtures/api-doc-scope-all.json +++ b/tests/Controller/fixtures/api-doc-scope-all.json @@ -731,7 +731,7 @@ "in": "body", "name": "body", "schema": { - "$ref": "#/definitions/Draw.Component.OpenApi.Tests.Mock.Model.Test" + "$ref": "#/definitions/Draw.Component.OpenApi.Tests.Mock.Model.TestClass" } } ], @@ -739,7 +739,7 @@ "201": { "description": "The created test entity", "schema": { - "$ref": "#/definitions/Draw.Component.OpenApi.Tests.Mock.Model.Test" + "$ref": "#/definitions/Draw.Component.OpenApi.Tests.Mock.Model.TestClass" }, "headers": { "X-Draw": { @@ -969,7 +969,7 @@ } } }, - "Draw.Component.OpenApi.Tests.Mock.Model.Test": { + "Draw.Component.OpenApi.Tests.Mock.Model.TestClass": { "type": "object", "properties": { "property": { diff --git a/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php b/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php index c5e735a22..30ed74b40 100644 --- a/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php +++ b/tests/Validator/Constraints/ValueIsNotUsedValidatorTest.php @@ -30,7 +30,7 @@ public function testValidate(mixed $value, string $entityClass, string $field, b static::assertSame('VALUE_ALREADY_TAKEN', $violations->get(0)->getCode()); } - public function provideTestValidate(): iterable + public static function provideTestValidate(): iterable { yield 'invalid' => [ 'admin@example.com', diff --git a/vendor-bin/monorepo/composer.lock b/vendor-bin/monorepo/composer.lock index 322e7a57e..031884c2f 100644 --- a/vendor-bin/monorepo/composer.lock +++ b/vendor-bin/monorepo/composer.lock @@ -666,16 +666,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "addc22fed594f9ce04e73ef6a9d3e2416f77192d" + "reference": "338638ed8c9d5c7fcb136a73f5c7043465ae2f05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/addc22fed594f9ce04e73ef6a9d3e2416f77192d", - "reference": "addc22fed594f9ce04e73ef6a9d3e2416f77192d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/338638ed8c9d5c7fcb136a73f5c7043465ae2f05", + "reference": "338638ed8c9d5c7fcb136a73f5c7043465ae2f05", "shasum": "" }, "require": { @@ -735,7 +735,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/v5.4.28" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.29" }, "funding": [ { @@ -751,7 +751,7 @@ "type": "tidelift" } ], - "time": "2023-08-14T10:47:38+00:00" + "time": "2023-09-20T06:23:43+00:00" }, { "name": "symfony/deprecation-contracts", @@ -822,16 +822,16 @@ }, { "name": "symfony/error-handler", - "version": "v6.3.2", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "85fd65ed295c4078367c784e8a5a6cee30348b7a" + "reference": "1f69476b64fb47105c06beef757766c376b548c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/85fd65ed295c4078367c784e8a5a6cee30348b7a", - "reference": "85fd65ed295c4078367c784e8a5a6cee30348b7a", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/1f69476b64fb47105c06beef757766c376b548c4", + "reference": "1f69476b64fb47105c06beef757766c376b548c4", "shasum": "" }, "require": { @@ -876,7 +876,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v6.3.2" + "source": "https://github.com/symfony/error-handler/tree/v6.3.5" }, "funding": [ { @@ -892,7 +892,7 @@ "type": "tidelift" } ], - "time": "2023-07-16T17:05:46+00:00" + "time": "2023-09-12T06:57:20+00:00" }, { "name": "symfony/event-dispatcher", @@ -1179,16 +1179,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.3.4", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "cac1556fdfdf6719668181974104e6fcfa60e844" + "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cac1556fdfdf6719668181974104e6fcfa60e844", - "reference": "cac1556fdfdf6719668181974104e6fcfa60e844", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b50f5e281d722cb0f4c296f908bacc3e2b721957", + "reference": "b50f5e281d722cb0f4c296f908bacc3e2b721957", "shasum": "" }, "require": { @@ -1236,7 +1236,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.3.4" + "source": "https://github.com/symfony/http-foundation/tree/v6.3.5" }, "funding": [ { @@ -1252,20 +1252,20 @@ "type": "tidelift" } ], - "time": "2023-08-22T08:20:46+00:00" + "time": "2023-09-04T21:33:54+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.28", + "version": "v5.4.29", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "127a2322ca1828157901092518b8ea8e4e1109d4" + "reference": "f53265fc6bd2a7f3a4ed4e443b76e750348ac3f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/127a2322ca1828157901092518b8ea8e4e1109d4", - "reference": "127a2322ca1828157901092518b8ea8e4e1109d4", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f53265fc6bd2a7f3a4ed4e443b76e750348ac3f7", + "reference": "f53265fc6bd2a7f3a4ed4e443b76e750348ac3f7", "shasum": "" }, "require": { @@ -1348,7 +1348,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.28" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.29" }, "funding": [ { @@ -1364,7 +1364,7 @@ "type": "tidelift" } ], - "time": "2023-08-26T13:47:51+00:00" + "time": "2023-09-30T06:31:17+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2164,16 +2164,16 @@ }, { "name": "symfony/string", - "version": "v6.3.2", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "53d1a83225002635bca3482fcbf963001313fb68" + "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", - "reference": "53d1a83225002635bca3482fcbf963001313fb68", + "url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339", + "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339", "shasum": "" }, "require": { @@ -2230,7 +2230,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.2" + "source": "https://github.com/symfony/string/tree/v6.3.5" }, "funding": [ { @@ -2246,20 +2246,20 @@ "type": "tidelift" } ], - "time": "2023-07-05T08:41:27+00:00" + "time": "2023-09-18T10:38:32+00:00" }, { "name": "symfony/var-dumper", - "version": "v6.3.4", + "version": "v6.3.5", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45" + "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2027be14f8ae8eae999ceadebcda5b4909b81d45", - "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3d9999376be5fea8de47752837a3e1d1c5f69ef5", + "reference": "3d9999376be5fea8de47752837a3e1d1c5f69ef5", "shasum": "" }, "require": { @@ -2314,7 +2314,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.4" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.5" }, "funding": [ { @@ -2330,7 +2330,7 @@ "type": "tidelift" } ], - "time": "2023-08-24T14:51:05+00:00" + "time": "2023-09-12T10:11:35+00:00" }, { "name": "symfony/yaml", @@ -2459,6 +2459,7 @@ "type": "github" } ], + "abandoned": "symfony/dependency-injection", "time": "2020-10-26T10:38:48+00:00" }, { @@ -2826,5 +2827,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/vendor-bin/simplify/composer.lock b/vendor-bin/simplify/composer.lock index 68cca9f8d..5d92c07bd 100644 --- a/vendor-bin/simplify/composer.lock +++ b/vendor-bin/simplify/composer.lock @@ -70,5 +70,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" }