Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * Unit test class for FileCommentSniff.
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 Squiz Pty Ltd (ABN 77 084 670 600)
12
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
13
 * @version   CVS: $Id: FileCommentUnitTest.php 244834 2007-10-26 02:14:45Z squiz $
14
 * @link      http://pear.php.net/package/PHP_CodeSniffer
15
 */
16
 
17
/**
18
 * Unit test class for FileCommentSniff.
19
 *
20
 * Verifies that :
21
 * <ul>
22
 *  <li>A doc comment exists.</li>
23
 *  <li>Short description must start with a capital letter and end with a period.</li>
24
 *  <li>There must be one blank newline after the short description.</li>
25
 *  <li>A PHP version is specified.</li>
26
 *  <li>Check the order of the tags.</li>
27
 *  <li>Check the indentation of each tag.</li>
28
 *  <li>Check required and optional tags and the format of their content.</li>
29
 * </ul>
30
 *
31
 * @category  PHP
32
 * @package   PHP_CodeSniffer
33
 * @author    Greg Sherwood <gsherwood@squiz.net>
34
 * @author    Marc McIntyre <mmcintyre@squiz.net>
35
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
36
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
37
 * @version   Release: 1.2.1
38
 * @link      http://pear.php.net/package/PHP_CodeSniffer
39
 */
40
class Squiz_Tests_Commenting_FileCommentUnitTest extends AbstractSniffUnitTest
41
{
42
 
43
 
44
    /**
45
     * Returns the lines where errors should occur.
46
     *
47
     * The key of the array should represent the line number and the value
48
     * should represent the number of errors that should occur on that line.
49
     *
50
     * @return array(int => int)
51
     */
52
    public function getErrorList()
53
    {
54
        return array(
55
                2  => 1,
56
                6  => 3,
57
                8  => 1,
58
                10 => 1,
59
                21 => 1,
60
                22 => 3,
61
                23 => 2,
62
                24 => 3,
63
                26 => 2,
64
                27 => 3,
65
                28 => 2,
66
                30 => 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
               );
85
 
86
    }//end getWarningList()
87
 
88
 
89
}//end class
90
 
91
?>