-
Notifications
You must be signed in to change notification settings - Fork 610
Expand file tree
/
Copy pathClickTrackingTest.php
More file actions
61 lines (49 loc) · 1.55 KB
/
Copy pathClickTrackingTest.php
File metadata and controls
61 lines (49 loc) · 1.55 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* This file tests ClickTracking.
*/
namespace SendGrid\Tests\Unit;
use PHPUnit\Framework\TestCase;
use SendGrid\Mail\ClickTracking;
use SendGrid\Mail\TypeException;
/**
* This file tests ClickTracking.
*
* @package SendGrid\Tests
*/
class ClickTrackingTest extends TestCase
{
public function testConstructor()
{
$clickTracking = new ClickTracking(true, true);
$this->assertInstanceOf(ClickTracking::class, $clickTracking);
$this->assertTrue($clickTracking->getEnable());
$this->assertTrue($clickTracking->getEnableText());
}
public function testSetEnable()
{
$clickTracking = new ClickTracking();
$clickTracking->setEnable(true);
$this->assertTrue($clickTracking->getEnable());
}
public function testSetEnableOnInvalidType()
{
$this->expectException(TypeException::class);
$this->expectExceptionMessageMatches('/"\$enable" must be a boolean/');
$clickTracking = new ClickTracking();
$clickTracking->setEnable('invalid_bool');
}
public function testSetEnableText()
{
$clickTracking = new ClickTracking();
$clickTracking->setEnableText(true);
$this->assertTrue($clickTracking->getEnableText());
}
public function testSetEnableTextOnInvalidType()
{
$this->expectException(TypeException::class);
$this->expectExceptionMessageMatches('/"\$enable_text" must be a boolean/');
$clickTracking = new ClickTracking();
$clickTracking->setEnableText('invalid_bool');
}
}