Failed Conditions
Push — issue#785 ( 0adb82...cc35f8 )
by Guilherme
04:03
created

SentVerificationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 2
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