-
Notifications
You must be signed in to change notification settings - Fork 127
/
test_framework
executable file
·78 lines (70 loc) · 1.84 KB
/
test_framework
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env php
<?php
/**
* Horde Test Runner
*
* @category Horde
* @package tools
* @subpackage UnitTests
* @author Chuck Hagenbuch <chuck@horde.org>
* @license http://www.horde.org/licenses/bsd BSD
*/
/* Stand-in functions if gettext is not available. */
if (!function_exists('_')) {
function _($string)
{
return $string;
}
}
if (!function_exists('dgettext')) {
function dgettext($domain, $string)
{
return $string;
}
}
if (!function_exists('ngettext')) {
function ngettext($msgid1, $msgid2, $n)
{
return $n > 1 ? $msgid2 : $msgid1;
}
}
if (!function_exists('bindtextdomain')) {
function bindtextdomain()
{}
}
if (!function_exists('textdomain')) {
function textdomain()
{}
}
require_once 'Horde/Test/AllTests.php';
$_SERVER['argv'][] = 'Horde_Test_Runner';
$_SERVER['argv'][] = __FILE__;
PHPUnit_TextUI_Command::main();
/**
* @category Horde
* @package tools
* @subpackage UnitTests
* @author Chuck Hagenbuch <chuck@horde.org>
* @license http://www.horde.org/licenses/lgpl21
*/
class Horde_Test_Runner
{
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('Horde Test Runner');
$basedir = dirname(__DIR__);
// Find all AllTests.php files.
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
if (!$file->isFile() ||
$file->getFilename() != 'AllTests.php' ||
$file->getPathname() == __FILE__ ||
$file->getPathname() == $basedir . '/Test/lib/Horde/Test/AllTests.php') {
continue;
}
$pathname = $file->getPathname();
// Include the test suite.
$suite->addTestSuite(Horde_Test_AllTests::init($pathname)->suite());
}
return $suite;
}
}