Completed
Push — in-portal ( 542489...3b6de0 )
by Alexander
04:02
created

ValidVariableNameUnitTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getErrorList() 0 41 1
A getWarningList() 0 4 1
1
<?php
2
/**
3
 * Unit test class for the ValidVariableName sniff.
4
 *
5
 * PHP version 5
6
 *
7
 * @category PHP
8
 * @package  PHP_CodeSniffer
9
 * @author   Greg Sherwood <[email protected]>
10
 * @author   Marc McIntyre <[email protected]>
11
 * @author   Alexander Obuhovich <[email protected]>
12
 * @license  https://github.com/aik099/CodingStandard/blob/master/LICENSE BSD 3-Clause
13
 * @link     https://github.com/aik099/CodingStandard
14
 */
15
16
namespace CodingStandard\Tests\NamingConventions;
17
18
use TestSuite\AbstractSniffUnitTest;
19
20
/**
21
 * Unit test class for the ValidVariableName sniff.
22
 *
23
 * A sniff unit test checks a .inc file for expected violations of a single
24
 * coding standard. Expected errors and warnings are stored in this class.
25
 *
26
 * @category PHP
27
 * @package  PHP_CodeSniffer
28
 * @author   Greg Sherwood <[email protected]>
29
 * @author   Marc McIntyre <[email protected]>
30
 * @author   Alexander Obuhovich <[email protected]>
31
 * @license  https://github.com/aik099/CodingStandard/blob/master/LICENSE BSD 3-Clause
32
 * @link     https://github.com/aik099/CodingStandard
33
 */
34
class ValidVariableNameUnitTest extends AbstractSniffUnitTest
35
{
36
37
38
    /**
39
     * Returns the lines where errors should occur.
40
     *
41
     * The key of the array should represent the line number and the value
42
     * should represent the number of errors that should occur on that line.
43
     *
44
     * @param string $testFile Name of the file with test data.
45
     *
46
     * @return array(int => int)
47
     */
48
    public function getErrorList($testFile)
49
    {
50
        return array(
51
                2   => 1,
52
                5   => 1,
53
                10  => 1,
54
                12  => 1,
55
                15  => 1,
56
                17  => 1,
57
                20  => 1,
58
                22  => 1,
59
                25  => 1,
60
                27  => 1,
61
                30  => 1,
62
                33  => 1,
63
                35  => 1,
64
                37  => 1,
65
                40  => 1,
66
                42  => 1,
67
                45  => 1,
68
                64  => 1,
69
                65  => 1,
70
                68  => 1,
71
                71  => 1,
72
                79  => 1,
73
                80  => 1,
74
                81  => 1,
75
                82  => 1,
76
                84  => 1,
77
                109 => 1,
78
                110 => 1,
79
                111 => 1,
80
                119 => 1,
81
                123 => 2,
82
                124 => 1,
83
                133 => 1,
84
                137 => 2,
85
                138 => 1,
86
                141 => 1,
87
               );
88
    }//end getErrorList()
89
90
91
    /**
92
     * Returns the lines where warnings should occur.
93
     *
94
     * The key of the array should represent the line number and the value
95
     * should represent the number of warnings that should occur on that line.
96
     *
97
     * @param string $testFile Name of the file with test data.
98
     *
99
     * @return array(int => int)
100
     */
101
    public function getWarningList($testFile)
102
    {
103
        return array();
104
    }//end getWarningList()
105
}//end class
106