~ubuntu-branches/ubuntu/wily/php-codesniffer/wily-proposed

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-2.3.3/CodeSniffer/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php

  • Committer: Package Import Robot
  • Author(s): David Prévot, Greg Sherwood
  • Date: 2015-06-24 13:41:36 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20150624134136-dv60dnl6s20tdxwr
Tags: 2.3.3-1
[ Greg Sherwood ]
Prepare for 2.3.3 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Unit test class for FunctionCommentSniff.
 
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-2014 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 FunctionCommentSniff.
 
18
 *
 
19
 * Verifies that :
 
20
 * <ul>
 
21
 *  <li>A doc comment exists.</li>
 
22
 *  <li>Short description must start with a capital letter and end with a period.</li>
 
23
 *  <li>There must be one blank newline after the short description.</li>
 
24
 *  <li>A PHP version is specified.</li>
 
25
 *  <li>Check the order of the tags.</li>
 
26
 *  <li>Check the indentation of each tag.</li>
 
27
 *  <li>Check required and optional tags and the format of their content.</li>
 
28
 * </ul>
 
29
 *
 
30
 * @category  PHP
 
31
 * @package   PHP_CodeSniffer
 
32
 * @author    Greg Sherwood <gsherwood@squiz.net>
 
33
 * @author    Marc McIntyre <mmcintyre@squiz.net>
 
34
 * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
 
35
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 
36
 * @version   Release: 2.3.3
 
37
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 
38
 */
 
39
class PEAR_Tests_Commenting_FileCommentUnitTest extends AbstractSniffUnitTest
 
40
{
 
41
 
 
42
 
 
43
    /**
 
44
     * Returns the lines where errors should occur.
 
45
     *
 
46
     * The key of the array should represent the line number and the value
 
47
     * should represent the number of errors that should occur on that line.
 
48
     *
 
49
     * @return array<int, int>
 
50
     */
 
51
    public function getErrorList()
 
52
    {
 
53
        return array(
 
54
                21 => 1,
 
55
                23 => 2,
 
56
                24 => 1,
 
57
                26 => 1,
 
58
                28 => 1,
 
59
                29 => 1,
 
60
                30 => 1,
 
61
                31 => 1,
 
62
                32 => 2,
 
63
                33 => 1,
 
64
                34 => 1,
 
65
                35 => 1,
 
66
                40 => 1,
 
67
               );
 
68
 
 
69
    }//end getErrorList()
 
70
 
 
71
 
 
72
    /**
 
73
     * Returns the lines where warnings should occur.
 
74
     *
 
75
     * The key of the array should represent the line number and the value
 
76
     * should represent the number of warnings that should occur on that line.
 
77
     *
 
78
     * @return array<int, int>
 
79
     */
 
80
    public function getWarningList()
 
81
    {
 
82
        return array(
 
83
                29 => 1,
 
84
                30 => 1,
 
85
                34 => 1,
 
86
                40 => 1,
 
87
               );
 
88
 
 
89
    }//end getWarningList()
 
90
 
 
91
 
 
92
}//end class
 
93
 
 
94
?>