-
Notifications
You must be signed in to change notification settings - Fork 610
Expand file tree
/
Copy pathBatchIdTest.php
More file actions
50 lines (40 loc) · 1.1 KB
/
Copy pathBatchIdTest.php
File metadata and controls
50 lines (40 loc) · 1.1 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
<?php
/**
* This file tests BatchId.
*/
namespace SendGrid\Tests\Unit;
use PHPUnit\Framework\TestCase;
use SendGrid\Mail\BatchId;
use SendGrid\Mail\TypeException;
/**
* This file tests BatchId.
*
* @package SendGrid\Tests
*/
class BatchIdTest extends TestCase
{
public function testConstructor()
{
$batchId = new BatchId('this_is_batch_id');
$this->assertInstanceOf(BatchId::class, $batchId);
$this->assertSame('this_is_batch_id', $batchId->getBatchId());
}
public function testSetBatchId()
{
$batchId = new BatchId();
$batchId->setBatchId('this_is_batch_id');
$this->assertSame('this_is_batch_id', $batchId->getBatchId());
}
public function testSetBatchIdOnInvalidBatchId()
{
$this->expectException(TypeException::class);
$this->expectExceptionMessageMatches('/"\$batch_id" must be a string/');
$batch_id = new BatchId();
$batch_id->setBatchId(123);
}
public function testJsonSerialize()
{
$batchId = new BatchId();
$this->assertNull($batchId->jsonSerialize());
}
}