/
AllTests.php
55 lines (43 loc) · 1.45 KB
/
AllTests.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
if (!defined('PHPUnit2_MAIN_METHOD')) {
define('PHPUnit2_MAIN_METHOD', 'AllTests::main');
}
require_once 'PHPUnit2/Framework/TestSuite.php';
require_once 'PHPUnit2/TextUI/TestRunner.php';
/**
* Read in user-defined test configuration if available; otherwise, read default test configuration
*/
if (is_readable('TestConfiguration.php')) {
require_once 'TestConfiguration.php';
} else {
require_once 'TestConfiguration.php.dist';
}
/**
* Prepend library/ to the include_path. This allows the tests to run out of the box and
* helps prevent finding other copies of the framework that might be present.
*/
set_include_path(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'library'
. PATH_SEPARATOR . '.' . PATH_SEPARATOR . get_include_path());
require_once 'ZendTest.php';
require_once 'Zend/AllTests.php';
class AllTests
{
public static function main()
{
$parameters = array();
if (TESTS_GENERATE_REPORT && extension_loaded('xdebug')) {
$parameters = array('reportDirectory' => TESTS_GENERATE_REPORT_TARGET);
}
PHPUnit2_TextUI_TestRunner::run(self::suite(), $parameters);
}
public static function suite()
{
$suite = new PHPUnit2_Framework_TestSuite('Zend Framework');
$suite->addTestSuite('ZendTest');
$suite->addTest(Zend_AllTests::suite());
return $suite;
}
}
if (PHPUnit2_MAIN_METHOD == 'AllTests::main') {
AllTests::main();
}