Failed Conditions
Push — master ( 1a6d63...dcbc0d )
by Adrien
05:26
created

CssControllerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGravatarAction() 0 14 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
class CssControllerTest extends AbstractControllerTestCase
4
{
5
    public function testGravatarAction(): void
6
    {
7
        $params = ['action' => 'gravatar.css', 'controller' => 'css', 'module' => 'default'];
8
        $url = $this->url($this->urlizeOptions($params));
9
        $this->dispatch($url);
10
11
        // assertions
12
        $this->assertModule($params['module']);
13
        $this->assertController($params['controller']);
14
        $this->assertAction($params['action']);
15
16
        $this->assertHeaderContains('Content-Type', 'text/css');
17
        $this->assertContentContains('span.gravatar');
18
        $this->assertContentContains('span.gravatar.big');
19
    }
20
}
21