Completed
Push — master ( 8dda9e...e47526 )
by Jeroen
06:51 queued 11s
created

ToTopPagePartTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 4 4 1
A testToString() 4 4 1
A testGetDefaultView() 4 4 1
A testGetDefaultAdminType() 4 4 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\PagePartBundle\Tests\Entity;
4
5
use Kunstmaan\PagePartBundle\Entity\ToTopPagePart;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * Class ToTopPagePartTest
10
 */
11 View Code Duplication
class ToTopPagePartTest 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...
12
{
13
    /**
14
     * @var ToTopPagePart
15
     */
16
    protected $object;
17
18
    /**
19
     * Sets up the fixture, for example, opens a network connection.
20
     * This method is called before a test is executed.
21
     */
22
    protected function setUp(): void
23
    {
24
        $this->object = new ToTopPagePart();
25
    }
26
27
    /**
28
     * Generated from @assert () == 'ToTopPagePart'.
29
     */
30
    public function testToString()
31
    {
32
        $this->assertEquals('ToTopPagePart', $this->object->__toString());
33
    }
34
35
    /**
36
     * Generated from @assert () == 'KunstmaanPagePartBundle:ToTopPagePart:view.html.twig'.
37
     */
38
    public function testGetDefaultView()
39
    {
40
        $this->assertEquals('@KunstmaanPagePart/ToTopPagePart/view.html.twig', $this->object->getDefaultView());
41
    }
42
43
    public function testGetDefaultAdminType()
44
    {
45
        $this->assertEquals('Kunstmaan\PagePartBundle\Form\ToTopPagePartAdminType', $this->object->getDefaultAdminType());
46
    }
47
}
48