testGetIdentityWithFrenchLanguage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 22
nc 1
nop 0
dl 0
loc 29
rs 9.568
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the FabienCrassat\CurriculumVitaeBundle Symfony bundle.
5
 *
6
 * (c) Fabien Crassat <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FabienCrassat\CurriculumVitaeBundle\Tests\Entity;
13
14
use FabienCrassat\CurriculumVitaeBundle\Entity\CurriculumVitae;
15
16
class CurriculumVitaeGetIdentityFromExampleXMLFileTest extends \PHPUnit\Framework\TestCase
17
{
18
    private $curriculumVitae;
19
20
    public function testGetIdentityWithEnglishLanguage() {
21
        $this->curriculumVitae = new CurriculumVitae(__DIR__.'/../../Resources/data/example.xml');
22
23
        $identity = $this->curriculumVitae->getIdentity();
24
        // We remove the values because of travisci and scrutinizer (depending of date)
25
        unset($identity[CurriculumVitae::IDENTITY_MYSELF]['birthday']);
26
        unset($identity[CurriculumVitae::IDENTITY_MYSELF]['age']);
27
        $this->assertEquals([
28
            CurriculumVitae::IDENTITY_MYSELF => [
29
                'name' => 'First Name Last Name',
30
                'nationality' => 'French Citizenship',
31
                'picture' => 'bundles/fabiencrassatcurriculumvitae/img/example.png'],
32
            'address' => [
33
                'street' => 'Street',
34
                'postalcode' => 'PostalCode',
35
                'city' => 'City',
36
                'country' => 'Country',
37
                'googlemap' => 'http://maps.google.com'],
38
            'contact' => [
39
                'mobile' => 'Telephone',
40
                'email' => 'email_arobase_site_dot_com'],
41
            'social' => [
42
                'drivelicences' => 'French driving licence']
43
        ], $identity);
44
    }
45
46
    public function testGetIdentityWithFrenchLanguage() {
47
        $this->curriculumVitae = new CurriculumVitae(__DIR__.'/../../Resources/data/example.xml', 'fr');
48
49
        $identity = $this->curriculumVitae->getIdentity();
50
        // We remove the format birthday because of travisci and scrutinizer
51
        unset($identity[CurriculumVitae::IDENTITY_MYSELF]['birthday']);
52
        $this->assertEquals([
53
            CurriculumVitae::IDENTITY_MYSELF => [
54
                'name'       => 'First Name Last Name',
55
                'birthplace' => 'Paris',
56
                'picture'    => 'bundles/fabiencrassatcurriculumvitae/img/example.png'
57
            ],
58
            'address' => [
59
                'street'     => 'Street',
60
                'postalcode' => 'PostalCode',
61
                'city'       => 'City',
62
                'country'    => 'Country',
63
                'googlemap'  => 'http://maps.google.com'
64
            ],
65
            'contact' => [
66
                'mobile' => 'Telephone',
67
                'email'  => 'email_arobase_site_dot_com'
68
            ],
69
            'social' => [
70
                'marital'       => 'Célibataire',
71
                'military'      => 'Dégagé des obligations militaires',
72
                'drivelicences' => 'Titulaire du permis B'
73
            ]
74
        ], $identity);
75
    }
76
}
77