@@ 12-26 (lines=15) @@ | ||
9 | * |
|
10 | * @package MS\PHPMD\Tests\Functional\CleanCode |
|
11 | */ |
|
12 | class MeaninglessMethodNameTest extends AbstractProcessTest |
|
13 | { |
|
14 | /** |
|
15 | * @covers MS\PHPMD\Rule\CleanCode\MeaninglessMethodName |
|
16 | */ |
|
17 | public function testMeaninglessMethodNameRule() |
|
18 | { |
|
19 | $output = $this |
|
20 | ->runPhpmd('Service/GeneralManager.php', 'cleancode.xml') |
|
21 | ->getOutput(); |
|
22 | ||
23 | $this->assertContains('GeneralManager.php:15 Try to avoid meaningless method names like getData. Also getData,getInformation,setData,setInformation are meaningless. Find a name which is not so general.', $output); |
|
24 | $this->assertNotContains('GeneralManager.php:25 Try to avoid meaningless method names', $output); |
|
25 | } |
|
26 | } |
|
27 |
@@ 12-26 (lines=15) @@ | ||
9 | * |
|
10 | * @package MS\PHPMD\Tests\Functional\CleanCode |
|
11 | */ |
|
12 | class TraitPublicMethodTest extends AbstractProcessTest |
|
13 | { |
|
14 | /** |
|
15 | * @covers MS\PHPMD\Rule\CleanCode\TraitPublicMethod |
|
16 | */ |
|
17 | public function testTraitPublicMethodRule() |
|
18 | { |
|
19 | $output = $this |
|
20 | ->runPhpmd('Utility/UserComparator.php', 'cleancode.xml') |
|
21 | ->getOutput(); |
|
22 | ||
23 | $this->assertContains('UserComparator.php:22 The purpose of a trait should be the reuse of methods which help the basic classes. Make your code clearly and define interfaces of your class as public methods.', $output); |
|
24 | $this->assertNotContains('UserComparator.php:15', $output); |
|
25 | } |
|
26 | } |
|
27 |