NavHorizontalTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreation() 7 7 1
A testNext() 8 8 1
A testAxisXMove() 8 8 1
A testAxisYMove() 8 8 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
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Symball\ReportBundle\Tests\Unit;
10
11
/* The base PHPUnit test class */
12
use PHPUnit\Framework\TestCase;
13
14
use Symball\ReportBundle\Service\NavHorizontal;
15
16
/* Extend the default PHPUnit test case */
17 View Code Duplication
class NavHorizontalTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /* Test that posts can be instantiated */
20
    public function testCreation()
21
    {
22
        /* Create a post */
23
        $nav = new NavHorizontal();
24
        /* Check that it is an object type */
25
        $this->assertEquals(true, is_object($nav));
26
    }
27
    public function testNext()
28
    {
29
        $nav = new NavHorizontal(1, 1);
30
        $nav->next();
31
32
        $this->assertEquals(1, $nav->column());
33
        $this->assertEquals(2, $nav->row());
34
    }
35
    public function testAxisXMove()
36
    {
37
        $nav = new NavHorizontal(1, 1);
38
        $nav->axisXMove();
39
40
        $this->assertEquals(1, $nav->column());
41
        $this->assertEquals(2, $nav->row());
42
    }
43
    public function testAxisYMove()
44
    {
45
        $nav = new NavHorizontal(1, 1);
46
        $nav->axisYMove();
47
48
        $this->assertEquals(2, $nav->column());
49
        $this->assertEquals(1, $nav->row());
50
    }
51
}
52