-
Notifications
You must be signed in to change notification settings - Fork 610
Expand file tree
/
Copy pathSandBoxModeTest.php
More file actions
43 lines (35 loc) · 981 Bytes
/
Copy pathSandBoxModeTest.php
File metadata and controls
43 lines (35 loc) · 981 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
42
43
<?php
/**
* This file tests SandBoxMode.
*/
namespace SendGrid\Tests\Unit;
use PHPUnit\Framework\TestCase;
use SendGrid\Mail\SandBoxMode;
use SendGrid\Mail\TypeException;
/**
* This class tests SandBoxMode.
*
* @package SendGrid\Tests
*/
class SandBoxModeTest extends TestCase
{
public function testConstructor()
{
$sandBoxMode = new SandBoxMode(true);
$this->assertInstanceOf(SandBoxMode::class, $sandBoxMode);
$this->assertTrue($sandBoxMode->getEnable());
}
public function testSetEnable()
{
$sandBoxMode = new SandBoxMode();
$sandBoxMode->setEnable(true);
$this->assertTrue($sandBoxMode->getEnable());
}
public function testSetEnableOnInvalidType()
{
$this->expectException(TypeException::class);
$this->expectExceptionMessageMatches('/"\$enable" must be a boolean/');
$sandBoxMode = new SandBoxMode();
$sandBoxMode->setEnable('invalid_bool');
}
}