Code Duplication    Length = 74-74 lines in 3 locations

src/test/php/PHPMD/Rule/CleanCode/UndefinedValiableTest.php 1 location

@@ 28-101 (lines=74) @@
25
 * @covers \PHPMD\Rule\UndefinedVariable
26
 * @covers \PHPMD\Rule\AbstractLocalVariable
27
 */
28
class UndefinedVariableTest extends AbstractTest
29
{
30
    /**
31
     * testRuleAppliesToUndefinedVariable
32
     *
33
     * @return void
34
     */
35
    public function testRuleAppliesToUndefinedVariable()
36
    {
37
        $rule = new UndefinedVariable();
38
        $rule->setReport($this->getReportMock(1));
39
        $rule->apply($this->getMethod());
40
    }
41
42
    /**
43
     * testRuleAppliesToUndefinedVariableWithDefinedVariable
44
     *
45
     * @return void
46
     */
47
    public function testRuleAppliesToUndefinedVariableWithDefinedVariable()
48
    {
49
        $rule = new UndefinedVariable();
50
        $rule->setReport($this->getReportMock(1));
51
        $rule->apply($this->getMethod());
52
    }
53
54
    /**
55
     * testRuleAppliesToUndefinedVariableOnArray
56
     *
57
     * @return void
58
     */
59
    public function testRuleAppliesToUndefinedVariableOnArray()
60
    {
61
        $rule = new UndefinedVariable();
62
        $rule->setReport($this->getReportMock(1));
63
        $rule->apply($this->getMethod());
64
    }
65
66
    /**
67
     * testRuleAppliesToUndefinedVariableOnArrayWithKeys
68
     *
69
     * @return void
70
     */
71
    public function testRuleAppliesToUndefinedVariableOnArrayWithKeys()
72
    {
73
        $rule = new UndefinedVariable();
74
        $rule->setReport($this->getReportMock(1));
75
        $rule->apply($this->getMethod());
76
    }
77
78
    /**
79
     * testRuleAppliesToUndefinedVariableOnArrayWithKeys
80
     *
81
     * @return void
82
     */
83
    public function testRuleDoesNotApplyToSuperGlobals()
84
    {
85
        $rule = new UndefinedVariable();
86
        $rule->setReport($this->getReportMock(0));
87
        $rule->apply($this->getMethod());
88
    }
89
90
    /**
91
     * testRuleDoesNotApplyToUsedProperties
92
     *
93
     * @return void
94
     */
95
    public function testRuleDoesNotApplyToUsedProperties()
96
    {
97
        $rule = new UndefinedVariable();
98
        $rule->setReport($this->getReportMock(0));
99
        $rule->apply($this->getMethod());
100
    }
101
}
102

src/test/php/PHPMD/Rule/Design/EvalExpressionTest.php 1 location

@@ 27-100 (lines=74) @@
24
 *
25
 * @covers \PHPMD\Rule\Design\EvalExpression
26
 */
