MessageMediaOptions example



    public static function toStringProvider(): iterable
    {
        yield ['messagemedia://api.messagemedia.com', self::createTransport()];
        yield ['messagemedia://api.messagemedia.com?from=TEST', self::createTransport(null, 'TEST')];
    }

    public static function supportedMessagesProvider(): iterable
    {
        yield [new SmsMessage('0491570156', 'Hello!')];
        yield [new SmsMessage('0491570156', 'Hello!', 'from', new MessageMediaOptions(['from' => 'foo']))];
    }

    public static function unsupportedMessagesProvider(): iterable
    {
        yield [new ChatMessage('Hello!')];
        yield [new DummyMessage()];
    }

    /** * @dataProvider exceptionIsThrownWhenHttpSendFailedProvider * * @throws TransportExceptionInterface */


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

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\MessageMedia\MessageMediaOptions;

class MessageMediaOptionsTest extends TestCase
{
    public function testMessageMediaOptions()
    {
        $messageMediaOptions = (new MessageMediaOptions())->
            media(['test_media'])
            ->callbackUrl('test_callback_url')
            ->format('test_format')
            ->deliveryReport(true)
            ->expiry(999)
            ->metadata(['test_metadata'])
            ->scheduled('test_scheduled')
            ->subject('test_subject');

        self::assertSame([
            'media' => ['test_media'],
            
Home | Imprint | This part of the site doesn't use cookies.