From 04ed265dd85a56606d224fc28c830f346dcc3271 Mon Sep 17 00:00:00 2001 From: Florian Guimier Date: Tue, 25 Aug 2026 15:03:51 +0200 Subject: [PATCH 1/3] Migrate PHPUnit annotations to attributes Required by PHPUnit 13, which the CI resolves on highest-deps runs. The Group attributes also restore the phpunit-bridge DnsMock wiring that the dns-sensitive docblock group no longer triggered. Co-Authored-By: Claude Fable 5 --- tests/Resolver/BounceTypeResolverTest.php | 3 ++- tests/Resolver/MxServersResolverTest.php | 7 +++---- tests/Resolver/ProviderResolverTest.php | 5 ++--- .../BounceIsCausedByInactiveUserSpecificationTest.php | 3 ++- .../BounceIsCausedByOverQuotaSpecificationTest.php | 3 ++- .../BounceIsCausedByUnknownUserSpecificationTest.php | 3 ++- .../Specification/BounceIsSpamRelatedSpecificationTest.php | 3 ++- .../BounceReasonIsUnknownSpecificationTest.php | 3 ++- .../EmailAddressIsFromACountrySpecificationTest.php | 3 ++- .../EmailAddressIsFromAProviderSpecificationTest.php | 3 ++- tests/Translatable/BounceReasonTranslatableTest.php | 5 ++--- tests/Validation/SmtpValidatorTest.php | 3 ++- 12 files changed, 25 insertions(+), 19 deletions(-) diff --git a/tests/Resolver/BounceTypeResolverTest.php b/tests/Resolver/BounceTypeResolverTest.php index d364039..cee38b9 100644 --- a/tests/Resolver/BounceTypeResolverTest.php +++ b/tests/Resolver/BounceTypeResolverTest.php @@ -5,11 +5,12 @@ namespace AssoConnect\SmtpToolbox\Tests\Resolver; use AssoConnect\SmtpToolbox\Resolver\BounceTypeResolver; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BounceTypeResolverTest extends TestCase { - /** @dataProvider provideBounceReasons */ + #[DataProvider('provideBounceReasons')] public function testResolveBounceMessagesCorrectly(string $expected, string $bounceReason): void { $resolver = new BounceTypeResolver(); diff --git a/tests/Resolver/MxServersResolverTest.php b/tests/Resolver/MxServersResolverTest.php index 884543c..9a971b2 100644 --- a/tests/Resolver/MxServersResolverTest.php +++ b/tests/Resolver/MxServersResolverTest.php @@ -5,6 +5,7 @@ namespace AssoConnect\SmtpToolbox\Tests\Resolver; use AssoConnect\SmtpToolbox\Resolver\MxServersResolver; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Symfony\Bridge\PhpUnit\DnsMock; use Symfony\Component\Cache\Adapter\ArrayAdapter; @@ -33,10 +34,8 @@ public function testCacheIsUsed(): void self::assertTrue($isHitAfter); } - /** - * @group functional - * @group dns-sensitive - */ + #[Group('functional')] + #[Group('dns-sensitive')] public function testDns(): void { DnsMock::withMockedHosts([ diff --git a/tests/Resolver/ProviderResolverTest.php b/tests/Resolver/ProviderResolverTest.php index b0f88cf..be88ac5 100644 --- a/tests/Resolver/ProviderResolverTest.php +++ b/tests/Resolver/ProviderResolverTest.php @@ -6,13 +6,12 @@ use AssoConnect\SmtpToolbox\Resolver\ProviderResolver; use AssoConnect\SmtpToolbox\Specification\EmailAddressIsFromAProviderSpecification; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ProviderResolverTest extends TestCase { - /** - * @dataProvider provideAddressesAndProviders - */ + #[DataProvider('provideAddressesAndProviders')] public function testProviderResolverReturnsTheRightProvider(string $address, ?string $provider): void { $resolver = new ProviderResolver( diff --git a/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php b/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php index 5bbeedf..8766d92 100644 --- a/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php +++ b/tests/Specification/BounceIsCausedByInactiveUserSpecificationTest.php @@ -5,11 +5,12 @@ namespace AssoConnect\SmtpToolbox\Tests\Specification; use AssoConnect\SmtpToolbox\Specification\BounceIsCausedByInactiveUserSpecification; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BounceIsCausedByInactiveUserSpecificationTest extends TestCase { - /** @dataProvider provideMessages */ + #[DataProvider('provideMessages')] public function testSpecificationWorks(string $message, bool $isSpam): void { $spec = new BounceIsCausedByInactiveUserSpecification(); diff --git a/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php b/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php index 94dc64a..267b927 100644 --- a/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php +++ b/tests/Specification/BounceIsCausedByOverQuotaSpecificationTest.php @@ -5,11 +5,12 @@ namespace AssoConnect\SmtpToolbox\Tests\Specification; use AssoConnect\SmtpToolbox\Specification\BounceIsCausedByOverQuotaSpecification; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BounceIsCausedByOverQuotaSpecificationTest extends TestCase { - /** @dataProvider provideMessages */ + #[DataProvider('provideMessages')] public function testSpecificationWorks(string $message, bool $isSpam): void { $spec = new BounceIsCausedByOverQuotaSpecification(); diff --git a/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php b/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php index 57c71c5..60e6107 100644 --- a/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php +++ b/tests/Specification/BounceIsCausedByUnknownUserSpecificationTest.php @@ -5,11 +5,12 @@ namespace AssoConnect\SmtpToolbox\Tests\Specification; use AssoConnect\SmtpToolbox\Specification\BounceIsCausedByUnknownUserSpecification; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BounceIsCausedByUnknownUserSpecificationTest extends TestCase { - /** @dataProvider provideMessages */ + #[DataProvider('provideMessages')] public function testSpecificationWorks(string $message, bool $isSpam): void { $spec = new BounceIsCausedByUnknownUserSpecification(); diff --git a/tests/Specification/BounceIsSpamRelatedSpecificationTest.php b/tests/Specification/BounceIsSpamRelatedSpecificationTest.php index 923d9db..6cbab22 100644 --- a/tests/Specification/BounceIsSpamRelatedSpecificationTest.php +++ b/tests/Specification/BounceIsSpamRelatedSpecificationTest.php @@ -6,11 +6,12 @@ use AssoConnect\SmtpToolbox\Resolver\BounceTypeResolver; use AssoConnect\SmtpToolbox\Specification\BounceIsSpamRelatedSpecification; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BounceIsSpamRelatedSpecificationTest extends TestCase { - /** @dataProvider provideMessages */ + #[DataProvider('provideMessages')] public function testSpecificationWorks(string $message, bool $isSpam): void { $spec = new BounceIsSpamRelatedSpecification(new BounceTypeResolver()); diff --git a/tests/Specification/BounceReasonIsUnknownSpecificationTest.php b/tests/Specification/BounceReasonIsUnknownSpecificationTest.php index c47373f..baf51b7 100644 --- a/tests/Specification/BounceReasonIsUnknownSpecificationTest.php +++ b/tests/Specification/BounceReasonIsUnknownSpecificationTest.php @@ -5,11 +5,12 @@ namespace AssoConnect\SmtpToolbox\Tests\Specification; use AssoConnect\SmtpToolbox\Specification\BounceReasonIsUnknownSpecification; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BounceReasonIsUnknownSpecificationTest extends TestCase { - /** @dataProvider provideMessages */ + #[DataProvider('provideMessages')] public function testSpecificationWorks(string $message, bool $isSpam): void { $spec = new BounceReasonIsUnknownSpecification(); diff --git a/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php b/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php index aeabce0..fa8bc3c 100644 --- a/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php +++ b/tests/Specification/EmailAddressIsFromACountrySpecificationTest.php @@ -7,11 +7,12 @@ use AssoConnect\SmtpToolbox\Specification\EmailAddressIsFromACountrySpecification; use AssoConnect\SmtpToolbox\Specification\EmailAddressIsFromAProviderSpecification; use AssoConnect\SmtpToolbox\Tests\Resolver\MxServersResolverTestFactory; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class EmailAddressIsFromACountrySpecificationTest extends TestCase { - /** @dataProvider provideEmailAddresses */ + #[DataProvider('provideEmailAddresses')] public function testSpecificationWorks(string $emailAddress, string $country, bool $isSatisfiedBy): void { $spec = new EmailAddressIsFromACountrySpecification( diff --git a/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php b/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php index 97d79b1..fb7bcaf 100644 --- a/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php +++ b/tests/Specification/EmailAddressIsFromAProviderSpecificationTest.php @@ -6,11 +6,12 @@ use AssoConnect\SmtpToolbox\Specification\EmailAddressIsFromAProviderSpecification; use AssoConnect\SmtpToolbox\Tests\Resolver\MxServersResolverTestFactory; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class EmailAddressIsFromAProviderSpecificationTest extends TestCase { - /** @dataProvider provideEmailAddresses */ + #[DataProvider('provideEmailAddresses')] public function testSpecificationWorks(string $emailAddress, string $providerName, bool $isSatisfiedBy): void { $spec = new EmailAddressIsFromAProviderSpecification( diff --git a/tests/Translatable/BounceReasonTranslatableTest.php b/tests/Translatable/BounceReasonTranslatableTest.php index c0ce92e..ef34156 100644 --- a/tests/Translatable/BounceReasonTranslatableTest.php +++ b/tests/Translatable/BounceReasonTranslatableTest.php @@ -5,14 +5,13 @@ namespace AssoConnect\SmtpToolbox\Tests\Translatable; use AssoConnect\SmtpToolbox\Translatable\BounceReasonTranslatable; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Contracts\Translation\TranslatorInterface; class BounceReasonTranslatableTest extends KernelTestCase { - /** - * @dataProvider providerTrans - */ + #[DataProvider('providerTrans')] public function testBounceReasonTranslatable(string $reason, string $expectedTranslationKey): void { $translator = static::getContainer()->get(TranslatorInterface::class); diff --git a/tests/Validation/SmtpValidatorTest.php b/tests/Validation/SmtpValidatorTest.php index c85f32e..3fe1034 100644 --- a/tests/Validation/SmtpValidatorTest.php +++ b/tests/Validation/SmtpValidatorTest.php @@ -15,6 +15,7 @@ use AssoConnect\SmtpToolbox\Specification\ExceptionComesFromTemporaryFailureSpecification; use AssoConnect\SmtpToolbox\Tests\Resolver\MxServersResolverTestFactory; use AssoConnect\SmtpToolbox\Validation\SmtpValidator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Psr\Log\NullLogger; @@ -39,10 +40,10 @@ public function setUp(): void } /** - * @dataProvider provideEmailAddresses * @param class-string $expectedDtoClass * @throws SmtpTemporaryFailureException */ + #[DataProvider('provideEmailAddresses')] public function testClientWorks(string $email, string $expectedDtoClass): void { self::assertInstanceOf($expectedDtoClass, $this->validator->validate($email)); From f3a6f77f8d9b1aaf5d72f18c6ba2e7552c87b206 Mon Sep 17 00:00:00 2001 From: Florian Guimier Date: Tue, 25 Aug 2026 15:03:51 +0200 Subject: [PATCH 2/3] Allow Symfony 8 Co-Authored-By: Claude Fable 5 --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index e52628c..5a43a02 100644 --- a/composer.json +++ b/composer.json @@ -26,17 +26,17 @@ } }, "require-dev": { - "symfony/phpunit-bridge": "^7.2", - "symfony/var-dumper": "^7.0", - "symfony/framework-bundle": "^7.0", - "symfony/yaml": "^7.0", - "symfony/translation": "^7.0", + "symfony/phpunit-bridge": "^7.2|^8.0", + "symfony/var-dumper": "^7.0|^8.0", + "symfony/framework-bundle": "^7.0|^8.0", + "symfony/yaml": "^7.0|^8.0", + "symfony/translation": "^7.0|^8.0", "assoconnect/php-quality-config": "^2.2", "phpstan/phpstan-symfony": "^2" }, "require": { "php": "^8.4", - "symfony/cache": "^7.0", + "symfony/cache": "^7.0|^8.0", "symfony/contracts": "^2.5|^3.4", "phpmailer/phpmailer": "^6.6", "thecodingmachine/safe": "^3" From a74fc5a2625bb5bf3d33e8e1c12fe3f5a5efeb44 Mon Sep 17 00:00:00 2001 From: Florian Guimier Date: Tue, 25 Aug 2026 15:15:00 +0200 Subject: [PATCH 3/3] Raise symfony/phpunit-bridge floor to ^7.4 The 7.2.0 release (previous lowest) caps PHPUnit at 10.5 and its deprecation gate exits non-zero under PHP 8.4 even in weak mode, failing the lowest-deps CI job after all tests pass. 7.4.0 is clean. Co-Authored-By: Claude Fable 5 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5a43a02..f7c340c 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ } }, "require-dev": { - "symfony/phpunit-bridge": "^7.2|^8.0", + "symfony/phpunit-bridge": "^7.4|^8.0", "symfony/var-dumper": "^7.0|^8.0", "symfony/framework-bundle": "^7.0|^8.0", "symfony/yaml": "^7.0|^8.0",