Completed
Push — master ( 5e98ee...3dda2e )
by Michael
04:38
created

SwitchStatementTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testSwitchStatementRule() 0 8 1
1
<?php
2
3
namespace MS\PHPMD\Tests\Functional\CleanCode;
4
5
use MS\PHPMD\Tests\Functional\AbstractProcessTest;
6
7
/**
8
 * Class SwitchStatementTest
9
 *
10
 * @package MS\PHPMD\Tests\Functional\CleanCode
11
 */
12
class SwitchStatementTest extends AbstractProcessTest
13
{
14
    /**
15
     * @covers MS\PHPMD\Rule\CleanCode\SwitchStatement
16
     */
17
    public function testSwitchStatementRule()
18
    {
19
        $output = $this
20
            ->runPhpmd('Service/Switcher.php', 'cleancode.xml')
21
            ->getOutput();
22
23
        $this->assertContains('GeneralManager.php:17	Try to avoid using switch-case statements. Use polymorphism instead.', $output);
24
    }
25
}
26