testRuleWithFinalStaticClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace MS\PHPMD\Tests\Functional\Symfony2;
4
5
use MS\PHPMD\Tests\Functional\AbstractProcessTest;
6
7
/**
8
 * Class EntityConstantsTest
9
 *
10
 * @package MS\PHPMD\Tests\Functional\Symfony2
11
 */
12
class EntityConstantsTest extends AbstractProcessTest
13
{
14
    /**
15
     * @covers MS\PHPMD\Rule\Symfony2\EntityConstants
16
     * @covers MS\PHPMD\Rule\Symfony2\AbstractEntityRule
17
     */
18
    public function testEntityConstantsRule()
19
    {
20
        $output = $this
21
            ->runPhpmd('Entity/Foo.php', 'symfony2.xml')
22
            ->getOutput();
23
24
        $this->assertContains('Entity/Foo.php:10	Don\'t contain constants in your entity. Important information are distribute throughout the project. You reduce the reusability.', $output);
25
    }
26
27
    /**
28
     * @covers MS\PHPMD\Rule\Symfony2\EntityConstants
29
     * @covers MS\PHPMD\Rule\Symfony2\AbstractEntityRule
30
     */
31
    public function testRuleWithFinalStaticClass()
32
    {
33
        $output = $this
34
            ->runPhpmd('Statics/Identifier.php', 'symfony2.xml')
35
            ->getOutput();
36
37
        $this->assertEmpty(trim($output));
38
    }
39
}
40