ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mercure\Tests;

use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\HubRegistry;
use Symfony\Component\Notifier\Bridge\Mercure\MercureTransportFactory;
use Symfony\Component\Notifier\Exception\IncompleteDsnException;
use Symfony\Component\Notifier\Test\Abstra

 function createFactory(): MercureTransportFactory
    {
        $hub = $this->createStub(HubInterface::class);
        $hubRegistry = new HubRegistry($hub, ['hubId' => $hub]);

        return new MercureTransportFactory($hubRegistry);
    }

    public st

ctTransportFactoryTestCase;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Mathias Arlaud <mathias.arlaud@gmail.com>
 */
final class MercureTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    public


buted with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mercure\Tests;

use Symfony\Component\Mercure\Exception\InvalidArgumentException;
use Symfony\Component\Mercure\Exception\RuntimeException as MercureRuntimeException;
use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Jwt\StaticTokenProvider;
use Symfony\Component\Mercure\MockHub;
use Symfony\Component\Mercure\Update;
use Symfony\Component\Notifier\Bridge\Mercure\MercureOptions;
use Symfony\Component\Notifie

fony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Tran

r\Bridge\Mercure\MercureTransport;
use Symfony\Component\Notifier\Bridge\Mercure\Tests\Fixtures\DummyHub;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Exception\RuntimeException;
use Sym


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase;

use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfon

terface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Jeroen Spee <https://github.com/Jeroeny>
 */
final class FirebaseTransport extends AbstractTransport
{
    protected const HOST = 'fcm.googleapis.com/fcm/send';

    public func

y\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionIn


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase\Notification;

use Symfony\Component\Notifier\Bridge\Firebase\FirebaseOptions;

final class AndroidNotification extends FirebaseOptions
{
    /**
     * @return $this
     */
    public function channelId(string $channelId): static
    {
        $this->options['android_ch

 @return $this
     */
    public function sound(string $sound): static
    {
        $this->options['sound'] = $sound;

        return $this;
    }

    /**
     * @return $this
     */
    public function tag(string $tag): static
    {
        $this->opt

annel_id'] = $channelId;

        return $this;
    }

    /**
     * @return $this
     */
    public function icon(string $icon): static
    {
        $this->options['icon'] = $icon;

        return $this;
    }

    /**
     *


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase\Tests;

use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Notifier\Bridge\Firebase\FirebaseOptions;
use Symfony\Component\Notifier\Bridge\Firebase\F

stCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
 * @author Oskar Stark <oskarstark@googlemail.com>
 */
final class FirebaseT

irebaseTransport;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTe


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase\Tests\Notification;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Firebase\Notification\IOSNotification;

final class IOSNotificationTest extends TestCase
{
    public function testIOSNotificationOptions()
    {
        $notification = new IOSNoti

               'title' => 'Test Title',
                'body' => 'Test Body',
            ],
            'data' => ['key' => 'value'],
        ], $notification->toArray());

        $this->assertSame('device_token', $notification->getRecipientId());
    }

fication('device_token', [
            'title' => 'Test Title',
            'body' => 'Test Body',
        ], ['key' => 'value']);

