Completed
Push — master ( 61d54e...4a5166 )
by Sam
03:19
created

DefaultControllerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 23
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testIndex() 0 19 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
10
    public function testIndex()
11
    {
12
        $client = static::createClient();
13
14
        // Check basics.
15
        $crawler = $client->request('GET', '/');
16
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
17
        $this->assertContains('Welcome to XTools!', $crawler->filter('#content h2')->text());
18
19
        // Change language.
20
        $crawler = $client->request('GET', '/?uselang=es');
21
        $this->assertContains(
22
            'Te damos la bienvenida a las herramientas de X!',
23
            $crawler->filter('#content h2')->text()
24
        );
25
26
        // Make sure all active tools are listed.
27
        $this->assertCount(7, $crawler->filter('#tool-list li'));
28
    }
29
}
30