Passed
Pull Request — master (#15)
by Fabien
05:46 queued 02:57
created

CurriculumVitaeInvalidArgumentExceptionTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testInvalidArgumentExceptionWithBadCurriculumVitaeFile() 0 3 1
A testInvalidArgumentExceptionWithNoValidXMLFile() 0 4 1
A testInvalidArgumentExceptionWithFatalErrorXMLFile() 0 4 1
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 CurriculumVitaeInvalidArgumentExceptionTest extends \PHPUnit_Framework_TestCase
17
{
18
    private $curriculumVitae;
19
20
    /**
21
     * @expectedException InvalidArgumentException
22
     */
23
    public function testInvalidArgumentExceptionWithBadCurriculumVitaeFile() {
24
        $this->curriculumVitae = new CurriculumVitae('abd file');
25
    }
26
27
    /**
28
     * @expectedException InvalidArgumentException
29
     */
30
    public function testInvalidArgumentExceptionWithNoValidXMLFile() {
31
        $this->curriculumVitae = new CurriculumVitae( __DIR__.'/../Resources/data/empty.xml');
32
        $this->curriculumVitae->getDropDownLanguages();
33
    }
34
35
    /**
36
     * @expectedException InvalidArgumentException
37
     */
38
    public function testInvalidArgumentExceptionWithFatalErrorXMLFile() {
39
        $this->curriculumVitae = new CurriculumVitae(__DIR__.'/../Resources/data/fatalerror.xml');
40
        $this->curriculumVitae->getDropDownLanguages();
41
    }
42
}
43