GatewayApiOptions example

return new GatewayApiTransport('authtoken', 'Symfony', $client ?? new MockHttpClient());
    }

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

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

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

    public function testSend()
    {
        $response = $this->createMock(ResponseInterface::class);
        


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

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\GatewayApi\GatewayApiOptions;

class GatewayApiOptionsTest extends TestCase
{
    public function testGatewayApiOptions()
    {
        $gatewayApiOptions = (new GatewayApiOptions())
            ->class('test_class')
            ->callbackUrl('test_callback_url')
            ->userRef('test_user_ref');

        self::assertSame([
            'class' => 'test_class',
            'callback_url' => 'test_callback_url',
            'userref' => 'test_user_ref',
        ]$gatewayApiOptions->toArray());
    }
}
Home | Imprint | This part of the site doesn't use cookies.