testRuleWithAbstractClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 8
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace MS\PHPMD\Tests\Functional\Symfony2;
4
5
use MS\PHPMD\Tests\Functional\AbstractProcessTest;
6
7
/**
8
 * Class ControllerMethodNameTest
9
 *
10
 * @package PHPMD\Tests\Functional\Symfony2
11
 */
12 View Code Duplication
class ControllerMethodNameTest extends AbstractProcessTest
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
    /**
15
     * @covers MS\PHPMD\Rule\Symfony2\ControllerMethodName
16
     */
17
    public function testControllerMethodNameRule()
18
    {
19
        $output = $this
20
            ->runPhpmd('Controller/FooController.php', 'symfony2.xml')
21
            ->getOutput();
22
23
        $this->assertNotContains('Controller/FooController.php:18	The method name should end with Action in this controller.', $output);
24
        $this->assertContains('Controller/FooController.php:33	The method name should end with Action in this controller.', $output);
25
    }
26
27
    /**
28
     * @covers MS\PHPMD\Rule\Symfony2\ControllerMethodName
29
     */
30
    public function testRuleWithAbstractClass()
31
    {
32
        $output = $this
33
            ->runPhpmd('Controller/AbstractFooController.php', 'symfony2.xml')
34
            ->getOutput();
35
36
        $this->assertEmpty(trim($output));
37
    }
38
}
39