setNoStopClause example

use Symfony\Component\Notifier\Exception\TransportException;
use Symfony\Component\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\HttpClient\HttpClientInterface;

final class OvhCloudTransportTest extends TransportTestCase
{
    public static function createTransport(HttpClientInterface $client = null, string $sender = null, bool $noStopClause = false): OvhCloudTransport
    {
        return (new OvhCloudTransport('applicationKey', 'applicationSecret', 'consumerKey', 'serviceName', $client ?? new MockHttpClient()))->setSender($sender)->setNoStopClause($noStopClause);
    }

    public static function toStringProvider(): iterable
    {
        yield ['ovhcloud://eu.api.ovh.com?service_name=serviceName', self::createTransport()];
        yield ['ovhcloud://eu.api.ovh.com?service_name=serviceName', self::createTransport(null, null, true)];
        yield ['ovhcloud://eu.api.ovh.com?service_name=serviceName&sender=sender', self::createTransport(null, 'sender')];
    }

    public static function supportedMessagesProvider(): iterable
    {
        


        $applicationKey = $this->getUser($dsn);
        $applicationSecret = $this->getPassword($dsn);
        $consumerKey = $dsn->getRequiredOption('consumer_key');
        $serviceName = $dsn->getRequiredOption('service_name');
        $sender = $dsn->getOption('sender');
        $noStopClause = filter_var($dsn->getOption('no_stop_clause', false), \FILTER_VALIDATE_BOOL);
        $host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
        $port = $dsn->getPort();

        return (new OvhCloudTransport($applicationKey$applicationSecret$consumerKey$serviceName$this->client, $this->dispatcher))->setHost($host)->setPort($port)->setSender($sender)->setNoStopClause($noStopClause);
    }

    protected function getSupportedSchemes(): array
    {
        return ['ovhcloud'];
    }
}
Home | Imprint | This part of the site doesn't use cookies.