RingCentralOptions example



    public static function invalidFromProvider(): iterable
    {
        yield 'no zero at start if phone number' => ['+0'];
        yield 'phone number too short' => ['+1'];
    }

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

    /** * @dataProvider invalidFromProvider */
    public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from)
    {
        $transport = $this->createTransport(null, $from);

        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage(sprintf('The "From" number "%s" is not a valid phone number.', $from));

        


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

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\RingCentral\RingCentralOptions;

class RingCentralOptionsTest extends TestCase
{
    public function testRingCentralOptions()
    {
        $ringCentralOptions = (new RingCentralOptions())
            ->country('test_country_id', 'test_country_iso_code', 'test_country_name', 'test_country_uri', 'test_country_calling_code');

        self::assertSame([
            'country' => [
                'id' => 'test_country_id',
                'isoCode' => 'test_country_iso_code',
                'name' => 'test_country_name',
                'uri' => 'test_country_uri',
                'callingCode' => 'test_country_calling_code',
            ],
        ]$ringCentralOptions->toArray());
    }
Home | Imprint | This part of the site doesn't use cookies.