Skip to content

Commit d2fac98

Browse files
committed
Slight improvement to b9ea952.
1 parent b9ea952 commit d2fac98

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

PHPUnit/Framework/Process/TestCaseMethod.tpl.dist

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<?php
22
ini_set('display_errors', 'stderr');
33
set_include_path('{include_path}');
4-
require {autoload};
4+
5+
if ({composerAutoload}) {
6+
require_once {composerAutoload};
7+
define('PHPUNIT_COMPOSER_INSTALL', {composerAutoload});
8+
} else {
9+
require 'PHPUnit/Autoload.php';
10+
}
11+
512
ob_start();
613

714
function __phpunit_run_isolated_test()

PHPUnit/Framework/TestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ public function run(PHPUnit_Framework_TestResult $result = NULL)
736736
}
737737

738738
if (defined('PHPUNIT_COMPOSER_INSTALL')) {
739-
$autoload = var_export(PHPUNIT_COMPOSER_INSTALL, TRUE);
739+
$composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, TRUE);
740740
} else {
741-
$autoload = '\'PHPUnit/Autoload.php\'';
741+
$composerAutoload = '\'\'';
742742
}
743743

744744
$data = var_export(serialize($this->data), TRUE);
@@ -752,7 +752,7 @@ public function run(PHPUnit_Framework_TestResult $result = NULL)
752752

753753
$template->setVar(
754754
array(
755-
'autoload' => $autoload,
755+
'composerAutoload' => $composerAutoload,
756756
'filename' => $class->getFileName(),
757757
'className' => $class->getName(),
758758
'methodName' => $this->name,

0 commit comments

Comments
 (0)