]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/PHPUnit/PHPUnit/Framework/Process/TestCaseMethod.tpl.dist
Release 6.2.0
[Github/sugarcrm.git] / tests / PHPUnit / PHPUnit / Framework / Process / TestCaseMethod.tpl.dist
1 <?php
2 set_include_path('{include_path}');
3 require_once 'PHPUnit/Autoload.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     $result->strictMode({strict});
15
16     $test = new {className}('{methodName}', unserialize('{data}'), '{dataName}');
17     $test->setDependencyInput(unserialize('{dependencyInput}'));
18     $test->setInIsolation(TRUE);
19
20     ob_end_clean();
21     ob_start();
22     $test->run($result);
23     $output = ob_get_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 {constants}
38 {included_files}
39 {globals}
40
41 if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
42     require_once $GLOBALS['__PHPUNIT_BOOTSTRAP'];
43     unset($GLOBALS['__PHPUNIT_BOOTSTRAP']);
44 }
45
46 __phpunit_run_isolated_test();
47 ob_end_clean();
48 ?>