|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of the login-cidadao project or it's bundles. |
|
4
|
|
|
* |
|
5
|
|
|
* (c) Guilherme Donato <guilhermednt on github> |
|
6
|
|
|
* |
|
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
8
|
|
|
* file that was distributed with this source code. |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace LoginCidadao\PhoneVerificationBundle\Tests\Entity; |
|
12
|
|
|
|
|
13
|
|
|
use LoginCidadao\PhoneVerificationBundle\Entity\SentVerification; |
|
14
|
|
|
use PHPUnit\Framework\TestCase; |
|
15
|
|
|
|
|
16
|
|
|
class SentVerificationTest extends TestCase |
|
17
|
|
|
{ |
|
18
|
|
|
public function testConstructor() |
|
19
|
|
|
{ |
|
20
|
|
|
$sentVerification = new SentVerification(); |
|
21
|
|
|
|
|
22
|
|
|
$this->assertInstanceOf( |
|
23
|
|
|
'LoginCidadao\PhoneVerificationBundle\Entity\SentVerification', |
|
24
|
|
|
$sentVerification |
|
25
|
|
|
); |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
public function testGettersSetters() |
|
29
|
|
|
{ |
|
30
|
|
|
$sentVerification = new SentVerification(); |
|
31
|
|
|
|
|
32
|
|
|
$phone = $this->createMock('libphonenumber\PhoneNumber'); |
|
33
|
|
|
$message = 'some message'; |
|
34
|
|
|
$transactionId = '1234567890'; |
|
35
|
|
|
$date = new \DateTime(); |
|
36
|
|
|
|
|
37
|
|
|
$sentVerification |
|
38
|
|
|
->setMessageSent($message) |
|
39
|
|
|
->setTransactionId($transactionId) |
|
40
|
|
|
->setPhone($phone) |
|
41
|
|
|
->setSentAt($date); |
|
42
|
|
|
|
|
43
|
|
|
$this->assertNull($sentVerification->getId()); |
|
44
|
|
|
$this->assertEquals($message, $sentVerification->getMessageSent()); |
|
45
|
|
|
$this->assertEquals($transactionId, $sentVerification->getTransactionId()); |
|
46
|
|
|
$this->assertEquals($phone, $sentVerification->getPhone()); |
|
47
|
|
|
$this->assertInstanceOf('\DateTime', $sentVerification->getSentAt()); |
|
48
|
|
|
$this->assertEquals($date, $sentVerification->getSentAt()); |
|
49
|
|
|
} |
|
50
|
|
|
} |
|
51
|
|
|
|