Subversion Repositories Applications.framework

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 aurelien 1
<?php
2
/**
3
 * A PHP_CodeSniffer specific test suite for PHPUnit.
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: TestSuite.php,v 1.2 2007/08/15 01:27:30 squiz Exp $
14
 * @link      http://pear.php.net/package/PHP_CodeSniffer
15
 */
16
 
17
require_once 'PHPUnit/Framework/TestSuite.php';
18
 
19
/**
20
 * A PHP_CodeSniffer specific test suite for PHPUnit.
21
 *
22
 * Unregisters the PHP_CodeSniffer autoload function after the run.
23
 *
24
 * @category  PHP
25
 * @package   PHP_CodeSniffer
26
 * @author    Greg Sherwood <gsherwood@squiz.net>
27
 * @author    Marc McIntyre <mmcintyre@squiz.net>
28
 * @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
29
 * @license   http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
30
 * @version   Release: 1.2.0RC1
31
 * @link      http://pear.php.net/package/PHP_CodeSniffer
32
 */
33
class PHP_CodeSniffer_TestSuite extends PHPUnit_Framework_TestSuite
34
{
35
 
36
 
37
    /**
38
     * Runs the tests and collects their result in a TestResult.
39
     *
40
     * @param  PHPUnit_Framework_TestResult $result A test result.
41
     * @param  mixed                        $filter The filter passed to each test.
42
     *
43
     * @return PHPUnit_Framework_TestResult
44
     */
45
    public function run(PHPUnit_Framework_TestResult $result=null, $filter=false)
46
    {
47
        spl_autoload_register(array('PHP_CodeSniffer', 'autoload'));
48
        $result = parent::run($result, $filter);
49
        spl_autoload_unregister(array('PHP_CodeSniffer', 'autoload'));
50
        return $result;
51
 
52
    }//end run()
53
 
54
 
55
}//end class
56
 
57
?>