Completed
Push — master ( 4cac96...5c184e )
by Jeroen
11:16
created

GroupTypeTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testMethods() 15 15 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
namespace Kunstmaan\AdminBundle\Tests\Form;
4
5
use Kunstmaan\AdminBundle\Form\GroupType;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\Form\FormBuilder;
8
9
/**
10
 * Class GroupTypeTest
11
 */
12 View Code Duplication
class GroupTypeTest 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...
13
{
14
    public function testMethods()
15
    {
16
        $type = new GroupType();
17
18
        $builder = $this->createMock(FormBuilder::class);
19
20
        $builder->expects($this->exactly(2))
21
            ->method('add')
22
            ->willReturn($builder);
23
24
        /* @var FormBuilder $builder */
25
        $type->buildForm($builder, []);
26
27
        $this->assertEquals('group', $type->getBlockPrefix());
28
    }
29
}
30