-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpunit.php
More file actions
46 lines (33 loc) · 905 Bytes
/
phpunit.php
File metadata and controls
46 lines (33 loc) · 905 Bytes
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
<?php
if (isset($_GET['project'])) {
$projectName = $_GET['project'];
include 'config.php';
if ($projectList[$projectName]) {
$projectConfig = $projectList[$projectName];
if ($projectConfig['unitConfXml'])
$unitConfXml = (string) $projectConfig['unitConfXml'];
if (isset($unitConfXml)) {
set_time_limit(3720);
ini_set('memory_limit', '512M');
require_once 'libs/PHPUnit/Autoload.php';
$suite = new PHPUnit_TextUI_Command();
$param = Array(
'',
'-c',
$unitConfXml
);
$html_errors = ini_get('html_errors');
ob_start();
ini_set('html_errors', 0);
$suite->run($param);
$results = ob_get_contents();
ini_set('html_errors', $html_errors);
ob_end_clean();
print $results;
} else {
sprintf('No define phpunit config file for project %s', $projectName);
}
} else {
sprintf('Project %s not found', $projectName);
}
}