|
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['myself']['birthday']); |
|
26
|
|
|
unset($identity['myself']['age']); |
|
27
|
|
|
$this->assertEquals(array( |
|
28
|
|
|
'myself' => array( |
|
29
|
|
|
'name' => 'First Name Last Name', |
|
30
|
|
|
'nationality' => 'French Citizenship', |
|
31
|
|
|
'picture' => 'bundles/fabiencrassatcurriculumvitae/img/example.png' |
|
32
|
|
|
), |
|
33
|
|
|
'address' => array( |
|
34
|
|
|
'street' => 'Street', |
|
35
|
|
|
'postalcode' => 'PostalCode', |
|
36
|
|
|
'city' => 'City', |
|
37
|
|
|
'country' => 'Country', |
|
38
|
|
|
'googlemap' => 'http://maps.google.com' |
|
39
|
|
|
), |
|
40
|
|
|
'contact' => array( |
|
41
|
|
|
'mobile' => 'Telephone', |
|
42
|
|
|
'email' => 'email_arobase_site_dot_com' |
|
43
|
|
|
), |
|
44
|
|
|
'social' => array( |
|
45
|
|
|
'drivelicences' => 'French driving licence' |
|
46
|
|
|
) |
|
47
|
|
|
), $identity); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function testGetIdentityWithFrenchLanguage() { |
|
51
|
|
|
$this->curriculumVitae = new CurriculumVitae(__DIR__.'/../../Resources/data/example.xml', 'fr'); |
|
52
|
|
|
|
|
53
|
|
|
$identity = $this->curriculumVitae->getIdentity(); |
|
54
|
|
|
// We remove the format birthday because of travisci and scrutinizer |
|
55
|
|
|
unset($identity['myself']['birthday']); |
|
56
|
|
|
$this->assertEquals(array( |
|
57
|
|
|
'myself' => array( |
|
58
|
|
|
'name' => 'First Name Last Name', |
|
59
|
|
|
'birthplace' => 'Paris', |
|
60
|
|
|
'picture' => 'bundles/fabiencrassatcurriculumvitae/img/example.png' |
|
61
|
|
|
), |
|
62
|
|
|
'address' => array( |
|
63
|
|
|
'street' => 'Street', |
|
64
|
|
|
'postalcode' => 'PostalCode', |
|
65
|
|
|
'city' => 'City', |
|
66
|
|
|
'country' => 'Country', |
|
67
|
|
|
'googlemap' => 'http://maps.google.com' |
|
68
|
|
|
), |
|
69
|
|
|
'contact' => array( |
|
70
|
|
|
'mobile' => 'Telephone', |
|
71
|
|
|
'email' => 'email_arobase_site_dot_com' |
|
72
|
|
|
), |
|
73
|
|
|
'social' => array( |
|
74
|
|
|
'marital' => 'Célibataire', |
|
75
|
|
|
'military' => 'Dégagé des obligations militaires', |
|
76
|
|
|
'drivelicences' => 'Titulaire du permis B' |
|
77
|
|
|
) |
|
78
|
|
|
), $identity); |
|
79
|
|
|
} |
|
80
|
|
|
} |
|
81
|
|
|
|