Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
/**
4
 * Master Unit Test Suite file for HTML_TreeMenu
5
 *
6
 * This top-level test suite file organizes
7
 * all class test suite files,
8
 * so that the full suite can be run
9
 * by PhpUnit or via "pear run-tests -u".
10
 *
11
 * PHP versions 4 and 5
12
 *
13
 * @category   HTML
14
 * @package    HTML_TreeMenu
15
 * @subpackage UnitTesting
16
 * @author     Chuck Burgess <ashnazg@php.net>
17
 * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
18
 * @version    CVS: $Id: AllTests.php 259156 2008-05-06 14:05:09Z ashnazg $
19
 * @link       http://pear.php.net/package/HTML_TreeMenu
20
 * @since      1.2.2
21
 */
22
 
23
 
24
/**
25
 * Check PHP version... PhpUnit v3+ requires at least PHP v5.1.4
26
 */
27
if (version_compare(PHP_VERSION, "5.1.4") < 0) {
28
    // Cannnot run test suites
29
    echo 'Cannot run test suite via PhpUnit... requires at least PHP v5.1.4.' . PHP_EOL;
30
    echo 'Use "pear run-tests -p html_treemenu" to run the PHPT tests directly.' . PHP_EOL;
31
    exit(1);
32
}
33
 
34
 
35
/**
36
 * Derive the "main" method name
37
 * @internal PhpUnit would have to rename PHPUnit_MAIN_METHOD to PHPUNIT_MAIN_METHOD
38
 *           to make this usage meet the PEAR CS... we cannot rename it here.
39
 */
40
if (!defined('PHPUnit_MAIN_METHOD')) {
41
    define('PHPUnit_MAIN_METHOD', 'HTML_TreeMenu_AllTests::main');
42
}
43
 
44
 
45
/*
46
 * Files needed by PhpUnit
47
 */
48
require_once 'PHPUnit/Framework.php';
49
require_once 'PHPUnit/TextUI/TestRunner.php';
50
require_once 'PHPUnit/Extensions/PhptTestSuite.php';
51
 
52
/*
53
 * You must add each additional class-level test suite file here
54
 */
55
// there are no PhpUnit test files... only PHPTs.. so nothing is listed here
56
 
57
/**
58
 * directory where PHPT tests are located
59
 */
60
define('HTML_TREEMENU_DIR_PHPT', dirname(__FILE__));
61
 
62
/**
63
 * Master Unit Test Suite class for HTML_TreeMenu
64
 *
65
 * This top-level test suite class organizes
66
 * all class test suite files,
67
 * so that the full suite can be run
68
 * by PhpUnit or via "pear run-tests -up html_treemenu".
69
 *
70
 * @category   HTML
71
 * @package    HTML_TreeMenu
72
 * @subpackage UnitTesting
73
 * @author     Chuck Burgess <ashnazg@php.net>
74
 * @license    http://www.opensource.org/licenses/bsd-license.php New BSD License
75
 * @version    Release: @package_version@
76
 * @link       http://pear.php.net/package/XML_Util
77
 * @since      1.2.2
78
 */
79
class HTML_TreeMenu_AllTests
80
{
81
 
82
    /**
83
     * Launches the TextUI test runner
84
     *
85
     * @return void
86
     * @uses PHPUnit_TextUI_TestRunner
87
     */
88
    public static function main()
89
    {
90
        PHPUnit_TextUI_TestRunner::run(self::suite());
91
    }
92
 
93
 
94
    /**
95
     * Adds all class test suites into the master suite
96
     *
97
     * @return PHPUnit_Framework_TestSuite a master test suite
98
     *                                     containing all class test suites
99
     * @uses PHPUnit_Framework_TestSuite
100
     */
101
    public static function suite()
102
    {
103
        $suite = new PHPUnit_Framework_TestSuite(
104
            'HTML_TreeMenu Full Suite of Unit Tests');
105
 
106
        /*
107
         * You must add each additional class-level test suite name here
108
         */
109
        // there are no PhpUnit test files... only PHPTs.. so nothing is listed here
110
 
111
        /*
112
         * add PHPT tests
113
         */
114
        $phpt = new PHPUnit_Extensions_PhptTestSuite(HTML_TREEMENU_DIR_PHPT);
115
        $suite->addTestSuite($phpt);
116
 
117
        return $suite;
118
    }
119
}
120
 
121
/**
122
 * Call the main method if this file is executed directly
123
 * @internal PhpUnit would have to rename PHPUnit_MAIN_METHOD to PHPUNIT_MAIN_METHOD
124
 *           to make this usage meet the PEAR CS... we cannot rename it here.
125
 */
126
if (PHPUnit_MAIN_METHOD == 'HTML_TreeMenu_AllTests::main') {
127
    HTML_TreeMenu_AllTests::main();
128
}
129
 
130
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
131
?>