| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Master Unit Test Suite file for PhpDocumentor
|
|
|
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 Tools and Utilities
|
|
|
14 |
* @package phpDocumentor
|
|
|
15 |
* @subpackage UnitTesting
|
|
|
16 |
* @author Chuck Burgess <ashnazg@php.net>
|
|
|
17 |
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
18 |
* @version CVS: $Id: AllTests.php 243201 2007-09-30 01:41:46Z ashnazg $
|
|
|
19 |
* @link http://pear.php.net/PhpDocumentor
|
|
|
20 |
* @since 1.4.0a2
|
|
|
21 |
* @todo CS cleanup - change package to PhpDocumentor
|
|
|
22 |
*/
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
/**
|
|
|
26 |
* Check PHP version... PhpUnit v3+ requires at least PHP v5.1.4
|
|
|
27 |
*/
|
|
|
28 |
if (version_compare(PHP_VERSION, "5.1.4") < 0) {
|
|
|
29 |
// Cannnot run test suites
|
|
|
30 |
echo "Cannot run test suites... requires at least PHP v5.1.4.\n";
|
|
|
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', 'PhpDocumentor_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 |
|
|
|
51 |
|
|
|
52 |
/*
|
|
|
53 |
* You must add each additional class-level test suite file here
|
|
|
54 |
*/
|
|
|
55 |
require_once 'phpDocumentorSetupTests.php';
|
|
|
56 |
require_once 'phpDocumentorTParserTests.php';
|
|
|
57 |
require_once 'IntermediateParserTests.php';
|
|
|
58 |
require_once 'HighlightParserTests.php';
|
|
|
59 |
require_once 'ParserClassTests.php';
|
|
|
60 |
require_once 'ParserPageTests.php';
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
/**
|
|
|
64 |
* Master Unit Test Suite class for PhpDocumentor
|
|
|
65 |
*
|
|
|
66 |
* This top-level test suite class organizes
|
|
|
67 |
* all class test suite files,
|
|
|
68 |
* so that the full suite can be run
|
|
|
69 |
* by PhpUnit or via "pear run-tests -u".
|
|
|
70 |
*
|
|
|
71 |
* @category Tools and Utilities
|
|
|
72 |
* @package phpDocumentor
|
|
|
73 |
* @subpackage UnitTesting
|
|
|
74 |
* @author Chuck Burgess <ashnazg@php.net>
|
|
|
75 |
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
76 |
* @version Release: @package_version@
|
|
|
77 |
* @link http://pear.php.net/PhpDocumentor
|
|
|
78 |
* @since 1.4.0a2
|
|
|
79 |
* @todo CS cleanup - change package to PhpDocumentor
|
|
|
80 |
*/
|
|
|
81 |
class PhpDocumentor_AllTests
|
|
|
82 |
{
|
|
|
83 |
|
|
|
84 |
/**
|
|
|
85 |
* Launches the TextUI test runner
|
|
|
86 |
*
|
|
|
87 |
* @return void
|
|
|
88 |
* @uses PHPUnit_TextUI_TestRunner
|
|
|
89 |
*/
|
|
|
90 |
public static function main()
|
|
|
91 |
{
|
|
|
92 |
PHPUnit_TextUI_TestRunner::run(self::suite());
|
|
|
93 |
}
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
/**
|
|
|
97 |
* Adds all class test suites into the master suite
|
|
|
98 |
*
|
|
|
99 |
* @return PHPUnit_Framework_TestSuite a master test suite
|
|
|
100 |
* containing all class test suites
|
|
|
101 |
* @uses PHPUnit_Framework_TestSuite
|
|
|
102 |
*/
|
|
|
103 |
public static function suite()
|
|
|
104 |
{
|
|
|
105 |
$suite = new PHPUnit_Framework_TestSuite(
|
|
|
106 |
'PhpDocumentor Full Suite of Unit Tests');
|
|
|
107 |
|
|
|
108 |
/*
|
|
|
109 |
* You must add each additional class-level test suite name here
|
|
|
110 |
*/
|
|
|
111 |
$suite->addTest(tests_phpDocumentorSetupTests::suite());
|
|
|
112 |
$suite->addTest(tests_phpDocumentorTParserTests::suite());
|
|
|
113 |
$suite->addTest(tests_IntermediateParserTests::suite());
|
|
|
114 |
$suite->addTest(tests_HighlightParserTests::suite());
|
|
|
115 |
$suite->addTest(tests_ParserClassTests::suite());
|
|
|
116 |
$suite->addTest(tests_ParserPageTests::suite());
|
|
|
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 == 'PhpDocumentor_AllTests::main') {
|
|
|
127 |
PhpDocumentor_AllTests::main();
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
|
|
131 |
?>
|