~ubuntu-branches/ubuntu/trusty/php-codesniffer/trusty

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-1.5.0RC2/CodeSniffer/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php

  • Committer: Package Import Robot
  • Author(s): Thomas Goirand
  • Date: 2013-07-12 15:16:25 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130712151625-4autdc0twzbueha9
Tags: 1.5.0~rc2-1
* New upstream release.
* Refreshed patch.
* Standards-Version is now 3.9.4.
* Canonical VCS URLs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Unit test class for the OperatorSpacing sniff.
 
4
 *
 
5
 * PHP version 5
 
6
 *
 
7
 * @category  PHP
 
8
 * @package   PHP_CodeSniffer
 
9
 * @author    Greg Sherwood <gsherwood@squiz.net>
 
10
 * @author    Marc McIntyre <mmcintyre@squiz.net>
 
11
 * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
 
12
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 
13
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 
14
 */
 
15
 
 
16
/**
 
17
 * Unit test class for the OperatorSpacing sniff.
 
18
 *
 
19
 * A sniff unit test checks a .inc file for expected violations of a single
 
20
 * coding standard. Expected errors and warnings are stored in this class.
 
21
 *
 
22
 * @category  PHP
 
23
 * @package   PHP_CodeSniffer
 
24
 * @author    Greg Sherwood <gsherwood@squiz.net>
 
25
 * @author    Marc McIntyre <mmcintyre@squiz.net>
 
26
 * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
 
27
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 
28
 * @version   Release: 1.5.0RC2
 
29
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 
30
 */
 
31
class Squiz_Tests_WhiteSpace_OperatorSpacingUnitTest extends AbstractSniffUnitTest
 
32
{
 
33
 
 
34
 
 
35
    /**
 
36
     * Returns the lines where errors should occur.
 
37
     *
 
38
     * The key of the array should represent the line number and the value
 
39
     * should represent the number of errors that should occur on that line.
 
40
     *
 
41
     * @param string $testFile The name of the file being tested.
 
42
     *
 
43
     * @return array(int => int)
 
44
     */
 
45
    public function getErrorList($testFile='OperatorSpacingUnitTest.inc')
 
46
    {
 
47
        switch ($testFile) {
 
48
        case 'OperatorSpacingUnitTest.inc':
 
49
            return array(
 
50
                    4  => 1,
 
51
                    5  => 2,
 
52
                    6  => 1,
 
53
                    7  => 1,
 
54
                    8  => 2,
 
55
                    11 => 1,
 
56
                    12 => 2,
 
57
                    13 => 1,
 
58
                    14 => 1,
 
59
                    15 => 2,
 
60
                    18 => 1,
 
61
                    19 => 2,
 
62
                    20 => 1,
 
63
                    21 => 1,
 
64
                    22 => 2,
 
65
                    25 => 1,
 
66
                    26 => 2,
 
67
                    27 => 1,
 
68
                    28 => 1,
 
69
                    29 => 2,
 
70
                    32 => 1,
 
71
                    33 => 2,
 
72
                    34 => 1,
 
73
                    35 => 1,
 
74
                    36 => 2,
 
75
                    40 => 2,
 
76
                    42 => 2,
 
77
                    44 => 2,
 
78
                    45 => 1,
 
79
                    46 => 2,
 
80
                    53 => 2,
 
81
                    54 => 1,
 
82
                    59 => 10,
 
83
                    64 => 1,
 
84
                    77 => 4,
 
85
                    78 => 1,
 
86
                    79 => 1,
 
87
                    80 => 2,
 
88
                    81 => 1,
 
89
                    84 => 6,
 
90
                    85 => 6,
 
91
                    87 => 4,
 
92
                    88 => 5,
 
93
                    90 => 4,
 
94
                    91 => 5,
 
95
                   );
 
96
            break;
 
97
        case 'OperatorSpacingUnitTest.js':
 
98
            return array(
 
99
                    4  => 1,
 
100
                    5  => 2,
 
101
                    6  => 1,
 
102
                    7  => 1,
 
103
                    8  => 2,
 
104
                    11 => 1,
 
105
                    12 => 2,
 
106
                    13 => 1,
 
107
                    14 => 1,
 
108
                    15 => 2,
 
109
                    18 => 1,
 
110
                    19 => 2,
 
111
                    20 => 1,
 
112
                    21 => 1,
 
113
                    22 => 2,
 
114
                    25 => 1,
 
115
                    26 => 2,
 
116
                    27 => 1,
 
117
                    28 => 1,
 
118
                    29 => 2,
 
119
                    32 => 1,
 
120
                    33 => 2,
 
121
                    34 => 1,
 
122
                    35 => 1,
 
123
                    36 => 2,
 
124
                    40 => 2,
 
125
                    42 => 2,
 
126
                    44 => 2,
 
127
                    45 => 1,
 
128
                    46 => 2,
 
129
                   );
 
130
            break;
 
131
        default:
 
132
            return array();
 
133
            break;
 
134
        }//end switch
 
135
 
 
136
    }//end getErrorList()
 
137
 
 
138
 
 
139
    /**
 
140
     * Returns the lines where warnings should occur.
 
141
     *
 
142
     * The key of the array should represent the line number and the value
 
143
     * should represent the number of warnings that should occur on that line.
 
144
     *
 
145
     * @return array(int => int)
 
146
     */
 
147
    public function getWarningList()
 
148
    {
 
149
        return array();
 
150
 
 
151
    }//end getWarningList()
 
152
 
 
153
 
 
154
}//end class
 
155
 
 
156
?>