Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
set_include_path('{include_path}');
3
require_once 'PHPUnit/Framework.php';
4
ob_start();
5
 
6
function __phpunit_run_isolated_test()
7
{
8
    if (!class_exists('{className}')) {
9
        require_once '{filename}';
10
    }
11
 
12
    $result = new PHPUnit_Framework_TestResult;
13
    $result->collectRawCodeCoverageInformation({collectCodeCoverageInformation});
14
 
15
    $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}');
16
    $test->setDependencyInput(unserialize('{dependencyInput}'));
17
    $test->setInIsolation(TRUE);
18
 
19
    ob_end_clean();
20
    ob_start();
21
    $test->run($result);
22
    $output = ob_get_contents();
23
    ob_end_clean();
24
 
25
    print serialize(
26
      array(
27
        'testResult'    => $test->getResult(),
28
        'numAssertions' => $test->getNumAssertions(),
29
        'result'        => $result,
30
        'output'        => $output
31
      )
32
    );
33
 
34
    ob_start();
35
}
36
 
37
if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
38
    require_once $GLOBALS['__PHPUNIT_BOOTSTRAP'];
39
    unset($GLOBALS['__PHPUNIT_BOOTSTRAP']);
40
}
41
 
42
{constants}
43
{globals}
44
{included_files}
45
 
46
__phpunit_run_isolated_test();
47
ob_end_clean();
48
?>