Skip to content

Commit 68bea87

Browse files
[Notifier] Fix registering many bridges
1 parent d56f46e commit 68bea87

File tree

3 files changed

+135
-222
lines changed

3 files changed

+135
-222
lines changed

Exception/UnsupportedSchemeException.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class UnsupportedSchemeException extends LogicException
2828
'class' => Bridge\Bandwidth\BandwidthTransportFactory::class,
2929
'package' => 'symfony/bandwidth-notifier',
3030
],
31+
'chatwork' => [
32+
'class' => Bridge\Chatwork\ChatworkTransportFactory::class,
33+
'package' => 'symfony/chatwork-notifier',
34+
],
3135
'clickatell' => [
3236
'class' => Bridge\Clickatell\ClickatellTransportFactory::class,
3337
'package' => 'symfony/clickatell-notifier',
@@ -96,6 +100,10 @@ class UnsupportedSchemeException extends LogicException
96100
'class' => Bridge\Isendpro\IsendproTransportFactory::class,
97101
'package' => 'symfony/isendpro-notifier',
98102
],
103+
'kaz-info-teh' => [
104+
'class' => Bridge\KazInfoTeh\KazInfoTehTransportFactory::class,
105+
'package' => 'symfony/symfony/kaz-info-teh-notifier',
106+
],
99107
'lightsms' => [
100108
'class' => Bridge\LightSms\LightSmsTransportFactory::class,
101109
'package' => 'symfony/light-sms-notifier',

Tests/Exception/UnsupportedSchemeExceptionTest.php

Lines changed: 64 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -13,63 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bridge\PhpUnit\ClassExistsMock;
16-
use Symfony\Component\Notifier\Bridge\AllMySms\AllMySmsTransportFactory;
17-
use Symfony\Component\Notifier\Bridge\AmazonSns\AmazonSnsTransportFactory;
18-
use Symfony\Component\Notifier\Bridge\Bandwidth\BandwidthTransportFactory;
19-
use Symfony\Component\Notifier\Bridge\Clickatell\ClickatellTransportFactory;
20-
use Symfony\Component\Notifier\Bridge\ContactEveryone\ContactEveryoneTransportFactory;
21-
use Symfony\Component\Notifier\Bridge\Discord\DiscordTransportFactory;
22-
use Symfony\Component\Notifier\Bridge\Esendex\EsendexTransportFactory;
23-
use Symfony\Component\Notifier\Bridge\FakeChat\FakeChatTransportFactory;
24-
use Symfony\Component\Notifier\Bridge\FakeSms\FakeSmsTransportFactory;
25-
use Symfony\Component\Notifier\Bridge\Firebase\FirebaseTransportFactory;
26-
use Symfony\Component\Notifier\Bridge\FortySixElks\FortySixElksTransportFactory;
27-
use Symfony\Component\Notifier\Bridge\FreeMobile\FreeMobileTransportFactory;
28-
use Symfony\Component\Notifier\Bridge\GatewayApi\GatewayApiTransportFactory;
29-
use Symfony\Component\Notifier\Bridge\Gitter\GitterTransportFactory;
30-
use Symfony\Component\Notifier\Bridge\GoogleChat\GoogleChatTransportFactory;
31-
use Symfony\Component\Notifier\Bridge\Infobip\InfobipTransportFactory;
32-
use Symfony\Component\Notifier\Bridge\Iqsms\IqsmsTransportFactory;
33-
use Symfony\Component\Notifier\Bridge\Isendpro\IsendproTransportFactory;
34-
use Symfony\Component\Notifier\Bridge\LightSms\LightSmsTransportFactory;
35-
use Symfony\Component\Notifier\Bridge\LineNotify\LineNotifyTransportFactory;
36-
use Symfony\Component\Notifier\Bridge\LinkedIn\LinkedInTransportFactory;
37-
use Symfony\Component\Notifier\Bridge\Mailjet\MailjetTransportFactory;
38-
use Symfony\Component\Notifier\Bridge\Mastodon\MastodonTransportFactory;
39-
use Symfony\Component\Notifier\Bridge\Mattermost\MattermostTransportFactory;
40-
use Symfony\Component\Notifier\Bridge\Mercure\MercureTransportFactory;
41-
use Symfony\Component\Notifier\Bridge\MessageBird\MessageBirdTransportFactory;
42-
use Symfony\Component\Notifier\Bridge\MessageMedia\MessageMediaTransportFactory;
43-
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\MicrosoftTeamsTransportFactory;
44-
use Symfony\Component\Notifier\Bridge\Mobyt\MobytTransportFactory;
45-
use Symfony\Component\Notifier\Bridge\Octopush\OctopushTransportFactory;
46-
use Symfony\Component\Notifier\Bridge\OneSignal\OneSignalTransportFactory;
47-
use Symfony\Component\Notifier\Bridge\OvhCloud\OvhCloudTransportFactory;
48-
use Symfony\Component\Notifier\Bridge\PagerDuty\PagerDutyTransportFactory;
49-
use Symfony\Component\Notifier\Bridge\Plivo\PlivoTransportFactory;
50-
use Symfony\Component\Notifier\Bridge\RingCentral\RingCentralTransportFactory;
51-
use Symfony\Component\Notifier\Bridge\RocketChat\RocketChatTransportFactory;
52-
use Symfony\Component\Notifier\Bridge\Sendberry\SendberryTransportFactory;
53-
use Symfony\Component\Notifier\Bridge\Sendinblue\SendinblueTransportFactory;
54-
use Symfony\Component\Notifier\Bridge\SimpleTextin\SimpleTextinTransportFactory;
55-
use Symfony\Component\Notifier\Bridge\Sinch\SinchTransportFactory;
56-
use Symfony\Component\Notifier\Bridge\Slack\SlackTransportFactory;
57-
use Symfony\Component\Notifier\Bridge\Sms77\Sms77TransportFactory;
58-
use Symfony\Component\Notifier\Bridge\Smsapi\SmsapiTransportFactory;
59-
use Symfony\Component\Notifier\Bridge\SmsBiuras\SmsBiurasTransportFactory;
60-
use Symfony\Component\Notifier\Bridge\Smsc\SmscTransportFactory;
61-
use Symfony\Component\Notifier\Bridge\SmsFactor\SmsFactorTransportFactory;
62-
use Symfony\Component\Notifier\Bridge\SpotHit\SpotHitTransportFactory;
63-
use Symfony\Component\Notifier\Bridge\Telegram\TelegramTransportFactory;
64-
use Symfony\Component\Notifier\Bridge\Telnyx\TelnyxTransportFactory;
65-
use Symfony\Component\Notifier\Bridge\Termii\TermiiTransportFactory;
66-
use Symfony\Component\Notifier\Bridge\TurboSms\TurboSmsTransportFactory;
67-
use Symfony\Component\Notifier\Bridge\Twilio\TwilioTransportFactory;
68-
use Symfony\Component\Notifier\Bridge\Twitter\TwitterTransportFactory;
69-
use Symfony\Component\Notifier\Bridge\Vonage\VonageTransportFactory;
70-
use Symfony\Component\Notifier\Bridge\Yunpian\YunpianTransportFactory;
71-
use Symfony\Component\Notifier\Bridge\Zendesk\ZendeskTransportFactory;
72-
use Symfony\Component\Notifier\Bridge\Zulip\ZulipTransportFactory;
16+
use Symfony\Component\Notifier\Bridge;
7317
use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
7418
use Symfony\Component\Notifier\Transport\Dsn;
7519

@@ -82,63 +26,69 @@ public static function setUpBeforeClass(): void
8226
{
8327
ClassExistsMock::register(__CLASS__);
8428
ClassExistsMock::withMockedClasses([
85-
AllMySmsTransportFactory::class => false,
86-
AmazonSnsTransportFactory::class => false,
87-
BandwidthTransportFactory::class => false,
88-
ClickatellTransportFactory::class => false,
89-
ContactEveryoneTransportFactory::class => false,
90-
DiscordTransportFactory::class => false,
91-
EsendexTransportFactory::class => false,
92-
FakeChatTransportFactory::class => false,
93-
FakeSmsTransportFactory::class => false,
94-
FirebaseTransportFactory::class => false,
95-
FortySixElksTransportFactory::class => false,
96-
FreeMobileTransportFactory::class => false,
97-
GatewayApiTransportFactory::class => false,
98-
GitterTransportFactory::class => false,
99-
GoogleChatTransportFactory::class => false,
100-
InfobipTransportFactory::class => false,
101-
IqsmsTransportFactory::class => false,
102-
IsendproTransportFactory::class => false,
103-
LightSmsTransportFactory::class => false,
104-
LineNotifyTransportFactory::class => false,
105-
LinkedInTransportFactory::class => false,
106-
MailjetTransportFactory::class => false,
107-
MastodonTransportFactory::class => false,
108-
MattermostTransportFactory::class => false,
109-
MercureTransportFactory::class => false,
110-
MessageBirdTransportFactory::class => false,
111-
MessageMediaTransportFactory::class => false,
112-
MicrosoftTeamsTransportFactory::class => false,
113-
MobytTransportFactory::class => false,
114-
OctopushTransportFactory::class => false,
115-
OneSignalTransportFactory::class => false,
116-
OvhCloudTransportFactory::class => false,
117-
PagerDutyTransportFactory::class => false,
118-
PlivoTransportFactory::class => false,
119-
RingCentralTransportFactory::class => false,
120-
RocketChatTransportFactory::class => false,
121-
SendberryTransportFactory::class => false,
122-
SendinblueTransportFactory::class => false,
123-
SinchTransportFactory::class => false,
124-
SimpleTextinTransportFactory::class => false,
125-
SlackTransportFactory::class => false,
126-
Sms77TransportFactory::class => false,
127-
SmsapiTransportFactory::class => false,
128-
SmsFactorTransportFactory::class => false,
129-
SmsBiurasTransportFactory::class => false,
130-
SmscTransportFactory::class => false,
131-
SpotHitTransportFactory::class => false,
132-
TelegramTransportFactory::class => false,
133-
TelnyxTransportFactory::class => false,
134-
TermiiTransportFactory::class => false,
135-
TurboSmsTransportFactory::class => false,
136-
TwilioTransportFactory::class => false,
137-
TwitterTransportFactory::class => false,
138-
VonageTransportFactory::class => false,
139-
YunpianTransportFactory::class => false,
140-
ZendeskTransportFactory::class => false,
141-
ZulipTransportFactory::class => false,
29+
Bridge\AllMySms\AllMySmsTransportFactory::class => false,
30+
Bridge\AmazonSns\AmazonSnsTransportFactory::class => false,
31+
Bridge\Bandwidth\BandwidthTransportFactory::class => false,
32+
Bridge\Chatwork\ChatworkTransportFactory::class => false,
33+
Bridge\Clickatell\ClickatellTransportFactory::class => false,
34+
Bridge\ContactEveryone\ContactEveryoneTransportFactory::class => false,
35+
Bridge\Discord\DiscordTransportFactory::class => false,
36+
Bridge\Engagespot\EngagespotTransportFactory::class => false,
37+
Bridge\Esendex\EsendexTransportFactory::class => false,
38+
Bridge\Expo\ExpoTransportFactory::class => false,
39+
Bridge\FakeChat\FakeChatTransportFactory::class => false,
40+
Bridge\FakeSms\FakeSmsTransportFactory::class => false,
41+
Bridge\Firebase\FirebaseTransportFactory::class => false,
42+
Bridge\FortySixElks\FortySixElksTransportFactory::class => false,
43+
Bridge\FreeMobile\FreeMobileTransportFactory::class => false,
44+
Bridge\GatewayApi\GatewayApiTransportFactory::class => false,
45+
Bridge\Gitter\GitterTransportFactory::class => false,
46+
Bridge\GoogleChat\GoogleChatTransportFactory::class => false,
47+
Bridge\Infobip\InfobipTransportFactory::class => false,
48+
Bridge\Iqsms\IqsmsTransportFactory::class => false,
49+
Bridge\Isendpro\IsendproTransportFactory::class => false,
50+
Bridge\KazInfoTeh\KazInfoTehTransportFactory::class => false,
51+
Bridge\LightSms\LightSmsTransportFactory::class => false,
52+
Bridge\LineNotify\LineNotifyTransportFactory::class => false,
53+
Bridge\LinkedIn\LinkedInTransportFactory::class => false,
54+
Bridge\Mailjet\MailjetTransportFactory::class => false,
55+
Bridge\Mastodon\MastodonTransportFactory::class => false,
56+
Bridge\Mattermost\MattermostTransportFactory::class => false,
57+
Bridge\Mercure\MercureTransportFactory::class => false,
58+
Bridge\MessageBird\MessageBirdTransportFactory::class => false,
59+
Bridge\MessageMedia\MessageMediaTransportFactory::class => false,
60+
Bridge\MicrosoftTeams\MicrosoftTeamsTransportFactory::class => false,
61+
Bridge\Mobyt\MobytTransportFactory::class => false,
62+
Bridge\Octopush\OctopushTransportFactory::class => false,
63+
Bridge\OneSignal\OneSignalTransportFactory::class => false,
64+
Bridge\OrangeSms\OrangeSmsTransportFactory::class => false,
65+
Bridge\OvhCloud\OvhCloudTransportFactory::class => false,
66+
Bridge\PagerDuty\PagerDutyTransportFactory::class => false,
67+
Bridge\Plivo\PlivoTransportFactory::class => false,
68+
Bridge\Pushover\PushoverTransportFactory::class => false,
69+
Bridge\RingCentral\RingCentralTransportFactory::class => false,
70+
Bridge\RocketChat\RocketChatTransportFactory::class => false,
71+
Bridge\Sendberry\SendberryTransportFactory::class => false,
72+
Bridge\Sendinblue\SendinblueTransportFactory::class => false,
73+
Bridge\SimpleTextin\SimpleTextinTransportFactory::class => false,
74+
Bridge\Sinch\SinchTransportFactory::class => false,
75+
Bridge\Slack\SlackTransportFactory::class => false,
76+
Bridge\Sms77\Sms77TransportFactory::class => false,
77+
Bridge\Smsapi\SmsapiTransportFactory::class => false,
78+
Bridge\SmsBiuras\SmsBiurasTransportFactory::class => false,
79+
Bridge\Smsc\SmscTransportFactory::class => false,
80+
Bridge\SmsFactor\SmsFactorTransportFactory::class => false,
81+
Bridge\SpotHit\SpotHitTransportFactory::class => false,
82+
Bridge\Telegram\TelegramTransportFactory::class => false,
83+
Bridge\Telnyx\TelnyxTransportFactory::class => false,
84+
Bridge\Termii\TermiiTransportFactory::class => false,
85+
Bridge\TurboSms\TurboSmsTransportFactory::class => false,
86+
Bridge\Twilio\TwilioTransportFactory::class => false,
87+
Bridge\Twitter\TwitterTransportFactory::class => false,
88+
Bridge\Vonage\VonageTransportFactory::class => false,
89+
Bridge\Yunpian\YunpianTransportFactory::class => false,
90+
Bridge\Zendesk\ZendeskTransportFactory::class => false,
91+
Bridge\Zulip\ZulipTransportFactory::class => false,
14292
]);
14393
}
14494

0 commit comments

Comments
 (0)