-
Notifications
You must be signed in to change notification settings - Fork 610
Expand file tree
/
Copy pathSendAtTest.php
More file actions
43 lines (35 loc) · 937 Bytes
/
Copy pathSendAtTest.php
File metadata and controls
43 lines (35 loc) · 937 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 SendAt.
*/
namespace SendGrid\Tests\Unit;
use PHPUnit\Framework\TestCase;
use SendGrid\Mail\SendAt;
use SendGrid\Mail\TypeException;
/**
* This class tests SendAt.
*
* @package SendGrid\Tests
*/
class SendAtTest extends TestCase
{
public function testConstructor()
{
$sendAt = new SendAt(1539368762);
$this->assertInstanceOf(SendAt::class, $sendAt);
$this->assertSame(1539368762, $sendAt->getSendAt());
}
public function testSendAt()
{
$sendAt = new SendAt();
$sendAt->setSendAt(1539368762);
$this->assertSame(1539368762, $sendAt->getSendAt());
}
public function testSendAtOnInvalidType()
{
$this->expectException(TypeException::class);
$this->expectExceptionMessageMatches('/"\$send_at" must be an integer/');
$sendAt = new SendAt();
$sendAt->setSendAt('invalid_int_type');
}
}