/
AllTests.php
56 lines (45 loc) · 1.52 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
56
<?php
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'AllTests::main');
}
/**
* 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';
}
require_once 'PHPUnit/Framework/TestSuite.php';
require_once 'PHPUnit/TextUI/TestRunner.php';
/**
* Prepend library/ to the include_path (incubator first, then regular
* framework). 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
. dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'library'
. PATH_SEPARATOR . get_include_path());
require_once 'Zend/AllTests.php';
class AllTests
{
public static function main()
{
$parameters = array();
if (TESTS_GENERATE_REPORT && extension_loaded('xdebug')) {
$parameters['reportDirectory'] = TESTS_GENERATE_REPORT_TARGET;
}
PHPUnit_TextUI_TestRunner::run(self::suite(), $parameters);
}
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('Zend Framework - Incubator');
$suite->addTest(Zend_AllTests::suite());
return $suite;
}
}
if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
AllTests::main();
}