Completed
Push — master ( 80a801...35d786 )
by Peter
21:35
created

DefaultControllerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testIndex() 0 9 1
A testContact() 0 9 1
A testCopyright() 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