Completed
Push — master ( c59679...9e7f7b )
by Fabien
03:51
created

testgetLookingForAndExperiencesAndHumanFileName()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 29
rs 8.8571
cc 1
eloc 26
nc 1
nop 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 CurriculumVitaeTest extends \PHPUnit_Framework_TestCase
17
{
18
    private $CV;
19
    private $lang;
20
    private $interface;
21
    private $arrayToCompare;
22
23
    public function __construct() {
24
        $this->lang = 'en';
25
    }
26
27
    public function testgetLookingForAndExperiencesAndHumanFileName() {
28
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/backbone.xml', $this->lang);
29
        $result = array();
30
        $result = array_merge($result, array('lookingFor' => $this->CV->getLookingFor()));
31
        $result = array_merge($result, array('experiences' => $this->CV->getExperiences()));
32
        $result = array_merge($result, array('pdfFile' => $this->CV->getHumanFileName()));
33
34
        $expected = array(
35
            'lookingFor' => array(
36
                'experience'   => array(
37
                    'date' => "Date",
38
                    'job' => "The job",
39
                    'society' => array(
40
                        'name' => "My Company",
41
                        'address' => "The address of the company",
42
                        'siteurl' => "http://www.MyCompany.com")),
43
                'presentation' => "A presentation"),
44
            'experiences' => array(
45
                'LastJob' => array(
46
                    'date' => "Date",
47
                    'job' => "The job",
48
                    'society' => array(
49
                        'name' => "My Company",
50
                        'address' => "The address of the company",
51
                        'siteurl' => "http://www.MyCompany.com"))),
52
            'pdfFile' => "First Name Last Name - The job"
53
        );
54
        $this->assertEquals($expected, $result);
55
    }
56
57
    public function testNoLanguage() {
58
        $this->interface = 'getDropDownLanguages';
59
60
        $this->arrayToCompare = array(
61
            $this->lang => $this->lang
62
        );
63
64
        $this->assertCVInterface('/../Resources/data/core.xml');
65
    }
66
67
    public function testSimpleHumanFileName() {
68
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/core.xml');
69
        $this->assertSame("core", $this->CV->getHumanFileName());
70
    }
71
72
    public function testHumanFileNameWithExperience() {
73
        $this->CV = new CurriculumVitae(__DIR__.'/../../Resources/data/example.xml');
74
        $this->assertSame("First Name Last Name - Curriculum Vitae Title",
75
            $this->CV->getHumanFileName()
76
        );
77
78
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/backbone.xml');
79
        $this->assertSame("First Name Last Name - The job",
80
            $this->CV->getHumanFileName()
81
        );
82
    }
83
84
    public function testHumanFileNameWithJob() {
85
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/backbone.xml');
86
        $this->assertSame("First Name Last Name - The job", $this->CV->getHumanFileName());
87
    }
88
89
    public function testHumanFileNameWithOnLyName(){
90
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/justIdentityMySelf.xml');
91
        $this->assertSame("First Name Last Name", $this->CV->getHumanFileName());
92
    }
93
94
    public function testNullReturnWithNoDeclarationInCurriculumVitaeTag() {
95
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/core.xml');
96
        $this->assertNull($this->CV->getIdentity());
97
    }
98
99
    public function testGetAnchorsWithNoLang() {
100
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/backbone.xml');
101
        $anchors = $this->CV->getAnchors();
102
        if (is_array($anchors)) {
103
            $this->assertEquals(array('identity' => array(
104
                        'href' => 'identity',
105
                        'title' => 'identity'),
106
                      'followMe' => array(
107
                        'href' => 'followMe',
108
                        'title' => 'followMe'),
109
                      'experiences' => array(
110
                        'href' => 'experiences',
111
                        'title' => 'experiences'),
112
                      'skills' => array(
113
                        'href' => 'skills',
114
                        'title' => 'skills'),
115
                      'educations' => array(
116
                        'href' => 'educations',
117
                        'title' => 'educations'),
118
                      'languageSkills' => array(
119
                        'href' => 'languageSkills',
120
                        'title' => 'languageSkills'),
121
                      'miscellaneous' => array(
122
                        'href' => 'miscellaneous',
123
                        'title' => 'miscellaneous')
124
                ),
125
                $anchors
126
            );
127
        }
128
    }
129
130
    public function testGetIdentityWithEnglishLanguage() {
131
        $this->CV = new CurriculumVitae(__DIR__.'/../../Resources/data/example.xml');
132
        $identity = $this->CV->getIdentity();
133
        // We remove the format birthday because of travisci and scrutinizer
134
        unset($identity['myself']['birthday']);
135
        $this->assertEquals(array(
136
            'myself' => array(
137
                'name' => 'First Name Last Name',
138
                'age' => 41,
139
                'nationality' => 'French Citizenship',
140
                'picture' => 'bundles/fabiencrassatcurriculumvitae/img/example.png'
141
            ),
142
            'address' => array(
143
                'street' => 'Street',
144
                'postalcode' => 'PostalCode',
145
                'city' => 'City',
146
                'country' => 'Country',
147
                'googlemap' => 'http://maps.google.com'
148
            ),
149
            'contact' => array(
150
                'mobile' => 'Telephone',
151
                'email' => 'email_arobase_site_dot_com'
152
            ),
153
            'social' => array(
154
                'drivelicences' => 'French driving licence'
155
            )
156
        ), $identity);
157
    }
158
159
    public function testGetIdentityWithFrenchLanguage() {
160
        $this->CV = new CurriculumVitae(__DIR__.'/../../Resources/data/example.xml', "fr");
161
        $identity = $this->CV->getIdentity();
162
        // We remove the format birthday because of travisci and scrutinizer
163
        unset($identity['myself']['birthday']);
164
        $this->assertEquals(array(
165
            'myself' => array(
166
                'name' => 'First Name Last Name',
167
                'birthplace' => 'Paris',
168
                'picture' => 'bundles/fabiencrassatcurriculumvitae/img/example.png'
169
            ),
170
            'address' => array(
171
                'street' => 'Street',
172
                'postalcode' => 'PostalCode',
173
                'city' => 'City',
174
                'country' => 'Country',
175
                'googlemap' => 'http://maps.google.com'
176
            ),
177
            'contact' => array(
178
                'mobile' => 'Telephone',
179
                'email' => 'email_arobase_site_dot_com'
180
            ),
181
            'social' => array(
182
                'marital' => 'Célibataire',
183
                'military' => 'Dégagé des obligations militaires',
184
                'drivelicences' => 'Titulaire du permis B'
185
            )
186
        ), $identity);
187
    }
188
189
    public function testGetDropDownLanguages() {
190
        $this->interface = 'getDropDownLanguages';
191
        $this->arrayToCompare = array(
192
            'en' => "English",
193
            'fr' => "Français",
194
            'es' => "español"
195
        );
196
197
        $this->assertCVInterface();
198
    }
199
200
    public function testGetFollowMe() {
201
        $this->interface = 'getFollowMe';
202
        $this->arrayToCompare = array(
203
            'linkedin' => array(
204
                'title' => 'Linked In',
205
                'url'   => 'http://www.linkedin.com',
206
                'icon'  => 'bundles/fabiencrassatcurriculumvitae/img/linkedin.png'
207
            ),
208
            'viadeo' => array(
209
                'title' => 'Viadeo',
210
                'url'   => 'http://www.viadeo.com',
211
                'icon'  => 'bundles/fabiencrassatcurriculumvitae/img/viadeo.png'
212
            ),
213
            'monster' => array(
214
                'title' => 'Monster',
215
                'url'   => 'http://beknown.com',
216
                'icon'  => 'bundles/fabiencrassatcurriculumvitae/img/monster.png'
217
            ),
218
            'twitter' => array(
219
                'title' => 'Twitter',
220
                'url'   => 'https://twitter.com',
221
                'icon'  => 'bundles/fabiencrassatcurriculumvitae/img/twitter.png'
222
            ),
223
            'googleplus' => array(
224
                'title' => 'Google+',
225
                'url'   => 'https://plus.google.com',
226
                'icon'  => 'bundles/fabiencrassatcurriculumvitae/img/googleplus.png'
227
            ),
228
            'facebook' => array(
229
                'title' => 'Facebook',
230
                'url'   => 'https://www.facebook.com',
231
                'icon'  => 'bundles/fabiencrassatcurriculumvitae/img/facebook.png'
232
            ),
233
            'scrum' => array(
234
                'title' => 'Scrum',
235
                'url'   => 'http://www.scrumalliance.org',
236
                'icon'  => 'bundles/fabiencrassatcurriculumvitae/img/scrum-alliance.png'
237
            )
238
        );
239
240
        $this->assertCVInterface();
241
242
        $this->lang = 'fr';
243
        $this->assertCVInterface();
244
    }
245
246
    public function testGetLookingFor() {
247
        $this->interface = 'getLookingFor';
248
249
        $this->arrayToCompare = array(
250
            'experience'   => "Curriculum Vitae Title",
251
            'presentation' => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eu lectus facilisis, posuere leo laoreet, dignissim ligula. Praesent ultricies dignissim diam vitae dictum. Donec sed nisi tortor. Proin tempus scelerisque lectus, sit amet convallis mi semper a. Integer blandit a ligula a volutpat. Ut dolor eros, interdum quis ante ac, tempus commodo odio. Suspendisse ut nisi purus. Mauris vestibulum nibh sit amet turpis consequat pharetra. Duis at adipiscing risus. Vivamus vitae orci ac felis porta euismod. Fusce sit amet metus sem. Maecenas suscipit tincidunt ante, sed feugiat odio eleifend eu. Sed eu ultricies ipsum. In cursus tincidunt elit a gravida. Nam eu aliquet leo. Maecenas nibh leo, eleifend fermentum neque sit amet, viverra consequat lorem.",
252
        );
253
        $this->assertCVInterface();
254
255
        $this->lang = 'fr';
256
        $this->arrayToCompare = array(
257
            'experience'   => "Titre du curriculum vitae",
258
            'presentation' => "Mauris rutrum justo ac bibendum ultrices. Mauris a dolor a diam tempus ornare vel non urna. Donec a dui vel nunc ultrices porta non vitae felis. Ut blandit ullamcorper orci. Quisque quis justo vitae nisl auctor laoreet non eget mauris. Sed volutpat enim est, vitae vulputate nibh laoreet gravida. Duis nec tincidunt ante. Nullam metus turpis, accumsan nec laoreet et, consectetur et ligula. Curabitur convallis feugiat lorem, sit amet tincidunt arcu sollicitudin vel. Aliquam erat volutpat. In odio elit, accumsan in facilisis at, ultricies quis justo.",
259
        );
260
        $this->assertCVInterface();
261
    }
262
263
    public function testGetExperiences() {
264
        $this->interface = 'getExperiences';
265
266
        $this->arrayToCompare = array(
267
            'FirstExperience' => array(
268
                'date' => 'Jan 2007 - Present',
269
                'job' => 'My current job',
270
                'society' => array(
271
                    'name' => 'My Company',
272
                    'address' => 'the address of the company',
273
                    'siteurl' => 'http://www.MyCompany.com',
274
                ),
275
                'missions' => array(
276
                    'item' => array(
277
                        0 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
278
                        1 => 'Suspendisse nec mauris eu orci dapibus mollis ac ac mi.'
279
                    )
280
                )
281
            ),
282
            'SecondExperience' => array(
283
                'collapse' => 'false',
284
                'date' => 'Sept - Dec 2006',
285
                'job' => 'My previous job',
286
                'society' => array(
287
                    'name' => 'My Other Company',
288
                    'address' => 'the address of the company',
289
                    'siteurl' => 'http://www.MyOtherCompany.com',
290
                )
291
            ),
292
            'ThirdExperience' => array(
293
                'date' => 'Summer 2006',
294
                'job' => 'A summer job',
295
                'society' => array(
296
                    'name' => 'A company wihtout site',
297
                    'address' => 'the address of the company'
298
                ),
299
                'missions' => array(
300
                    'item' => array(
301
                        0 => 'Suspendisse et arcu eget est feugiat elementum.'
302
                    )
303
                )
304
            ),
305
            'FourthExperience' => array(
306
                'collapse' => 'true',
307
                'date' => 'Before 2006',
308
                'job' => 'The job of my life',
309
                'society' => 'A society with a name per language',
310
                'missions' => array(
311
                    'item' => array(
312
                        0 => 'Suspendisse et arcu eget est feugiat elementum.'
313
                    )
314
                )
315
            )
316
        );
317
        $this->assertCVInterface();
318
319
        $this->lang = 'fr';
320
        $this->arrayToCompare = array(
321
            'FirstExperience' => array(
322
                'date' => 'Jan. 2007 - Aujourd\'hui',
323
                'job' => 'Mon poste actuel',
324
                'society' => array(
325
                    'name' => 'My Company',
326
                    'address' => 'the address of the company',
327
                    'siteurl' => 'http://www.MyCompany.com',
328
                ),
329
                'missions' => array(
330
                    'item' => array(
331
                        0 => 'Donec gravida enim viverra tempor dignissim.',
332
                        1 => 'Sed a eros at mauris placerat adipiscing.'
333
                    )
334
                )
335
            ),
336
            'SecondExperience' => array(
337
                'collapse' => 'false',
338
                'date' => 'Sept - Dec 2006',
339
                'job' => 'Mon poste précédent',
340
                'society' => array(
341
                    'name' => 'Mon autre compagnie',
342
                    'address' => 'l\'adresse de la compagnie',
343
                    'siteurl' => 'http://www.MyOtherCompany.com',
344
                )
345
            ),
346
            'ThirdExperience' => array(
347
                'date' => 'Summer 2006',
348
                'job' => 'Un travail d\'été',
349
                'society' => array(
350
                    'name' => 'Une compagnie sans site',
351
                    'address' => 'l\'adresse de la compagnie'
352
                ),
353
                'missions' => array(
354
                    'item' => array(
355
                        0 => 'Suspendisse et arcu eget est feugiat elementum.'
356
                    )
357
                )
358
            ),
359
            'FourthExperience' => array(
360
                'collapse' => 'true',
361
                'date' => 'Before 2006',
362
                'job' => 'Le job de ma vie',
363
                'society' => 'Une société avec un nom par langue',
364
                'missions' => array(
365
                    'item' => array(
366
                        0 => 'Suspendisse et arcu eget est feugiat elementum.'
367
                    )
368
                )
369
            )
370
        );
371
        $this->assertCVInterface();
372
    }
373
374
    public function testGetSkills() {
375
        $this->interface = 'getSkills';
376
377
        $this->arrayToCompare = array(
378
            'Functional' => array(
379
                'title' => 'Skills',
380
                'lines' => array(
381
                    'success' => array(
382
                        'percentage' => 90,
383
                        'class' => 'success',
384
                        'striped' => 'true',
385
                        'label' => 'Increasing Skills',
386
                    ),
387
                    'otherSucess' => array(
388
                        'percentage' => 90,
389
                        'class' => 'success',
390
                        'label' => 'success',
391
                    ),
392
                    'info' => array(
393
                        'percentage' => 40,
394
                        'class' => 'info',
395
                        'striped' => 'false',
396
                        'label' => 'info',
397
                    ),
398
                    'warning' => array(
399
                        'percentage' => 20,
400
                        'class' => 'warning',
401
                        'label' => 'warning',
402
                    ),
403
                    'danger' => array(
404
                        'percentage' => 10,
405
                        'class' => 'danger',
406
                        'label' => 'danger',
407
                    ),
408
                    'noClass' => array(
409
                        'percentage' => 5,
410
                        'label' => 'noClass',
411
                    ),
412
                    'nothing' => array(
413
                        'label' => 'nothing',
414
                    )
415
                )
416
            ),
417
            'OtherSkill' => array(
418
                'title' => 'One other',
419
                'lines' => array(
420
                    'success' => array(
421
                        'percentage' => 90,
422
                        'class' => 'success',
423
                        'striped' => 'false',
424
                        'label' => 'Skills List',
425
                    ),
426
                    'info' => array(
427
                        'percentage' => 40,
428
                        'class' => 'info',
429
                        'striped' => 'false',
430
                        'label' => 'Label',
431
                    ),
432
                    'warning' => array(
433
                        'percentage' => 20,
434
                        'class' => 'warning',
435
                        'striped' => 'false',
436
                        'label' => 'Label',
437
                    ),
438
                    'danger' => array(
439
                        'percentage' => 10,
440
                        'class' => 'danger',
441
                        'striped' => 'true',
442
                        'label' => 'Label',
443
                    )
444
                )
445
            )
446
        );
447
        $this->assertCVInterface();
448
449
        $this->lang = 'fr';
450
        $this->arrayToCompare = array(
451
            'Functional' => array(
452
                'title' => 'Compétences',
453
                'lines' => array(
454
                    'success' => array(
455
                        'percentage' => 90,
456
                        'class' => 'success',
457
                        'striped' => 'true',
458
                        'label' => 'Compétences grandissantes',
459
                    ),
460
                    'otherSucess' => array(
461
                        'percentage' => 90,
462
                        'class' => 'success',
463
                        'label' => 'success',
464
                    ),
465
                    'info' => array(
466
                        'percentage' => 40,
467
                        'class' => 'info',
468
                        'striped' => 'false',
469
                        'label' => 'info',
470
                    ),
471
                    'warning' => array(
472
                        'percentage' => 20,
473
                        'class' => 'warning',
474
                        'label' => 'warning',
475
                    ),
476
                    'danger' => array(
477
                        'percentage' => 10,
478
                        'class' => 'danger',
479
                        'label' => 'danger',
480
                    ),
481
                    'noClass' => array(
482
                        'percentage' => 5,
483
                        'label' => 'noClass',
484
                    ),
485
                    'nothing' => array(
486
                        'label' => 'nothing',
487
                    )
488
                )
489
            ),
490
            'OtherSkill' => array(
491
                'title' => 'Une autre',
492
                'lines' => array(
493
                    'success' => array(
494
                        'percentage' => 90,
495
                        'class' => 'success',
496
                        'striped' => 'false',
497
                        'label' => 'Liste de Compétences',
498
                    ),
499
                    'info' => array(
500
                        'percentage' => 40,
501
                        'class' => 'info',
502
                        'striped' => 'false',
503
                        'label' => 'Label',
504
                    ),
505
                    'warning' => array(
506
                        'percentage' => 20,
507
                        'class' => 'warning',
508
                        'striped' => 'false',
509
                        'label' => 'Label',
510
                    ),
511
                    'danger' => array(
512
                        'percentage' => 10,
513
                        'class' => 'danger',
514
                        'striped' => 'true',
515
                        'label' => 'Label',
516
                    )
517
                )
518
            )
519
        );
520
        $this->assertCVInterface();
521
    }
522
523
    public function testGetEducations() {
524
        $this->interface = 'getEducations';
525
526
        $this->arrayToCompare = array(
527
            'University' => array(
528
                'date' => '2002 - 2005',
529
                'education' => 'My diploma in my university',
530
                'descriptions' => array('item' => array(
531
                    0 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc in auctor ipsum. Nullam venenatis sem.'
532
                ))
533
            ),
534
            'HighSchool' => array(
535
                'collapse' => 'false',
536
                'date' => 'June 2002',
537
                'education' => 'My diploma in my high school',
538
                'descriptions' => array('item' => array(
539
                    0 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris elit dui, faucibus non laoreet luctus, dignissim at lectus. Quisque dignissim imperdiet consectetur. Praesent scelerisque neque.',
540
                    1 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pretium varius est sit amet consectetur. Suspendisse cursus dapibus egestas. Ut id augue quis mi scelerisque.'
541
                ))
542
            ),
543
            'FirstSchool' => array(
544
                'collapse' => 'true',
545
                'date' => 'June 2000',
546
                'education' => 'My diploma in my first school'
547
            )
548
        );
549
        $this->assertCVInterface();
550
551
        $this->lang = 'fr';
552
        $this->arrayToCompare = array(
553
            'University' => array(
554
                'date' => '2002 - 2005',
555
                'education' => 'Mon diplôme dans mon université',
556
                'descriptions' => array('item' => array(
557
                    0 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris elit dui, faucibus non laoreet luctus, dignissim at lectus. Quisque dignissim imperdiet consectetur. Praesent scelerisque neque.',
558
                    1 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pretium varius est sit amet consectetur. Suspendisse cursus dapibus egestas. Ut id augue quis mi scelerisque.'
559
                ))
560
            ),
561
            'HighSchool' => array(
562
                'collapse' => 'false',
563
                'date' => 'Juin 2002',
564
                'education' => 'Mon diplôme dans mon lycée',
565
                'descriptions' => array('item' => array(
566
                    0 => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc in auctor ipsum. Nullam venenatis sem.'
567
                ))
568
            ),
569
            'FirstSchool' => array(
570
                'collapse' => 'true',
571
                'date' => 'Juin 2000',
572
                'education' => 'Mon diplôme dans mon collège'
573
            )
574
        );
575
        $this->assertCVInterface();
576
    }
577
578
    public function testGetLanguageSkills() {
579
        $this->interface = 'getLanguageSkills';
580
581
        $this->arrayToCompare = array(
582
            'French' => array(
583
                'title' => 'French',
584
                'description' => 'Level of the skill.',
585
                'icon' => 'bundles/fabiencrassatcurriculumvitae/img/Flag-of-France.png'
586
            ),
587
            'English' => array(
588
                'title' => 'English',
589
                'description' => 'Level of the skill.',
590
                'icon' => 'bundles/fabiencrassatcurriculumvitae/img/Flag-of-United-Kingdom.png'
591
            )
592
        );
593
        $this->assertCVInterface();
594
595
        $this->lang = 'fr';
596
        $this->arrayToCompare = array(
597
            'French' => array(
598
                'title' => 'Français',
599
                'description' => 'Niveau',
600
                'icon' => 'bundles/fabiencrassatcurriculumvitae/img/Flag-of-France.png'
601
            ),
602
            'English' => array(
603
                'title' => 'Anglais',
604
                'description' => 'Niveau',
605
                'icon' => 'bundles/fabiencrassatcurriculumvitae/img/Flag-of-United-Kingdom.png'
606
            )
607
        );
608
        $this->assertCVInterface();
609
    }
610
611
    public function testGetMiscellaneous() {
612
        $this->interface = 'getMiscellaneous';
613
614
        $this->arrayToCompare = array(
615
            'Practical' => array(
616
                'title' => 'Practices',
617
                'miscellaneous' => 'My practices'
618
            )
619
        );
620
        $this->assertCVInterface();
621
622
        $this->lang = 'fr';
623
        $this->arrayToCompare = array(
624
            'Practical' => array(
625
                'title' => 'Pratiques',
626
                'miscellaneous' => 'Mes pratiques',
627
                'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec auctor nisl, eu fringilla nisi. Morbi scelerisque, est vitae mattis faucibus, felis sapien lobortis augue.'
628
            )
629
        );
630
        $this->assertCVInterface();
631
    }
632
633
    private function assertCVInterface($pathToFile = '/../../Resources/data/example.xml') {
634
        $this->CV = new CurriculumVitae(__DIR__.$pathToFile, $this->lang);
635
        $this->assertEquals($this->arrayToCompare, $this->CV->{$this->interface}());
636
    }
637
638
    /**
639
     * @expectedException InvalidArgumentException
640
     */
641
    public function testInvalidArgumentExceptionWithBadCurriculumVitaeFile() {
642
        $this->CV = new CurriculumVitae("abd file");
643
    }
644
645
    /**
646
     * @expectedException InvalidArgumentException
647
     */
648
    public function testInvalidArgumentExceptionWithNoValidXMLFile() {
649
        $this->CV = new CurriculumVitae( __DIR__.'/../Resources/data/empty.xml');
650
        $this->CV->getDropDownLanguages();
651
    }
652
653
    /**
654
     * @expectedException InvalidArgumentException
655
     */
656
    public function testInvalidArgumentExceptionWithFatalErrorXMLFile() {
657
        $this->CV = new CurriculumVitae(__DIR__.'/../Resources/data/fatalerror.xml');
658
        $this->CV->getDropDownLanguages();
659
    }
660
}
661