Failed Conditions
Push — master ( 9bceb4...42a7b7 )
by Guilherme
02:51 queued 10s
created

DynamicFormDataTest::testModel()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 38
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 26
nc 1
nop 0
dl 0
loc 38
rs 8.8571
c 0
b 0
f 0
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\DynamicFormBundle\Tests\Model;
12
13
use LoginCidadao\CoreBundle\Entity\PersonAddress;
14
use LoginCidadao\CoreBundle\Model\IdCardInterface;
15
use LoginCidadao\CoreBundle\Model\LocationSelectData;
16
use LoginCidadao\CoreBundle\Model\PersonInterface;
17
use LoginCidadao\DynamicFormBundle\Model\DynamicFormData;
18
use PHPUnit\Framework\TestCase;
19
20
class DynamicFormDataTest extends TestCase
21
{
22
    public function testModel()
23
    {
24
        /** @var PersonInterface $person */
25
        $person = $this->createMock('LoginCidadao\CoreBundle\Model\PersonInterface');
26
27
        /** @var IdCardInterface $idCard */
28
        $idCard = $this->createMock('LoginCidadao\CoreBundle\Model\IdCardInterface');
29
30
        /** @var LocationSelectData $placeOfBirth */
31
        $placeOfBirth = $this->createMock('LoginCidadao\CoreBundle\Model\LocationSelectData');
32
33
        /** @var PersonAddress $personAddress */
34
        $personAddress = $this->createMock('LoginCidadao\CoreBundle\Entity\PersonAddress');
35
36
        $idCardState = $this->createMock('LoginCidadao\CoreBundle\Entity\State');
37
        $scope = 'scope1 scope2';
38
        $state = 'Some State';
39
        $url = 'https://example.com';
40
41
        $model = new DynamicFormData();
42
        $model
43
            ->setPerson($person)
44
            ->setAddress($personAddress)
45
            ->setIdCard($idCard)
46
            ->setPlaceOfBirth($placeOfBirth)
47
            ->setScope($scope)
48
            ->setState($state)
49
            ->setRedirectUrl($url)
50
            ->setIdCardState($idCardState);
51
52
        $this->assertEquals($person, $model->getPerson());
53
        $this->assertEquals($personAddress, $model->getAddress());
54
        $this->assertEquals($idCard, $model->getIdCard());
55
        $this->assertEquals($placeOfBirth, $model->getPlaceOfBirth());
56
        $this->assertEquals($scope, $model->getScope());
57
        $this->assertEquals($state, $model->getState());
58
        $this->assertEquals($url, $model->getRedirectUrl());
59
        $this->assertEquals($idCardState, $model->getIdCardState());
60
    }
61
}
62