Skip to content

[Notifier] deprecate the TransportFactoryTestCase #58335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2024
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
8 changes: 8 additions & 0 deletions UPGRADE-7.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ Messenger

* Add `getRetryDelay()` method to `RecoverableExceptionInterface`

Notifier
--------

* Deprecate `TransportFactoryTestCase`, extend `AbstractTransportFactoryTestCase` instead

The `testIncompleteDsnException()` and `testMissingRequiredOptionException()` tests are no longer provided by default. If you make use of them (i.e. by implementing the
`incompleteDsnProvider()` or `missingRequiredOptionProvider()` data providers), you now need to use the `IncompleteDsnTestTrait` or `MissingRequiredOptionTestTrait` respectively.

Security
--------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
namespace Symfony\Component\Notifier\Bridge\AllMySms\Tests;

use Symfony\Component\Notifier\Bridge\AllMySms\AllMySmsTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

final class AllMySmsTransportFactoryTest extends TransportFactoryTestCase
final class AllMySmsTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;

public function createFactory(): AllMySmsTransportFactory
{
return new AllMySmsTransportFactory();
Expand Down Expand Up @@ -44,4 +47,10 @@ public static function unsupportedSchemeProvider(): iterable
{
yield ['somethingElse://login:apiKey@default'];
}

public static function incompleteDsnProvider(): iterable
{
yield ['allmysms://login@default'];
yield ['allmysms://:apiKey@default'];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\AllMySms\\": "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace Symfony\Component\Notifier\Bridge\AmazonSns\Tests;

use Symfony\Component\Notifier\Bridge\AmazonSns\AmazonSnsTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;

class AmazonSnsTransportFactoryTest extends TransportFactoryTestCase
class AmazonSnsTransportFactoryTest extends AbstractTransportFactoryTestCase
{
public function createFactory(): AmazonSnsTransportFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0",
"symfony/notifier": "^7.2",
"async-aws/sns": "^1.0"
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
namespace Symfony\Component\Notifier\Bridge\Bandwidth\Tests;

use Symfony\Component\Notifier\Bridge\Bandwidth\BandwidthTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTestTrait;

final class BandwidthTransportFactoryTest extends TransportFactoryTestCase
final class BandwidthTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;

public function createFactory(): BandwidthTransportFactory
{
return new BandwidthTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"require-dev": {
"symfony/event-dispatcher": "^6.4|^7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
namespace Symfony\Component\Notifier\Bridge\Bluesky\Tests;

use Symfony\Component\Notifier\Bridge\Bluesky\BlueskyTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

class BlueskyTransportFactoryTest extends TransportFactoryTestCase
class BlueskyTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;

public function createFactory(): BlueskyTransportFactory
{
return new BlueskyTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
namespace Symfony\Component\Notifier\Bridge\Brevo\Tests;

use Symfony\Component\Notifier\Bridge\Brevo\BrevoTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTestTrait;

final class BrevoTransportFactoryTest extends TransportFactoryTestCase
final class BrevoTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;

public function createFactory(): BrevoTransportFactory
{
return new BrevoTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"require-dev": {
"symfony/event-dispatcher": "^5.4|^6.0|^7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
namespace Symfony\Component\Notifier\Bridge\Chatwork\Tests;

use Symfony\Component\Notifier\Bridge\Chatwork\ChatworkTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTestTrait;
use Symfony\Component\Notifier\Transport\TransportFactoryInterface;

class ChatworkTransportFactoryTest extends TransportFactoryTestCase
class ChatworkTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;

public function createFactory(): TransportFactoryInterface
{
return new ChatworkTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Chatwork\\": "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
namespace Symfony\Component\Notifier\Bridge\ClickSend\Tests;

use Symfony\Component\Notifier\Bridge\ClickSend\ClickSendTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

final class ClickSendTransportFactoryTest extends TransportFactoryTestCase
final class ClickSendTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;

public function createFactory(): ClickSendTransportFactory
{
return new ClickSendTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"require-dev": {
"symfony/event-dispatcher": "^6.4|^7.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
namespace Symfony\Component\Notifier\Bridge\Clickatell\Tests;

use Symfony\Component\Notifier\Bridge\Clickatell\ClickatellTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

class ClickatellTransportFactoryTest extends TransportFactoryTestCase
class ClickatellTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;

public function createFactory(): ClickatellTransportFactory
{
return new ClickatellTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Clickatell\\": "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
namespace Symfony\Component\Notifier\Bridge\ContactEveryone\Tests;

use Symfony\Component\Notifier\Bridge\ContactEveryone\ContactEveryoneTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

final class ContactEveryoneTransportFactoryTest extends TransportFactoryTestCase
final class ContactEveryoneTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;

public function createFactory(): ContactEveryoneTransportFactory
{
return new ContactEveryoneTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\ContactEveryone\\": "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
namespace Symfony\Component\Notifier\Bridge\Discord\Tests;

use Symfony\Component\Notifier\Bridge\Discord\DiscordTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTestTrait;

final class DiscordTransportFactoryTest extends TransportFactoryTestCase
final class DiscordTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;

public function createFactory(): DiscordTransportFactory
{
return new DiscordTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0",
"symfony/notifier": "^7.2",
"symfony/polyfill-mbstring": "^1.0"
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
namespace Symfony\Component\Notifier\Bridge\Engagespot\Tests;

use Symfony\Component\Notifier\Bridge\Engagespot\EngagespotTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

/**
* @author Daniel GORGAN <https://github.com/danut007ro>
*/
final class EngagespotTransportFactoryTest extends TransportFactoryTestCase
final class EngagespotTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;

public function createFactory(): EngagespotTransportFactory
{
return new EngagespotTransportFactory();
Expand All @@ -42,4 +45,9 @@ public static function unsupportedSchemeProvider(): iterable
{
yield ['somethingElse://username:password@default'];
}

public static function incompleteDsnProvider(): iterable
{
yield ['engagespot://default'];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Engagespot\\": "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
namespace Symfony\Component\Notifier\Bridge\Esendex\Tests;

use Symfony\Component\Notifier\Bridge\Esendex\EsendexTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTestTrait;

final class EsendexTransportFactoryTest extends TransportFactoryTestCase
final class EsendexTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;

public function createFactory(): EsendexTransportFactory
{
return new EsendexTransportFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Esendex\\": "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
namespace Symfony\Component\Notifier\Bridge\Expo\Tests;

use Symfony\Component\Notifier\Bridge\Expo\ExpoTransportFactory;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;

/**
* @author Imad ZAIRIG <https://github.com/zairigimad>
*/
final class ExpoTransportFactoryTest extends TransportFactoryTestCase
final class ExpoTransportFactoryTest extends AbstractTransportFactoryTestCase
{
public function createFactory(): ExpoTransportFactory
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Notifier/Bridge/Expo/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Expo\\": "" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Notifier\Bridge\FakeChat\FakeChatTransportFactory;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTestTrait;
use Symfony\Component\Notifier\Transport\Dsn;

final class FakeChatTransportFactoryTest extends TransportFactoryTestCase
final class FakeChatTransportFactoryTest extends AbstractTransportFactoryTestCase
{
use IncompleteDsnTestTrait;
use MissingRequiredOptionTestTrait;

public function testMissingRequiredMailerDependency()
{
$this->expectException(LogicException::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"require": {
"php": ">=8.2",
"symfony/http-client": "^6.4|^7.0",
"symfony/notifier": "^6.4|^7.0"
"symfony/notifier": "^7.2"
},
"require-dev": {
"psr/log": "^1|^2|^3",
Expand Down
Loading
Loading