~ubuntu-branches/ubuntu/vivid/php-codesniffer/vivid

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-1.5.0RC2/CodeSniffer/Standards/Generic/Tests/Commenting/FixmeUnitTest.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 Fixme 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
 * @author    Sam Graham <php-codesniffer BLAHBLAH illusori.co.uk>
 
12
 * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
 
13
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 
14
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 
15
 */
 
16
 
 
17
/**
 
18
 * Unit test class for the Fixme sniff.
 
19
 *
 
20
 * A sniff unit test checks a .inc file for expected violations of a single
 
21
 * coding standard. Expected errors and warnings are stored in this class.
 
22
 *
 
23
 * @category  PHP
 
24
 * @package   PHP_CodeSniffer
 
25
 * @author    Greg Sherwood <gsherwood@squiz.net>
 
26
 * @author    Marc McIntyre <mmcintyre@squiz.net>
 
27
 * @author    Sam Graham <php-codesniffer BLAHBLAH illusori.co.uk>
 
28
 * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
 
29
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 
30
 * @version   Release: 1.5.0RC2
 
31
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 
32
 */
 
33
class Generic_Tests_Commenting_FixmeUnitTest extends AbstractSniffUnitTest
 
34
{
 
35
 
 
36
 
 
37
    /**
 
38
     * Returns the lines where errors should occur.
 
39
     *
 
40
     * The key of the array should represent the line number and the value
 
41
     * should represent the number of errors that should occur on that line.
 
42
     *
 
43
     * @param string $testFile The name of the file being tested.
 
44
     *
 
45
     * @return array(int => int)
 
46
     */
 
47
    public function getErrorList($testFile='FixmeUnitTest.inc')
 
48
    {
 
49
        switch ($testFile) {
 
50
        case 'FixmeUnitTest.inc':
 
51
            return array(
 
52
                    3  => 1,
 
53
                    7  => 1,
 
54
                    10 => 1,
 
55
                    13 => 1,
 
56
                    16 => 1,
 
57
                    18 => 1,
 
58
                    21 => 1,
 
59
                   );
 
60
            break;
 
61
        case 'FixmeUnitTest.js':
 
62
            return array(
 
63
                    3  => 1,
 
64
                    7  => 1,
 
65
                    10 => 1,
 
66
                    13 => 1,
 
67
                    16 => 1,
 
68
                    18 => 1,
 
69
                    21 => 1,
 
70
                   );
 
71
            break;
 
72
        default:
 
73
            return array();
 
74
            break;
 
75
        }//end switch
 
76
 
 
77
    }//end getErrorList()
 
78
 
 
79
 
 
80
    /**
 
81
     * Returns the lines where warnings should occur.
 
82
     *
 
83
     * The key of the array should represent the line number and the value
 
84
     * should represent the number of warnings that should occur on that line.
 
85
     *
 
86
     * @param string $testFile The name of the file being tested.
 
87
     *
 
88
     * @return array(int => int)
 
89
     */
 
90
    public function getWarningList($testFile='FixmeUnitTest.inc')
 
91
    {
 
92
        return array();
 
93
 
 
94
    }//end getWarningList()
 
95
 
 
96
 
 
97
}//end class
 
98
 
 
99
?>