27
class EvalExpressionTest extends AbstractTest
28
{
29
    /**
30
     * testRuleNotAppliesToMethodWithoutEvalExpression
31
     *
32
     * @return void
33
     */
34
    public function testRuleNotAppliesToMethodWithoutEvalExpression()
35
    {
36
        $rule = new EvalExpression();
37
        $rule->setReport($this->getReportMock(0));
38
        $rule->apply($this->getMethod());
39
    }
40
41
    /**
42
     * testRuleAppliesToMethodWithEvalExpression
43
     *
44
     * @return void
45
     */
46
    public function testRuleAppliesToMethodWithEvalExpression()
47
    {
48
        $rule = new EvalExpression();
49
        $rule->setReport($this->getReportMock(1));
50
        $rule->apply($this->getMethod());
51
    }
52
53
    /**
54
     * testRuleAppliesMultipleTimesToMethodWithEvalExpression
55
     *
56
     * @return void
57
     */
58
    public function testRuleAppliesMultipleTimesToMethodWithEvalExpression()
59
    {
60
        $rule = new EvalExpression();
61
        $rule->setReport($this->getReportMock(3));
62
        $rule->apply($this->getMethod());
63
    }
64
65
    /**
66
     * testRuleNotAppliesToFunctionWithoutEvalExpression
67
     *
68
     * @return void
69
     */
70
    public function testRuleNotAppliesToFunctionWithoutEvalExpression()
71
    {
72
        $rule = new EvalExpression();
73
        $rule->setReport($this->getReportMock(0));
74
        $rule->apply($this->getFunction());
75
    }
76
77
    /**
78
     * testRuleAppliesToFunctionWithEvalExpression
79
     *
80
     * @return void
81
     */
82
    public function testRuleAppliesToFunctionWithEvalExpression()
83
    {
84
        $rule = new EvalExpression();
85
        $rule->setReport($this->getReportMock(1));
86
        $rule->apply($this->getFunction());
87
    }
88
89
    /**
90
     * testRuleAppliesMultipleTimesToFunctionWithEvalExpression
91
     *
92
     * @return void
93
     */
94
    public function testRuleAppliesMultipleTimesToFunctionWithEvalExpression()
95
    {
96
        $rule = new EvalExpression();
97
        $rule->setReport($this->getReportMock(3));
98
        $rule->apply($this->getFunction());
99
    }
100
}
101

src/test/php/PHPMD/Rule/Design/ExitExpressionTest.php 1 location

@@ 27-100 (lines=74) @@
24
 *
25
 * @covers \PHPMD\Rule\Design\ExitExpression
26
 */
27
class ExitExpressionTest extends AbstractTest
28
{
29
    /**
30
     * testRuleNotAppliesToMethodWithoutExitExpression
31
     *
32
     * @return void
33
     */
34
    public function testRuleNotAppliesToMethodWithoutExitExpression()
35
    {
36
        $rule = new ExitExpression();
37
        $rule->setReport($this->getReportMock(0));
38
        $rule->apply($this->getMethod());
39
    }
40
41
    /**
42
     * testRuleAppliesToMethodWithExitExpression
43
     *
44
     * @return void
45
     */
46
    public function testRuleAppliesToMethodWithExitExpression()
47
    {
48
        $rule = new ExitExpression();
49
        $rule->setReport($this->getReportMock(1));
50
        $rule->apply($this->getMethod());
51
    }
52
53
    /**
54
     * testRuleAppliesMultipleTimesToMethodWithExitExpression
55
     *
56
     * @return void
57
     */
58
    public function testRuleAppliesMultipleTimesToMethodWithExitExpression()
59
    {
60
        $rule = new ExitExpression();
61
        $rule->setReport($this->getReportMock(3));
62
        $rule->apply($this->getMethod());
63
    }
64
65
    /**
66
     * testRuleNotAppliesToFunctionWithoutExitExpression
67
     *
68
     * @return void
69
     */
70
    public function testRuleNotAppliesToFunctionWithoutExitExpression()
71
    {
72
        $rule = new ExitExpression();
73
        $rule->setReport($this->getReportMock(0));
74
        $rule->apply($this->getFunction());
75
    }
76
77
    /**
78
     * testRuleAppliesToFunctionWithExitExpression
79
     *
80
     * @return void
81
     */
82
    public function testRuleAppliesToFunctionWithExitExpression()
83
    {
84
        $rule = new ExitExpression();
85
        $rule->setReport($this->getReportMock(1));
86
        $rule->apply($this->getFunction());
87
    }
88
89
    /**
90
     * testRuleAppliesMultipleTimesToFunctionWithExitExpression
91
     *
92
     * @return void
93
     */
94
    public function testRuleAppliesMultipleTimesToFunctionWithExitExpression()
95
    {
96
        $rule = new ExitExpression();
97
        $rule->setReport($this->getReportMock(3));
98
        $rule->apply($this->getFunction());
99
    }
100
}
101