r76623 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76622‎ | r76623 | r76624 >
Date:12:45, 13 November 2010
Author:hashar
Status:ok (Comments)
Tags:
Comment:
With PHPUnit 3.5.0, use its autoloader (like r74831).
Fix 'make test' for me.
Modified paths:
  • /trunk/phase3/includes/normal/CleanUpTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/normal/CleanUpTest.php
@@ -36,7 +36,14 @@
3737
3838 #ini_set( 'memory_limit', '40M' );
3939
40 -require_once 'PHPUnit/Framework.php';
 40+require_once( 'PHPUnit/Runner/Version.php' );
 41+if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
 42+ # PHPUnit 3.5.0 introduced a nice autoloader based on class name
 43+ require_once( 'PHPUnit/Autoload.php' );
 44+} else {
 45+ # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
 46+ require_once 'PHPUnit/Framework.php';
 47+}
4148 require_once 'PHPUnit/TextUI/TestRunner.php';
4249
4350 require_once 'UtfNormal.php';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74831If using PHPUnit version 3.5.0 or later, make use of its Autoloaderhashar10:39, 16 October 2010

Comments

#Comment by Hashar (talk | contribs)   12:47, 13 November 2010

Might need a review by someone with an older PHPUnit version. I use 3.5.0.

#Comment by MaxSem (talk | contribs)   14:03, 13 November 2010

Works for me on 3.4.8.

#Comment by 😂 (talk | contribs)   14:08, 13 November 2010

Generally speaking, these should probably be moved to maintenance/tests/phpunit like all the others.

Status & tagging log