DefaultControllerExpectedExceptionTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testBadLanguage() 0 5 1
A testCVDoesNotExistIndex() 0 5 1
A testIfAnExportPDFServiceIsNotPresent() 0 5 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\Controller;
13
14
use FabienCrassat\CurriculumVitaeBundle\Entity\CurriculumVitae;
15
use FabienCrassat\CurriculumVitaeBundle\Utility\ArrayFunctions;
16
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
17
use Symfony\Component\Serializer\Serializer;
18
use Symfony\Component\Serializer\Encoder\XmlEncoder;
19
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
20
21
class DefaultControllerExpectedExceptionTest extends WebTestCase
22
{
23
    /**
24
     * @expectedException(Symfony\Component\HttpKernel\Exception\NotFoundHttpException)
25
     */
26
    public function testIfAnExportPDFServiceIsNotPresent()
27
    {
28
        $client = static::createClient();
29
        $client->request('GET', '/example/en/pdf');
30
        $this->assertEquals(404, $client->getResponse()->getStatusCode());
31
    }
32
33
    /**
34
     * @expectedException(Symfony\Component\HttpKernel\Exception\NotFoundHttpException)
35
     */
36
    public function testCVDoesNotExistIndex()
37
    {
38
        $client = static::createClient();
39
        $client->request('GET', '/nofile');
40
        $this->assertEquals(404, $client->getResponse()->getStatusCode());
41
    }
42
43
    /**
44
     * @expectedException(Symfony\Component\HttpKernel\Exception\NotFoundHttpException)
45
     */
46
    public function testBadLanguage()
47
    {
48
        $client = static::createClient();
49
        $client->request('GET', '/example/XX');
50
        $this->assertEquals(404, $client->getResponse()->getStatusCode());
51
    }
52
}
53