2
if (!defined('STDOUT')) {
3
// php://stdout does not obey output buffering. Any output would break
4
// unserialization of child process results in the parent process.
5
define('STDOUT', fopen('php://temp', 'w+b'));
6
define('STDERR', fopen('php://stderr', 'wb'));
10
ini_set('display_errors', 'stderr');
11
set_include_path('{include_path}');
13
$composerAutoload = {composerAutoload};
18
if ($composerAutoload) {
19
require_once $composerAutoload;
20
define('PHPUNIT_COMPOSER_INSTALL', $composerAutoload);
25
function __phpunit_run_isolated_test()
27
if (!class_exists('{className}')) {
28
require_once '{filename}';
31
$result = new PHPUnit_Framework_TestResult;
33
if ({collectCodeCoverageInformation}) {
34
$result->setCodeCoverage(new PHP_CodeCoverage);
37
$result->beStrictAboutTestsThatDoNotTestAnything({isStrictAboutTestsThatDoNotTestAnything});
38
$result->beStrictAboutOutputDuringTests({isStrictAboutOutputDuringTests});
39
$result->beStrictAboutTestSize({isStrictAboutTestSize});
40
$result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests});
42
$test = new {className}('{methodName}', unserialize('{data}'), '{dataName}');
43
$test->setDependencyInput(unserialize('{dependencyInput}'));
44
$test->setInIsolation(TRUE);
49
if (!$test->hasExpectationOnOutput()) {
50
$output = $test->getActualOutput();
54
if ($stdout = stream_get_contents(STDOUT)) {
55
$output = $stdout . $output;
60
'testResult' => $test->getResult(),
61
'numAssertions' => $test->getNumAssertions(),
72
if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) {
73
require_once $GLOBALS['__PHPUNIT_BOOTSTRAP'];
74
unset($GLOBALS['__PHPUNIT_BOOTSTRAP']);
77
__phpunit_run_isolated_test();