-
Notifications
You must be signed in to change notification settings - Fork 627
/
Copy pathBypassUnsubscribeManagementTest.php
43 lines (35 loc) · 1.21 KB
/
BypassUnsubscribeManagementTest.php
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
<?php
/**
* This file tests BypassUnsubscribeManagement.
*/
namespace SendGrid\Tests\Unit;
use PHPUnit\Framework\TestCase;
use SendGrid\Mail\BypassUnsubscribeManagement;
use SendGrid\Mail\TypeException;
/**
* This file tests BypassUnsubscribeManagement.
*
* @package SendGrid\Tests
*/
class BypassUnsubscribeManagementTest extends TestCase
{
public function testConstructor()
{
$bypassUnsubscribeManagement = new BypassUnsubscribeManagement(true);
$this->assertInstanceOf(BypassUnsubscribeManagement::class, $bypassUnsubscribeManagement);
$this->assertTrue($bypassUnsubscribeManagement->getEnable());
}
public function testSetEnable()
{
$bypassUnsubscribeManagement = new BypassUnsubscribeManagement();
$bypassUnsubscribeManagement->setEnable(true);
$this->assertTrue($bypassUnsubscribeManagement->getEnable());
}
public function testSetEnableOnInvalidType()
{
$this->expectException(TypeException::class);
$this->expectExceptionMessageMatches('/"\$enable" must be a boolean/');
$bypassUnsubscribeManagement = new BypassUnsubscribeManagement();
$bypassUnsubscribeManagement->setEnable('invalid_bool_type');
}
}