r74556 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74555‎ | r74556 | r74557 >
Date:19:00, 9 October 2010
Author:maxsem
Status:resolved (Comments)
Tags:
Comment:
Follow-up r74553, r74554 and r74555: don't guess, just include stuff properly
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/phpunit.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/phpunit.php
@@ -28,21 +28,7 @@
2929
3030 $folders = explode( $pathSeparator, getenv('PATH') );
3131
32 -# We may not have PHPUnit folder in the path, but have
33 -# PEAR folder in the include path.
34 -$includeFolders = explode( $pathSeparator, get_include_path() );
35 -foreach ( $includeFolders as $includeFolder ) {
36 - $folders[] = "$includeFolder/PHPUnit";
37 -}
 32+require 'PHPUnit/TextUI/Command.php';
 33+define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main');
 34+PHPUnit_TextUI_Command::main();
3835
39 -foreach ( $folders as $folder ) {
40 - if ( file_exists( "$folder/$targetFile" ) ) {
41 - require_once "$folder/$targetFile";
42 - exit(0);
43 - }
44 -}
45 -
46 -echo "I couldn't find PHPUnit\nTry adding its folder to your PATH\n";
47 -
48 -die( 1 );
49 -

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74553Readd after r72566 a phpunit.php so that globals are kept global.platonides18:15, 9 October 2010
r74554Look for PHPUnit folder in the PATH and add support for Windows....platonides18:32, 9 October 2010
r74555Follow r74554. Also take include path into account.platonides18:40, 9 October 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   17:52, 12 October 2010

The define() should be only be done conditionally, otherwise failures are caused (see http://ci.tesla.usability.wikimedia.org/cruisecontrol/buildresults/mw?log=log20101009195915)

#Comment by MaxSem (talk | contribs)   18:37, 12 October 2010

Fixed in r74681.

#Comment by Hashar (talk | contribs)   10:45, 16 October 2010

There was a fatal error with PHPUnit 3.5.0 (see comments in r74553).

I fixed it in r74831 by using PHPUnit 3.5.0 autoloader.

Status & tagging log