-
Notifications
You must be signed in to change notification settings - Fork 455
Expand file tree
/
Copy pathSMSTest.php
More file actions
41 lines (29 loc) · 970 Bytes
/
SMSTest.php
File metadata and controls
41 lines (29 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
use PHPUnit\Framework\TestCase;
use SimpleSoftwareIO\QrCode\DataTypes\SMS;
class SMSTest extends TestCase
{
private SMS $sms;
public function setUp(): void
{
$this->sms = new SMS();
}
public function test_it_generates_a_proper_format_with_a_phone_number()
{
$this->sms->create(['555-555-5555']);
$properFormat = 'sms:555-555-5555';
$this->assertEquals($properFormat, strval($this->sms));
}
public function test_it_generate_a_proper_format_with_a_message()
{
$this->sms->create([null, 'foo']);
$properFormat = 'sms:&body=foo';
$this->assertEquals($properFormat, strval($this->sms));
}
public function test_it_generates_a_proper_format_with_a_phone_number_and_message()
{
$this->sms->create(['555-555-5555', 'foo']);
$properFormat = 'sms:555-555-5555&body=foo';
$this->assertEquals($properFormat, strval($this->sms));
}
}