Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/**
3
 * Console Getopt+ (Getopt Plus) tests
4
 *
5
 * PHP version 5
6
 *
7
 * All rights reserved.
8
 * Redistribution and use in source and binary forms, with or without modification,
9
 * are permitted provided that the following conditions are met:
10
 * + Redistributions of source code must retain the above copyright notice,
11
 * this list of conditions and the following disclaimer.
12
 * + Redistributions in binary form must reproduce the above copyright notice,
13
 * this list of conditions and the following disclaimer in the documentation and/or
14
 * other materials provided with the distribution.
15
 * + The name of its contributors may not be used to endorse or promote products
16
 * derived from this software without specific prior written permission.
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 *
29
 * @category  PHP
30
 * @package   Console_GetoptPlus
31
 * @author    Michel Corne <mcorne@yahoo.com>
32
 * @copyright 2008 Michel Corne
33
 * @license   http://www.opensource.org/licenses/bsd-license.php The BSD License
34
 * @version   SVN: $Id: AllTests.php 47 2008-01-10 11:03:38Z mcorne $
35
 * @link      http://pear.php.net/package/Console_GetoptPlus
36
 */
37
if (!defined('PHPUnit_MAIN_METHOD')) {
38
    define('PHPUnit_MAIN_METHOD', 'Console_GetoptPlus_AllTests::main');
39
}
40
 
41
require_once 'PHPUnit/Framework.php';
42
require_once 'PHPUnit/TextUI/TestRunner.php';
43
// adds the path of the package if this is a raw install
44
file_exists("../../Console/") and set_include_path('../..' . PATH_SEPARATOR . get_include_path());
45
require_once 'GetoptPlusTest.php';
46
require_once 'GetoptPlus/ExceptionTest.php';
47
require_once 'GetoptPlus/GetoptTest.php';
48
require_once 'GetoptPlus/HelpTest.php';
49
 
50
/**
51
 * Console Getopt+ (Getopt Plus) tests
52
 *
53
 * Run the tests from the tests directory.
54
 * #phpunit  Console_GetoptPlus_AllTests AllTests.php
55
 *
56
 * To run the code coverage test, 2 steps:
57
 * #phpunit --report reports/coverage  Console_GetoptPlus_AllTests AllTests.php
58
 * browse the results in index.html file in reports/coverage
59
 *
60
 * The code coverage is close to 100%.
61
 *
62
 * @category  PHP
63
 * @package   Console_GetoptPlus
64
 * @author    Michel Corne <mcorne@yahoo.com>
65
 * @copyright 2008 Michel Corne
66
 * @license   http://www.opensource.org/licenses/bsd-license.php The BSD License
67
 * @version   Release:@package_version@
68
 * @link      http://pear.php.net/package/Console_GetoptPlus
69
 */
70
class Console_GetoptPlus_AllTests
71
{
72
    /**
73
     * Runs the test suite
74
     *
75
     * @return void
76
     * @access public
77
     * @static
78
     */
79
    public static function main()
80
    {
81
        PHPUnit_TextUI_TestRunner::run(self::suite());
82
    }
83
 
84
    /**
85
     * Runs the test suite
86
     *
87
     * @return object the PHPUnit_Framework_TestSuite object
88
     * @access public
89
     * @static
90
     */
91
    public static function suite()
92
    {
93
        $suite = new PHPUnit_Framework_TestSuite('Console_GetoptPlus Tests');
94
        $suite->addTestSuite('tests_GetoptPlus_ExceptionTest');
95
        $suite->addTestSuite('tests_GetoptPlus_GetoptTest');
96
        $suite->addTestSuite('tests_GetoptPlus_HelpTest');
97
        $suite->addTestSuite('tests_GetoptPlusTest');
98
        return $suite;
99
    }
100
}
101
 
102
if (PHPUnit_MAIN_METHOD == 'Console_GetoptPlus_AllTests::main') {
103
    Console_GetoptPlus_AllTests::main();
104
}
105
 
106
?>