Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.4|^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"
Expand Down
3 changes: 2 additions & 1 deletion tests/Resolver/BounceTypeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 3 additions & 4 deletions tests/Resolver/MxServersResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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([
Expand Down
5 changes: 2 additions & 3 deletions tests/Resolver/ProviderResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion tests/Specification/BounceIsSpamRelatedSpecificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 2 additions & 3 deletions tests/Translatable/BounceReasonTranslatableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion tests/Validation/SmtpValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -39,10 +40,10 @@ public function setUp(): void
}

/**
* @dataProvider provideEmailAddresses
* @param class-string<ValidationStatusDtoInterface> $expectedDtoClass
* @throws SmtpTemporaryFailureException
*/
#[DataProvider('provideEmailAddresses')]
public function testClientWorks(string $email, string $expectedDtoClass): void
{
self::assertInstanceOf($expectedDtoClass, $this->validator->validate($email));
Expand Down
Loading