DefaultControllerTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testIndex() 0 9 1
A testContact() 0 9 1
A testCopyright() 0 9 1
A testContributors() 0 9 1
1
<?php
2
3
namespace Tests\AppBundle\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6
7
class DefaultControllerTest extends WebTestCase
8
{
9
    public function testIndex()
10
    {
11
        $client = static::createClient();
12
13
        $crawler = $client->request('GET', '/');
14
15
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
16
        $this->assertContains('Welcome to Symfony.si', $crawler->filter('h1')->text());
17
    }
18
19
    public function testContact()
20
    {
21
        $client = static::createClient();
22
23
        $crawler = $client->request('GET', '/contact');
24
25
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
26
        $this->assertContains('Contact', $crawler->filter('h1')->text());
27
    }
28
29
    public function testCopyright()
30
    {
31
        $client = static::createClient();
32
33
        $crawler = $client->request('GET', '/copyrights');
34
35
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
36
        $this->assertContains('Copyrights', $crawler->filter('h1')->text());
37
    }
38
39
    public function testContributors()
40
    {
41
        $client = static::createClient();
42
43
        $crawler = $client->request('GET', '/contributors');
44
45
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
46
        $this->assertContains('Symfony.si contributors', $crawler->filter('h1')->text());
47
    }
48
}
49