        $this->assertSame([
            'to' => 'device_token',
            'notification' => [


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Tests\Message;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Message\SmsMessage;

/**
 * @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
 */
class SmsMessageTest extends TestCase
{
    public function testCanBeConstructed()
    {
        $message = new SmsMessage('

on testCanBeConstructedWithFrom()
    {
        $message = new SmsMessage('+3312345678', 'subject', 'foo');

        $this->assertSame('subject', $message->getSubject());
        $this->assertSame('+3312345678', $message->getPhone());
        $this->assert

+3312345678', 'subject');

        $this->assertSame('subject', $message->getSubject());
        $this->assertSame('+3312345678', $message->getPhone());
        $this->assertSame('', $message->getFrom());
    }

    public functi


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Event;

use Symfony\Component\Notifier\Message\MessageInterface;

/**
 * @author Fabien Potencier <fabien@symfony.com>
 */
class NotificationEvents
{
    private array $events = [];
    private array $transports = [];

    public function add(MessageEvent $event

;
    }

    /**
     * @return MessageEvent[]
     */
    public function getEvents(?string $name = null): array
    {
        if (null === $name) {
            return $this->events;
        }

        $events = [];
        foreach ($this->events as $even

): void
    {
        $this->events[] = $event;
        $this->transports[(string) $event->getMessage()->getTransport()] = true;
    }

    public function getTransports(): array
    {
        return array_keys($this->transports)


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mercure\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Mercure\MercureOptions;

final class MercureOptionsTest extends TestCase
{
    public function testConstructWithDefaults()
    {
        $this->assertSame([

    public function testConstructWithParameters()
    {
        $options = (new MercureOptions('/topic/1', true, 'id', 'type', 1, ['tag' => '1234', 'body' => 'TEST']));

        $this->assertSame([
            'topics' => ['/topic/1'],
            'priva

            'topics' => null,
            'private' => false,
            'id' => null,
            'type' => null,
            'retry' => null,
            'content' => null,
        ], (new MercureOptions())->toArray());
    }


ackage.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mercure\Tests\Fixtures;

use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Jwt\TokenFactoryInterface;
use Symfony\Component\Mercure\Jwt\TokenProviderInterface;
use Symfony\Component\Mercure\Update;

class DummyHub implements HubInterface
{
    public fu

tion getPublicUrl(): string
    {
    }

    public function getProvider(): TokenProviderInterface
    {
    }

    public function getFactory(): ?TokenFactoryInterface
    {
        return null;
    }

    public function publish(Update $update): string

nction getUrl(): string
    {
    }

    public func


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Jeroen Spee <https://github.com/J

     throw new UnsupportedSchemeException($dsn, 'firebase', $this->getSupportedSchemes());
        }

        $token = \sprintf('%s:%s', $this->getUser($dsn), $this->getPassword($dsn));
        $host = 'default' === $dsn->getHost() ? null : $dsn->getHost()

eroeny>
 */
final class FirebaseTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): FirebaseTransport
    {
        $scheme = $dsn->getScheme();

        if ('firebase' !== $scheme) {


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase\Tests\Notification;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Firebase\Notification\AndroidNotification;

final class AndroidNotificationTest extends TestCase
{
    public function testAndroidNotificationOptions()
    {
        $notification = new AndroidNotification('device_token', [

le',
                'body' => 'Test Body',
            ],
            'data' => ['key' => 'value'],
        ], $notification->toArray());

        $this->assertSame('device_token', $notification->getRecipientId());
    }

    public function testAndroidNo

    'title' => 'Test Title',
            'body' => 'Test Body',
        ], ['key' => 'value']);

        $this->assertSame([
            'to' => 'device_token',
            'notification' => [
                'title' => 'Test Tit


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mercure;

use Symfony\Component\Mercure\Exception\InvalidArgumentException;
use Symfony\Component\Mercure\Exception\RuntimeException as MercureRuntimeException;
use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Update;
use Symfony\Component\Notifier\Exception\RuntimeException;
use Symfony\Component\Notifier

mfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Mathias Arlaud <

\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Exception\UnsupportedOptionsException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\MessageInterface;
use Sy


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase\Notification;

use Symfony\Component\Notifier\Bridge\Firebase\FirebaseOptions;

final class IOSNotification extends FirebaseOptions
{
    /**
     * @return $this
     */
    public function sound(string $sound): static
    {
        $this->optio

* @return $this
     */
    public function clickAction(string $clickAction): static
    {
        $this->options['click_action'] = $clickAction;

        return $this;
    }

    /**
     * @return $this
     */
    public function subtitle(string $subtit

ns['sound'] = $sound;

        return $this;
    }

    /**
     * @return $this
     */
    public function badge(string $badge): static
    {
        $this->options['badge'] = $badge;

        return $this;
    }

    /**


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase\Tests;

use Symfony\Component\Notifier\Bridge\Firebase\FirebaseTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

/**
 * @author Oskar

  return new FirebaseTransportFactory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'firebase://host.test',
            'firebase://username:password@host.test',
        ];
    }

    public static functi

Stark <oskarstark@googlemail.com>
 */
final class FirebaseTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): FirebaseTransportFactory
    {


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase\Tests\Notification;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Firebase\Notification\WebNotification;

final class WebNotificationTest extends TestCase
{
    public function testWebNotificationOptions()
    {
        $notification = new WebNoti


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\SimpleTextin;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author gnito-org <https://github.com

 $dsn->getScheme();

        if (self::TRANSPORT_SCHEME !== $scheme) {
            throw new UnsupportedSchemeException($dsn, self::TRANSPORT_SCHEME, $this->getSupportedSchemes());
        }

        $apiKey = $this->getUser($dsn);
        $from = $dsn->ge

/gnito-org>
 */
final class SimpleTextinTransportFactory extends AbstractTransportFactory
{
    private const TRANSPORT_SCHEME = 'simpletextin';

    public function create(Dsn $dsn): SimpleTextinTransport
    {
        $scheme =


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\SimpleTextin\Tests;

use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Notifier\Bridge\SimpleTextin\SimpleTextinTransport;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Compon

ient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;

final class SimpleTextinTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientInterface $client = null, string $from = 'test_from'): Si

ent\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpCl


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Primotexto;

use Symfony\Component\Notifier\Message\MessageOptionsInterface;

/**
 * @author Samaël Tomas <samael.tomas@gmail.com>
 */
final class PrimotextoOptions implements MessageOptionsInterface
{
    public function __construct(

{
        $this->options['campaignName'] = $campaignName;

        return $this;
    }

    /**
     * @return $this
     */
    public function category(string $category): static
    {
        $this->options['category'] = $category;

        return $this;

 private array $options = [],
    ) {
    }

    public function getRecipientId(): ?string
    {
        return null;
    }

    /**
     * @return $this
     */
    public function campaignName(string $campaignName): static


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Primotexto;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Samaël Tomas <samael.tomas@gmai

          throw new UnsupportedSchemeException($dsn, 'primotexto', $this->getSupportedSchemes());
        }

        $apiKey = $this->getUser($dsn);
        $from = $dsn->getOption('from');
        $host = 'default' === $dsn->getHost() ? null : $dsn->getHo

l.com>
 */
final class PrimotextoTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): PrimotextoTransport
    {
        $scheme = $dsn->getScheme();

        if ('primotexto' !== $scheme) {


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Primotexto\Tests;

use Symfony\Component\Notifier\Bridge\Primotexto\PrimotextoTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

final class Pri

    public static function createProvider(): iterable
    {
        yield [
            'primotexto://host.test',
            'primotexto://apiKey@host.test',
        ];

        yield [
            'primotexto://host.test?from=TEST',
            'primote

motextoTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): PrimotextoTransportFactory
    {
        return new PrimotextoTransportFactory();
    }


buted with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego;

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Sy

bstractTransport
{
    protected const HOST = 'api.sweego.io';

    public function __construct(
        #[\SensitiveParameter] private readonly string $apiKey,
        private readonly string $region,
        private readonly string $campaignType,

mfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Mathieu Santostefano <msantostefano@protonmail.com>
 */
final class SweegoTransport extends A


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego\Tests;

use Symfony\Component\Notifier\Bridge\Sweego\SweegoTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTestTrait;

final class SweegoTransportFacto

nction createProvider(): iterable
    {
        yield [
            'sweego://host.test?region=REGION&campaign_type=CAMPAIGN_TYPE&bat=0&shorten_urls=1&shorten_with_protocol=1',
            'sweego://apiKey@host.test?region=REGION&campaign_type=CAMPAIGN_TYP

ryTest extends AbstractTransportFactoryTestCase
{
    use MissingRequiredOptionTestTrait;

    public function createFactory(): SweegoTransportFactory
    {
        return new SweegoTransportFactory();
    }

    public static fu


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego\Tests\Webhook;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Notifier\Bridge\Sweego\Webhook\SweegoRequestParser;
use Symfony\Component\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Te

    protected function createRequest(string $payload): Request
    {
        return Request::create('/', 'POST', [], [], [], [
            'Content-Type' => 'application/json',
            'HTTP_webhook-id' => 'a5ccc627-6e43-4012-bb29-f1bfe3a3d13e',

st\AbstractRequestParserTestCase;

class SweegoRequestParserTest extends AbstractRequestParserTestCase
{
    protected function createRequestParser(): RequestParserInterface
    {
        return new SweegoRequestParser();
    }


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego\Webhook;

use Symfony\Component\HttpFoundation\ChainRequestMatcher;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcher\HeaderRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\IsJsonRequestMatcher;
use Symfony\

tParser;
use Symfony\Component\Webhook\Exception\RejectWebhookException;

/**
 * @author Mathieu Santostefano <msantostefano@protonmail.com>
 *
 * @see https://learn.sweego.io/docs/webhooks/sms_events
 */
final class SweegoRequestParser extends AbstractReq

Component\HttpFoundation\RequestMatcher\MethodRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\RemoteEvent\Event\Sms\SmsEvent;
use Symfony\Component\Webhook\Client\AbstractReques


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mobyt;

use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;
use Symfony\Component\Notifier\Notification\Notification;

/**
 * @author Bastien Durand <bdurand-dev@outlook.com>
 */
final class MobytOption

    private array $options = [],
    ) {
        if (isset($options['message_type'])) {
            self::validateMessageType($options['message_type']);
        }
    }

    public static function fromNotification(Notification $notification): self
    {

s implements MessageOptionsInterface
{
    public const MESSAGE_TYPE_QUALITY_HIGH = 'N';
    public const MESSAGE_TYPE_QUALITY_MEDIUM = 'L';
    public const MESSAGE_TYPE_QUALITY_LOW = 'LL';

    public function __construct(


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Firebase;

use Symfony\Component\Notifier\Message\MessageOptionsInterface;

/**
 * @author Jeroen Spee <https://github.com/Jeroeny>
 *
 * @see https://firebase.google.com/docs/cloud-messaging/xmpp-server-ref.html
 */
abstract class FirebaseOptions impleme

private string $to,
        array $options,
        private array $data = [],
    ) {
        $this->options = $options;
    }

    public function toArray(): array
    {
        return [
            'to' => $this->to,
            'notification' => $this->

nts MessageOptionsInterface
{
    /**
     * @see https://firebase.google.com/docs/cloud-messaging/xmpp-server-ref.html#notification-payload-support
     */
    protected array $options;

    public function __construct(


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Event;

use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
 * @author Smaïne Milianni <smaine.milianni@gmail.com>
 */
final class FailedMessageEvent extends Event
{
    public function _

      private MessageInterface $message,
        private \Throwable $error,
    ) {
    }

    public function getMessage(): MessageInterface
    {
        return $this->message;
    }

    public function getError(): \Throwable
    {
        return $this-


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\SimpleTextin\Tests;

use Symfony\Component\Notifier\Bridge\SimpleTextin\SimpleTextinTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

final cla

ry();
    }

    public static function createProvider(): iterable
    {
        yield ['simpletextin://host.test', 'simpletextin://ApiKey@host.test'];
        yield ['simpletextin://host.test?from=15556667777', 'simpletextin://ApiKey@host.test?from=155566

ss SimpleTextinTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): SimpleTextinTransportFactory
    {
        return new SimpleTextinTransportFacto


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Primotexto;

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\No

*
 * @author Samaël Tomas <samael.tomas@gmail.com>
 */
final class PrimotextoTransport extends AbstractTransport
{
    protected const HOST = 'api.primotexto.com';

    public function __construct(
        #[\SensitiveParameter]
        private string $api

tifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/*


he Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Primotexto\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Primotexto\PrimotextoOptions;

class PrimotextoOptionsTest extends TestCase
{
    public function testPrimotextoOptions()
    {
        $primotextoOptions = (new PrimotextoOpti

      ->category('test_category')
            ->campaignName('test_campaign_name');

        self::assertSame([
            'date' => 1714121739,
            'category' => 'test_category',
            'campaignName' => 'test_campaign_name',
        ], $pri


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Notifier\Bridge\Sweego\SweegoOptions;
use Symfony\Component\Notifier\Bridge\Sweego\SweegoTransport;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\

nent\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class SweegoTransportTest extends TransportTestCase
{
    public static function createTransport

Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Compo


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mobyt;

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifie

@author Basien Durand <bdurand-dev@outlook.com>
 */
final class MobytTransport extends AbstractTransport
{
    protected const HOST = 'app.mobyt.fr';

    private string $typeQuality;

    public function __construct(
        private string $accountSid,

r\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 *


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OrangeSms;

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Not

nst HOST = 'api.orange.com';

    public function __construct(
        private string $clientID,
        #[\SensitiveParameter] private string $clientSecret,
        private string $from,
        private ?string $senderName = null,
        ?HttpClientInter

ifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class OrangeSmsTransport extends AbstractTransport
{
    protected co


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Mathieu Santostefano <msantostefano@protonmail.c

 new UnsupportedSchemeException($dsn, 'sweego', $this->getSupportedSchemes());
        }

        $apiKey = $this->getUser($dsn);
        $region = $dsn->getRequiredOption(SweegoOptions::REGION);
        $campaignType = $dsn->getRequiredOption(SweegoOption

om>
 */
final class SweegoTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): SweegoTransport
    {
        $scheme = $dsn->getScheme();

        if ('sweego' !== $scheme) {
            throw


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Primotexto;

enum PrimotextoErrorCode: int
{
    case NO_PHONE_NUMBER_PROVIDED = 10;
    case INVALID_PHONE_NUMBER_SYNTAX = 11;
    case NUMBER_BLACKLISTED_UNSUBSCRIBED = 12;
    case NUMBER_BLACKLISTED_USER_BOUNCE = 13;
    case NUMBER_BLACKLISTED_GLOBAL_BOUNCE = 14;
    case NUM

e SENDER_TOO_SHORT = 21;
    case SENDER_TOO_LONG = 22;
    case FULL_NUMERIC_SENDER_NOT_ALLOWED = 23;
    case NO_MESSAGE_CONTENT_PROVIDED = 30;
    case INVALID_CHARACTERS_IN_MESSAGE = 31;
    case MESSAGE_CONTENT_TOO_LONG = 32;
    case INVALID_CAMPAIGN

BER_ALREADY_EXISTS = 15;
    case NO_MESSAGE_FOR_THIS_QUERY = 16;
    case TOO_MANY_FIELDS_SELECTED = 17;
    case FILE_TOO_LARGE = 18;
    case PHONE_NUMBER_IS_FIXED_LINE = 19;
    case INVALID_CHARACTERS_IN_SENDER = 20;
    cas


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mobyt\Tests;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Mobyt\MobytOptions;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Notification\Notification;

final class MobytOptionsTest extends TestCase
{
    #[D

tions = MobytOptions::fromNotification($notification)->toArray();

        $this->assertSame($expectedMessageType, $options['message_type']);
    }

    /**
     * @return \Generator<array{0: string, 1: string}>
     */
    public static function fromNotif

ataProvider('fromNotificationDataProvider')]
    public function testFromNotification(string $importance, string $expectedMessageType)
    {
        $notification = (new Notification('Foo'))->importance($importance);

        $op


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mobyt\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Notifier\Bridge\Mobyt\MobytOptions;
use Symfony\Component\Notifier\Bridge\Mobyt\MobytTransport;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\

skarstark@googlemail.com>
 */
final class MobytTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientInterface $client = null, string $messageType = MobytOptions::MESSAGE_TYPE_QUALITY_LOW): MobytTransport
    {

Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Oskar Stark <o


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\JoliNotif;

use Joli\JoliNotif\DefaultNotifier as JoliNotifier;
use Joli\JoliNotif\Notification as JoliNotification;
use Symfony\Component\Notifier\Exception\RuntimeException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Exception\UnsupportedOptionsException;
use Symfony\

acts\EventDispatcher\EventDispatcherInterface;

/**
 * @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
 */
final class JoliNotifTransport extends AbstractTransport
{
    public function __construct(
        private readonly JoliNotifier $joliNotifier,

Component\Notifier\Message\DesktopMessage;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contr


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\JoliNotif;

use Joli\JoliNotif\DefaultNotifier as JoliNotifier;
use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Trans

oliNotifTransport
    {
        if (self::SCHEME_NAME !== $dsn->getScheme()) {
            throw new UnsupportedSchemeException($dsn, self::SCHEME_NAME, $this->getSupportedSchemes());
        }

        return (new JoliNotifTransport(new JoliNotifier(), $t

port\Dsn;

/**
 * @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
 */
final class JoliNotifTransportFactory extends AbstractTransportFactory
{
    private const SCHEME_NAME = 'jolinotif';

    public function create(Dsn $dsn): J


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\JoliNotif\Tests;

use Joli\JoliNotif\DefaultNotifier as JoliNotifier;
use Symfony\Component\Notifier\Bridge\JoliNotif\JoliNotifOptions;
use Symfony\Component\Notifier\Bridge\JoliNotif\JoliNotifTransport;
use Symfony\Component\Notifier\Message\ChatMessage;

*
 * @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
 */
final class JoliNotifTransportTest extends TransportTestCase
{
    public static function toStringProvider(): iterable
    {
        yield ['jolinotif://localhost', self::createTransport()];
    }

use Symfony\Component\Notifier\Message\DesktopMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/*


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sinch;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Iliya Miroslavov Iliev <i.miroslavov

throw new UnsupportedSchemeException($dsn, 'sinch', $this->getSupportedSchemes());
        }

        $accountSid = $this->getUser($dsn);
        $authToken = $this->getPassword($dsn);
        $from = $dsn->getRequiredOption('from');
        $host = 'defau

@gmail.com>
 */
final class SinchTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): SinchTransport
    {
        $scheme = $dsn->getScheme();

        if ('sinch' !== $scheme) {


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sinch\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Notifier\Bridge\Sinch\SinchTransport;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Comp

ic function createTransport(?HttpClientInterface $client = null): SinchTransport
    {
        return new SinchTransport('accountSid', 'authToken', 'sender', $client ?? new MockHttpClient());
    }

    public static function toStringProvider(): iterable

onent\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class SinchTransportTest extends TransportTestCase
{
    public stat


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Bluesky;

use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\Clock\ClockInterface;
use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\

kyTransportFactory extends AbstractTransportFactory
{
    public function __construct(
        ?EventDispatcherInterface $dispatcher = null,
        ?HttpClientInterface $client = null,
        private ?LoggerInterface $logger = null,
        private reado

Component\Notifier\Transport\Dsn;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Tobias Nyholm <tobias.nyholm@gmail.com>
 */
final class Blues


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Bluesky\Tests;

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

class BlueskyTransportFa

ion createProvider(): iterable
    {
        yield [
            'bluesky://bsky.social',
            'bluesky://user:pass@bsky.social',
        ];
    }

    public static function supportsProvider(): iterable
    {
        yield [true, 'bluesky://foo:bar

ctoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): BlueskyTransportFactory
    {
        return new BlueskyTransportFactory();
    }

    public static funct


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord;

use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component

e Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Mathieu Piot <math.piot@gmail.com>
 * @author Tomas Norkūnas <norkunas.tom@gmail.com>
 */
final class DiscordBotTransport extends AbstractTransport
{
    protected const HOST = 'discord.co

\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
us


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego\Tests\Webhook;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Notifier\Bridge\Sweego\Webhook\SweegoRequestParser;
use Symfony\Component\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exceptio

tParserInterface
    {
        $this->expectException(RejectWebhookException::class);
        $this->expectExceptionMessage('Invalid signature.');

        return new SweegoRequestParser();
    }

    protected function createRequest(string $payload): Requ

n\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;

class SweegoWrongSignatureRequestParserTest extends AbstractRequestParserTestCase
{
    protected function createRequestParser(): Reques


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sweego;

use Symfony\Component\Notifier\Message\MessageOptionsInterface;

class SweegoOptions implements MessageOptionsInterface
{
    public const REGION = 'region';
    public const BAT = 'bat';
    public const CAMPAIGN_TYPE = 'campaign_type';
    publ

{
    }

    public function toArray(): array
    {
        return $this->options;
    }

    public function getRecipientId(): ?string
    {
        return null;
    }

    public function bat(bool $bat): self
    {
        $this->options[self::BAT] = $ba

ic const CAMPAIGN_ID = 'campaign_id';
    public const SHORTEN_URLS = 'shorten_urls';
    public const SHORTEN_WITH_PROTOCOL = 'shorten_with_protocol';

    public function __construct(
        private array $options = [],
    )


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\JoliNotif\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\JoliNotif\JoliNotifOptions;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;

/**
 * @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
 *

'subtitle', 'This is a subtitle');
        $joliOptions->setExtraOption('sound', 'Frog');

        $this->assertSame([
            'icon_path' => '/sample/icon/path',
            'extra_options' => [
                'subtitle' => 'This is a subtitle',

/
class JoliNotifOptionsTest extends TestCase
{
    public function testToArray()
    {
        $joliOptions = new JoliNotifOptions();

        $joliOptions->setIconPath('/sample/icon/path');
        $joliOptions->setExtraOption(


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\JoliNotif\Tests;

use Symfony\Component\Notifier\Bridge\JoliNotif\JoliNotifTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;

/**
 * @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
 */
final class

ion=true',
        ];
    }

    public static function supportsProvider(): iterable
    {
        yield [true, 'jolinotif://host.test'];
        yield [false, 'somethingElse://host.test'];
    }

    public static function unsupportedSchemeProvider(): ite

JoliNotifTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    public static function createProvider(): iterable
    {
        yield [
            'jolinotif://host.test',
            'jolinotif://host.test?some_opt


ny\Component\Mime\Part\File;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Component\String\AbstractString;
use Symfony\Component\String\ByteString;
use Symfony\Contracts\EventDispatcher\Eve

author Tobias Nyholm <tobias.nyholm@gmail.com>
 */
final class BlueskyTransport extends AbstractTransport
{
    private array $authSession = [];
    private ClockInterface $clock;

    public function __construct(
        #[\SensitiveParameter] private str

ntDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @


se Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Mime\Part\File;
use Symfony\Component\Notifier\Bridge\Bluesky\BlueskyOptions;
use Symfony\Component\Notifier\Bridge\Bluesky\BlueskyTransport;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\N

clock;

    protected function setUp(): void
    {
        self::$clock = new MockClock(new \DateTimeImmutable('@1714293617'));
    }

    public static function createTransport(?HttpClientInterface $client = null): BlueskyTransport
    {
        $blueskyT

otifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class BlueskyTransportTest extends TransportTestCase
{
    private static $


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\JoliNotif;

use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;

/**
 * @author Ahmed Ghanem <ahmedghanem7361@gmail.com>
 */
final class JoliNotifOptions implements MessageOptionsInterface
{
    public

        'extra_options' => $this->extraOptions,
        ];
    }

    public function getRecipientId(): ?string
    {
        return null;
    }

    /**
     * @return $this
     */
    public function setIconPath(string $iconPath): static
    {
        $

function __construct(
        private ?string $iconPath = null,
        private array $extraOptions = [],
    ) {
    }

    public function toArray(): array
    {
        return [
            'icon_path' => $this->iconPath,


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sinch\Tests;

use Symfony\Component\Notifier\Bridge\Sinch\SinchTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingR

tFactory
    {
        return new SinchTransportFactory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'sinch://host.test?from=0611223344',
            'sinch://accountSid:authToken@host.test?from=06112233

equiredOptionTestTrait;

final class SinchTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;
    use MissingRequiredOptionTestTrait;

    public function createFactory(): SinchTranspor


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Bluesky;

use Symfony\Component\Mime\Part\File;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;

final class BlueskyOptions implements MessageOptionsInterface
{
    public function __construct(
        private array $options =

function attachMedia(File $file, string $description = ''): static
    {
        $this->options['attach'][] = [
            'file' => $file,
            'description' => $description,
        ];

        return $this;
    }

    public function attachCard(

 [],
    ) {
    }

    public function toArray(): array
    {
        return $this->options;
    }

    public function getRecipientId(): ?string
    {
        return null;
    }

    /**
     * @return $this
     */
    public


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mobyt\Tests;

use Symfony\Component\Notifier\Bridge\Mobyt\MobytTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

/**
 * @author Oskar Stark <oskarstark@goog

actory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'mobyt://host.test?from=FROM&type_quality=LL',
            'mobyt://accountSid:authToken@host.test?from=FROM',
        ];

        yield [

lemail.com>
 */
final class MobytTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): MobytTransportFactory
    {
        return new MobytTransportF


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord;

use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordEmbedInterface;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;

/**
 * @author Karoly Gossler <connor@connor.hu>
 * @author Tomas Norkūna

rivate array $options = [],
    ) {
    }

    public function toArray(): array
    {
        return $this->options;
    }

    /**
     * @param non-empty-string $id
     *
     * @return $this
     */
    public function recipient(string $id): static

s <norkunas.tom@gmail.com>
 */
final class DiscordOptions implements MessageOptionsInterface
{
    /**
     * @var non-empty-string|null
     */
    private ?string $recipientId = null;

    public function __construct(
        p


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Sinch;

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifie

\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Iliya Miroslavov Iliev <i.miroslavov@gmail.com>
 */
final class SinchTransport extends AbstractTransport
{
    protected const HOST = 'sms.api.sinch.com';

    public function __construct(

r\Message\SmsMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;
use Symfony\Component\Notifier\Transport\TransportInterface;

/

ce
    {
        $scheme = $dsn->getScheme();

        if ('discord' === $scheme) {
            $token = $this->getUser($dsn);
            $webhookId = $dsn->getRequiredOption('webhook_id');
            $host = 'default' === $dsn->getHost() ? null : $dsn->

**
 * @author Mathieu Piot <math.piot@gmail.com>
 * @author Tomas Norkūnas <norkunas.tom@gmail.com>
 */
final class DiscordTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): TransportInterfa


ony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Embeds;

/**
 * @author Karoly Gossler <connor@connor.hu>
 */
final class DiscordFieldEmbedObject extends AbstractDiscordEmbedObject
{
    /**
     * @return $this
     */
    public function name(string $name): static
    {
        $this->options['name'] = $name;

        return $this;
    }

    /**
     * @retur

lue): static
    {
        $this->options['value'] = $value;

        return $this;
    }

    /**
     * @return $this
     */
    public function inline(bool $inline): static
    {
        $this->options['inline'] = $inline;

        return $this;
    }

n $this
     */
    public function value(string $va


hp

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Embeds;

/**
 * @author Karoly Gossler <connor@connor.hu>
 */
class DiscordMediaEmbedObject extends AbstractDiscordEmbedObject
{
    /**
     * @return $this
     */
    public function url(string $url): static
    {

    }

    /**
     * @return $this
     */
    public function height(int $height): static
    {
        $this->options['height'] = $height;

        return $this;
    }

    /**
     * @return $this
     */
    public function width(int $width): static

$this->options['url'] = $url;

        return $this;
    }

    /**
     * @return $this
     */
    public function proxyUrl(string $proxyUrl): static
    {
        $this->options['proxy_url'] = $proxyUrl;

        return $this;


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Notifier\Bridge\Discord\DiscordBotTransport;
use Symfony\Component\Notifier\Bridge\Discord\DiscordOptions;
use Symfony\Component\Notif

\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class DiscordBotTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientIn

ier\Exception\LogicException;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Notifier\Bridge\Discord\DiscordTransport;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Mess

terface;

final class DiscordTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientInterface $client = null): DiscordTransport
    {
        return (new DiscordTransport('testToken', 'testWebhookId', $client ?? new

age\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientIn


hp

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests\Embeds;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordEmbed;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFieldEmbedObject;

final class DiscordEmbedTest ext

      ->name('baz')
                ->value('qux')
            );

        $this->assertSame([
            'title' => 'foo',
            'description' => 'bar',
            'fields' => [
                [
                    'name' => 'baz',

ends TestCase
{
    public function testCanBeInstantiated()
    {
        $embed = (new DiscordEmbed())
            ->title('foo')
            ->description('bar')
            ->addField((new DiscordFieldEmbedObject())


he Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests\Embeds;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFooterEmbedObject;

final class DiscordFooterEmbedObjectTest extends TestCase
{
    public function testCanBeInstantiated()
    {
        $author = (n

oo')
            ->iconUrl('http://icon-ur.l')
            ->proxyIconUrl('http://proxy-icon-ur.l');

        $this->assertSame([
            'text' => 'foo',
            'icon_url' => 'http://icon-ur.l',
            'proxy_icon_url' => 'http://proxy-icon-

ew DiscordFooterEmbedObject())
            ->text('f


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Novu;

use Symfony\Component\Notifier\Recipient\RecipientInterface;

/**
 * @author Wouter van der Loop <woutervdl@toppy.nl>
 */
class NovuSubscriberRecipient implements RecipientInterface
{
    /**
     * @param array{
     *            email?: array{

  } $overrides
     *
     * @see https://docs.novu.co/channels/email/#sending-email-overrides
     */
    public function __construct(
        private readonly string $subscriberId,
        private readonly ?string $firstName = null,
        private reado

   *                from?: string,
     *                senderName?: string,
     *                replyTo?: string,
     *                cc?: string[],
     *                bcc?: string[]
     *            }|null
     *


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Novu;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Wouter van der Loop <woutervdl@

reate(Dsn $dsn): NovuTransport
    {
        $scheme = $dsn->getScheme();
        if (self::SCHEME !== $scheme) {
            throw new UnsupportedSchemeException($dsn, self::SCHEME, $this->getSupportedSchemes());
        }

        $key = $this->getUser($

toppy.nl>
 */
class NovuTransportFactory extends AbstractTransportFactory
{
    private const SCHEME = 'novu';

    protected function getSupportedSchemes(): array
    {
        return [self::SCHEME];
    }

    public function c


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Novu\Tests;

use Symfony\Component\Notifier\Bridge\Novu\NovuTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Tra

 NovuTransportFactory();
    }

    public static function supportsProvider(): iterable
    {
        yield [true, 'novu://host'];
        yield [false, 'somethingElse://host'];
    }

    public static function createProvider(): iterable
    {
        yie

nsport\TransportFactoryInterface;

class NovuTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): TransportFactoryInterface
    {
        return new


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OneSignal;

use Symfony\Component\Notifier\Message\MessageOptionsInterface;
use Symfony\Component\Notifier\Notification\Notification;

/**
 * @author Tomas Norkūnas <norkunas.tom@gmail.com>
 */
final class OneSignalOptions implements MessageOptionsInterface
{
    public function __construct(
        private array $options = [],

)]);
        $options->contents(['en' => $notification->getContent()]);

        return $options;
    }

    /**
     * @return $this
     */
    public function headings(array $headings): static
    {
        $this->options['headings'] = $headings;

  ) {
    }

    /**
     * @return $this
     */
    public static function fromNotification(Notification $notification): static
    {
        $options = new self();
        $options->headings(['en' => $notification->getSubject(


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Novu\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Notifier\Bridge\Novu\NovuOptions;
use Symfony\Component\Notifier\Bridge\Novu\NovuTransport;
use Symfony\Component\Notifier\Exception\Transpor

;
use Symfony\Component\Notifier\Transport\TransportInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

class NovuTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientInterface $client = null): Trans

tException;
use Symfony\Component\Notifier\Message\PushMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage


buted with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OneSignal\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Notifier\Bridge\OneSignal\OneSignalOptions;
use Symfony\Component\Notifier\Bridge\OneSignal\OneSignalTransport;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Message\ChatMessage;
use

ontracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
 * @author Tomas Norkūnas <norkunas.tom@gmail.com>
 */
final class OneSignalTransportTest extends TransportTestCase
{
    public static function createTranspo

 Symfony\Component\Notifier\Message\PushMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\C


hp

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Embeds;

/**
 * @author Karoly Gossler <connor@connor.hu>
 */
final class DiscordAuthorEmbedObject extends AbstractDiscordEmbedObject
{
    /**
     * @return $this
     */
    public function name(string $name): static
    {

  /**
     * @return $this
     */
    public function iconUrl(string $iconUrl): static
    {
        $this->options['icon_url'] = $iconUrl;

        return $this;
    }

    /**
     * @return $this
     */
    public function proxyIconUrl(string $proxyIc

        $this->options['name'] = $name;

        return $this;
    }

    /**
     * @return $this
     */
    public function url(string $url): static
    {
        $this->options['url'] = $url;

        return $this;
    }


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OneSignal\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\OneSignal\OneSignalOptions;

final class OneSignalOptionsTest extends TestCase
{
    public function testOneSignalOptions()
    {
        $oneSignalOption

         ->data(['foo' => 'bar'])
            ->sendAfter(new \DateTimeImmutable('Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)'))
            ->externalId('d637f30d-f709-4bed-9e2c-63637cb91894')
            ->isExternalUserId();

        $this->assertSame([

s = (new OneSignalOptions())
            ->headings(['en' => 'English Heading', 'fr' => 'French Heading'])
            ->contents(['en' => 'English Content', 'fr' => 'French Content'])
            ->url('https://example.com')


n Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Embeds;

/**
 * @author Karoly Gossler <connor@connor.hu>
 */
final class DiscordFooterEmbedObject extends AbstractDiscordEmbedObject
{
    /**
     * @return $this
     */
    public function text(string $text): static
    {
        $this->options['text'] = $text;

        return $this;

function iconUrl(string $iconUrl): static
    {
        $this->options['icon_url'] = $iconUrl;

        return $this;
    }

    /**
     * @return $this
     */
    public function proxyIconUrl(string $proxyIconUrl): static
    {
        $this->options['p

 }

    /**
     * @return $this
     */
    public


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests;

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

       return new DiscordTransportFactory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'discord://host.test?webhook_id=testWebhookId',
            'discord://token@host.test?webhook_id=testWebhookId',

it;

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

    public function createFactory(): DiscordTransportFactory
    {


n Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests\Embeds;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordAuthorEmbedObject;

final class DiscordAuthorEmbedObjectTest extends TestCase
{
    public function testCanBeInstantiated()
    {
        $author = (new DiscordAuthorEmbedObject())

')
            ->iconUrl('http://icon-ur.l')
            ->proxyIconUrl('http://proxy-icon-ur.l');

        $this->assertSame([
            'name' => 'Doe',
            'url' => 'http://ur.l',
            'icon_url' => 'http://icon-ur.l',
            'prox

        ->name('Doe')
            ->url('http://ur.l


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Novu;

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\TransportExceptionInterface;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\PushMessage;
use Symfony

uthor Wouter van der Loop <woutervdl@toppy.nl>
 */
class NovuTransport extends AbstractTransport
{
    protected const HOST = 'web.novu.co';

    public function __construct(
        #[\SensitiveParameter] protected string $apiKey,
        ?HttpClientInter

\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @a


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OneSignal;

use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\PushMessage;
use Symfony\Compone

use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Tomas Norkūnas <norkunas.tom@gmail.com>
 */
final class OneSignalTransport extends AbstractTransport
{
    protected const HOST = 'onesignal.com';

    public function __construct(

nt\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OneSignal\Tests;

use Symfony\Component\Notifier\Bridge\OneSignal\OneSignalTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

/**
 * @author Tom

       return new OneSignalTransportFactory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'onesignal://app_id@host.test',
            'onesignal://app_id:api_key@host.test',
        ];
    }

    public s

as Norkūnas <norkunas.tom@gmail.com>
 */
final class OneSignalTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): OneSignalTransportFactory
    {


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Embeds;

/**
 * @author Karoly Gossler <connor@connor.hu>
 */
final class DiscordEmbed extends AbstractDiscordEmbed
{
    /**
     * @return $this
     */
    public function title(string $title): static
    {
        $this->options['title'] = $title;

        return $this

  */
    public function url(string $url): static
    {
        $this->options['url'] = $url;

        return $this;
    }

    /**
     * @return $this
     */
    public function timestamp(\DateTimeInterface $timestamp): static
    {
        $this->optio

;
    }

    /**
     * @return $this
     */
    public function description(string $description): static
    {
        $this->options['description'] = $description;

        return $this;
    }

    /**
     * @return $this


s part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests\Embeds;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFieldEmbedObject;

final class DiscordFieldEmbedObjectTest extends TestCase
{
    public function testCanBeInstantiated()
    {
        $fi

cordFieldEmbedObject())
            ->name('foo')
            ->value('bar')
            ->inline(true);

        $this->assertSame([
            'name' => 'foo',
            'value' => 'bar',
            'inline' => true,
        ], $field->toArray());


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Novu\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Novu\NovuOptions;

class NovuOptionsTest extends TestCase
{
    public function testToArray()
    {
        $options = new NovuOptions(
            123,

        'senderName' => 'No-Reply',
                ],
            ],
            [],
        );

        $this->assertSame(
            [
                'firstName' => 'Joe',
                'lastName' => 'Smith',
                'email' => 'test@example

      'Joe',
            'Smith',
            'test@example.com',
            null,
            null,
            null,
            [
                'email' => [
                    'from' => 'no-reply@example.com',


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Octopush;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Aurélien Martin <pro@aurelienmart

     throw new UnsupportedSchemeException($dsn, 'octopush', $this->getSupportedSchemes());
        }

        $userLogin = urlencode($this->getUser($dsn));
        $apiKey = $this->getPassword($dsn);
        $from = $dsn->getRequiredOption('from');

in.com>
 */
final class OctopushTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): OctopushTransport
    {
        $scheme = $dsn->getScheme();

        if ('octopush' !== $scheme) {


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Octopush\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Notifier\Bridge\Octopush\OctopushTransport;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Sym

 public static function createTransport(?HttpClientInterface $client = null): OctopushTransport
    {
        return new OctopushTransport('userLogin', 'apiKey', 'from', 'type', $client ?? new MockHttpClient());
    }

    public static function toStringPr

fony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class OctopushTransportTest extends TransportTestCase
{


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Prelude;

use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Exception\UnsupportedOptionsException;
use Symfony\Component\Notifier\Message\MessageInterface;
use

ymfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * @author Imad Zairig <imadzairig@gmail.com>
 */
final class PreludeTransport extends AbstractTransport
{
    protected const HOS

 Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use S


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Prelude\Tests;

use Symfony\Component\Notifier\Bridge\Prelude\PreludeTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

final class PreludeTrans

 function createProvider(): iterable
    {
        yield [
            'prelude://host.test?sender=0611223344',
            'prelude://apiKey@host.test?sender=0611223344',
        ];
    }

    public static function supportsProvider(): iterable
    {

portFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): PreludeTransportFactory
    {
        return new PreludeTransportFactory();
    }

    public static


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Novu;

use Symfony\Component\Notifier\Message\MessageOptionsInterface;

/**
 * @author Wouter van der Loop <woutervdl@toppy.nl>
 */
class NovuOptions implements MessageOptionsInterface
{
    /**
     * @param array{
     *            email?: array{
     *

$overrides
     *
     * @see https://docs.novu.co/channels/email/#sending-email-overrides
     */
    public function __construct(
        private readonly ?string $subscriberId = null,
        private readonly ?string $firstName = null,
        private r

                from?: string,
     *                senderName?: string,
     *                replyTo?: string,
     *                cc?: string[],
     *                bcc?: string[]
     *            }|null
     *        }


buted with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Discord\Tests;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\DiscordOptions;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordAuthorEmbedObject;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordEmbed;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFooterEmbedObject;
use Symfony\Component\Notifier\Bridge\Discord\Embeds

avatarUrl('http://ava.tar/pic.png')
            ->tts(true);

        $this->assertSame([
            'username' => 'name of the bot',
            'avatar_url' => 'http://ava.tar/pic.png',
            'tts' => true,
        ], $discordOptions->toArray());

\DiscordMediaEmbedObject;

final class DiscordOptionsTest extends TestCase
{
    public function testDiscordOptions()
    {
        $discordOptions = (new DiscordOptions())
            ->username('name of the bot')
            ->


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OrangeSms\Tests;

use Symfony\Component\Notifier\Bridge\OrangeSms\OrangeSmsTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionT

ry
    {
        return new OrangeSmsTransportFactory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'orange-sms://host.test?from=FROM&sender_name=SENDER_NAME',
            'orange-sms://CLIENT_ID:CLIENT_S

estTrait;

final class OrangeSmsTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;
    use MissingRequiredOptionTestTrait;

    public function createFactory(): OrangeSmsTransportFacto


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Octopush;

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Noti

 * @author Aurélien Martin <pro@aurelienmartin.com>
 */
final class OctopushTransport extends AbstractTransport
{
    protected const HOST = 'www.octopush-dm.com';

    public function __construct(
        private string $userLogin,
        #[\SensitivePar

fier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Octopush\Tests;

use Symfony\Component\Notifier\Bridge\Octopush\OctopushTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;
use Symfony\Component\Notifier\Test\MissingRequiredOptionTest

  {
        return new OctopushTransportFactory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'octopush://host.test?from=Heyliot&type=FR',
            'octopush://userLogin:apiKey@host.test?from=Heyliot&t

Trait;

final class OctopushTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;
    use MissingRequiredOptionTestTrait;

    public function createFactory(): OctopushTransportFactory


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Prelude;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Imad <imadzairig@gmail.com>
 */
fi

supportedSchemeException($dsn, 'prelude', $this->getSupportedSchemes());
        }

        $apiKey = $this->getUser($dsn);
        $sender = $dsn->getOption('sender'); // Sender might be optional if configured in Prelude dashboard
        $host = 'default

nal class PreludeTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): PreludeTransport
    {
        $scheme = $dsn->getScheme();

        if ('prelude' !== $scheme) {
            throw new Un


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OneSignal;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

/**
 * @author Tomas Norkūnas <norkunas.tom@gma

dSchemeException($dsn, 'onesignal', $this->getSupportedSchemes());
        }

        $appId = $this->getUser($dsn);
        $apiKey = $this->getPassword($dsn);
        $defaultRecipientId = $dsn->getOption('defaultRecipientId');
        $host = 'default'

il.com>
 */
final class OneSignalTransportFactory extends AbstractTransportFactory
{
    public function create(Dsn $dsn): OneSignalTransport
    {
        if ('onesignal' !== $dsn->getScheme()) {
            throw new Unsupporte


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OrangeSms;

use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\Dsn;

final class OrangeSmsTransportFactory extends A

-sms', $this->getSupportedSchemes());
        }

        $user = $this->getUser($dsn);
        $password = $this->getPassword($dsn);
        $from = $dsn->getRequiredOption('from');
        $senderName = $dsn->getOption('sender_name');
        $host = 'def

bstractTransportFactory
{
    public function create(Dsn $dsn): OrangeSmsTransport
    {
        $scheme = $dsn->getScheme();

        if ('orange-sms' !== $scheme) {
            throw new UnsupportedSchemeException($dsn, 'orange


ge.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Prelude;

use Symfony\Component\Notifier\Message\MessageOptionsInterface;

/**
 * @author Imad Zairig <imadzairig@gmail.com>
 */
final class PreludeOptions implements MessageOptionsInterface
{
    public function __construct(
        private array $options = [],
    ) {
    }

ing $templateId): static
    {
        $this->options['template_id'] = $templateId;

        return $this;
    }

    /**
     * @return $this
     */
    public function variables(array $variables): static
    {
        $this->options['variables'] = $vari

 public function toArray(): array
    {
        return $this->options;
    }

    public function getRecipientId(): ?string
    {
        return null;
    }

    /**
     * @return $this
     */
    public function templateId(str


 This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\OrangeSms\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Notifier\Bridge\OrangeSms\OrangeSmsTransport;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use

    public static function createTransport(?HttpClientInterface $client = null): OrangeSmsTransport
    {
        return (new OrangeSmsTransport('CLIENT_ID', 'CLIENT_SECRET', 'FROM', 'SENDER_NAME', $client ?? new MockHttpClient()))->setHost('host.test');

Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class OrangeSmsTransportTest extends TransportTestCase
{


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Prelude\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
use Symfony\Component\Notifier\Bridge\Prelude\PreludeOptions;
use Symfony\Component\Notifier\Bridge\Prelude\PreludeTransport;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\No

ts\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;

final class PreludeTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientInterfa

tifier\Exception\TransportException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tes


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Ntfy;

use Symfony\Component\Clock\Clock;
use Symfony\Component\Clock\ClockInterface;
use Symfony\Component\Notifier\Exception\LogicException;
use Symfony\Component\Notifier\Message\MessageOptionsInterface;
use Symfony\Component\Notifier\Notification\Notification;

/**
 * @author Mickael Perraud <mikaelkael.fr@gmail.com>
 */
final

_MIN = 1;

    private ClockInterface $clock;

    public function __construct(
        private array $options = [],
        ?ClockInterface $clock = null,
    ) {
        $this->clock = $clock ?? Clock::get();
    }

    public static function fromNotific

 class NtfyOptions implements MessageOptionsInterface
{
    public const PRIORITY_URGENT = 5;
    public const PRIORITY_HIGH = 4;
    public const PRIORITY_DEFAULT = 3;
    public const PRIORITY_LOW = 2;
    public const PRIORITY


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Yunpian\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\Notifier\Bridge\Yunpian\YunpianTransport;
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Sym

npianTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientInterface $client = null): YunpianTransport
    {
        return new YunpianTransport('api_key', $client ?? new MockHttpClient());
    }

    public static

fony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface;

final class Yu


buted with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mastodon;

use Symfony\Component\Mime\Part\DataPart;
use Symfony\Component\Mime\Part\File;
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
use Symfony\Component\Notifier\Exception\RuntimeException;
use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\Notifier\Exception\UnsupportedMessageTypeException;
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Message\Me

ption\ExceptionInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;

/**
 * @author Quentin Dequippe <quentin@dequippe.tech>
 *
 * @see https://docs.joinmastodon.org
 */
final class MastodonTr

ssageInterface;
use Symfony\Component\Notifier\Message\SentMessage;
use Symfony\Component\Notifier\Transport\AbstractTransport;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\Exce


 part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mastodon\Tests;

use Symfony\Component\Notifier\Bridge\Mastodon\MastodonTransportFactory;
use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase;
use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait;

/**
 * @author Quentin Dequippe <q

donTransportFactory();
    }

    public static function createProvider(): iterable
    {
        yield [
            'mastodon://host.test',
            'mastodon://accessToken@host.test',
        ];

        yield [
            'mastodon://example.com',

uentin@dequippe.tech>
 */
class MastodonTransportFactoryTest extends AbstractTransportFactoryTestCase
{
    use IncompleteDsnTestTrait;

    public function createFactory(): MastodonTransportFactory
    {
        return new Masto


 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Notifier\Bridge\Mastodon\Tests;

use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Mime\Part\File;
use Symfony\Component\Notifier\Bridge\Mastodon\MastodonOptions;
use Symfony\Component\Notifier\Bridge\Mastodon\MastodonTransport;
use Symfony\Component\Notifier\Message\Cha

;

/**
 * @author Quentin Dequippe <quentin@dequippe.tech>
 */
class MastodonTransportTest extends TransportTestCase
{
    public static function createTransport(?HttpClientInterface $client = null): MastodonTransport
    {
        return (new MastodonTran

tMessage;
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Test\TransportTestCase;
use Symfony\Component\Notifier\Tests\Transport\DummyMessage;
use Symfony\Contracts\HttpClient\HttpClientInterface