1 | <?php |
||
12 | class EntitySimpleGetterSetterTest extends AbstractProcessTest |
||
13 | { |
||
14 | /** |
||
15 | * @covers MS\PHPMD\Rule\Symfony2\EntitySimpleGetterSetter |
||
16 | * @covers MS\PHPMD\Rule\Symfony2\AbstractEntityRule |
||
17 | */ |
||
18 | public function testEntitySimpleGetterSetterRule() |
||
19 | { |
||
20 | $output = $this |
||
21 | ->runPhpmd('Entity/Foo.php', 'symfony2.xml') |
||
22 | ->getOutput(); |
||
23 | |||
24 | $this->assertContains('Entity/Foo.php:80 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
25 | $this->assertContains('Entity/Foo.php:91 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
26 | $this->assertContains('Entity/Foo.php:101 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
27 | $this->assertContains('Entity/Foo.php:113 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
28 | |||
29 | $this->assertNotContains('Entity/Foo.php:22', $output); |
||
30 | $this->assertNotContains('Entity/Foo.php:34', $output); |
||
31 | $this->assertNotContains('Entity/Foo.php:46', $output); |
||
32 | $this->assertNotContains('Entity/Foo.php:56', $output); |
||
33 | $this->assertNotContains('Entity/Foo.php:68', $output); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @covers MS\PHPMD\Rule\Symfony2\EntitySimpleGetterSetter |
||
38 | * @covers MS\PHPMD\Rule\Symfony2\AbstractEntityRule |
||
39 | */ |
||
40 | public function testForceEntitySimpleGetterSetterRule() |
||
41 | { |
||
42 | $output = $this |
||
43 | ->runPhpmd('Entity/FooAssociation.php', 'symfony2.xml') |
||
44 | ->getOutput(); |
||
45 | |||
46 | $this->assertContains('Entity/FooAssociation.php:79 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
47 | $this->assertContains('Entity/FooAssociation.php:90 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
48 | $this->assertContains('Entity/FooAssociation.php:100 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
49 | $this->assertContains('Entity/FooAssociation.php:112 The method should only be a simple get,set,is,has,add,remove in this entity.', $output); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @covers MS\PHPMD\Rule\Symfony2\EntitySimpleGetterSetter |
||
54 | * @covers MS\PHPMD\Rule\Symfony2\AbstractEntityRule |
||
55 | */ |
||
56 | public function testRuleWithModel() |
||
64 | |||
65 | /** |
||
66 | * @covers MS\PHPMD\Rule\Symfony2\EntitySimpleGetterSetter |
||
67 | * @covers MS\PHPMD\Rule\Symfony2\AbstractEntityRule |
||
68 | */ |
||
69 | public function testRuleWithTestForEntity() |
||
77 | } |
||
78 |