AmazonSnsOptions example



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

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\AmazonSns\AmazonSnsOptions;

class AmazonSnsOptionsTest extends TestCase
{
    public function testGetRecipientId()
    {
        $options = new AmazonSnsOptions('my-topic');
        $this->assertSame('my-topic', $options->getRecipientId());
    }

    public function testToArray()
    {
        $options = new AmazonSnsOptions('my-topic');
        $options->subject('value');
        $this->assertSame(['Subject' => 'value']$options->toArray());
    }
}
return (new AmazonSnsTransport(new SnsClient(['region' => 'eu-west-3'])$client ?? new MockHttpClient()))->setHost('host.test');
    }

    public static function toStringProvider(): iterable
    {
        yield ['sns://host.test?region=eu-west-3', self::createTransport()];
    }

    public static function supportedMessagesProvider(): iterable
    {
        yield [new SmsMessage('0601020304', 'Hello!')];
        yield [new ChatMessage('Hello', new AmazonSnsOptions('my-topic'))];
    }

    public static function unsupportedMessagesProvider(): iterable
    {
        yield [new DummyMessage()];
        yield [new ChatMessage('hello', new TestOptions())];
    }

    public function testSmsMessageWithFrom()
    {
        $transport = $this->createTransport();

        
Home | Imprint | This part of the site doesn't use cookies.