public function invalidFromProvider(): iterable
{ yield 'too short' =>
['a'
];
yield 'too long' =>
['abcdefghijkl'
];
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 PlivoOptions(['src' => '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, shortcode, or alphanumeric sender ID.',
$from));