ContactEveryoneOptions example



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

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\ContactEveryone\ContactEveryoneOptions;

class ContactEveryoneOptionsTest extends TestCase
{
    public function testContactEveryoneOptions()
    {
        $contactEveryoneOptions = (new ContactEveryoneOptions())
            ->category('test_category')
            ->diffusionName('test_diffusion_name');

        self::assertSame([
            'category' => 'test_category',
            'diffusionname' => 'test_diffusion_name',
        ]$contactEveryoneOptions->toArray());
    }
}
return new ContactEveryoneTransport('API_TOKEN', 'Symfony', 'Foo', $client ?? new MockHttpClient());
    }

    public static function toStringProvider(): iterable
    {
        yield ['contact-everyone://contact-everyone.orange-business.com?diffusionname=Symfony&category=Foo', self::createTransport()];
    }

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

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

    public function testSendSuccessfully()
    {
        $messageId = bin2hex(random_bytes(7));
        
Home | Imprint | This part of the site doesn't use cookies.