r74831 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74830‎ | r74831 | r74832 >
Date:10:39, 16 October 2010
Author:hashar
Status:ok
Tags:
Comment:
If using PHPUnit version 3.5.0 or later, make use of its Autoloader
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/phpunit.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/phpunit.php
@@ -23,6 +23,12 @@
2424 // To prevent tests from failing with SQLite, we need to turn database caching off
2525 $wgCaches[CACHE_DB] = false;
2626
27 -require_once( 'PHPUnit/TextUI/Command.php' );
 27+require_once( 'PHPUnit/Runner/Version.php' );
 28+if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
 29+ # PHPUnit 3.5.0 introduced a nice autoloader based on class name
 30+ require_once( 'PHPUnit/Autoload.php' );
 31+} else {
 32+ # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
 33+ require_once( 'PHPUnit/TextUI/Command.php' );
 34+}
2835 PHPUnit_TextUI_Command::main();
29 -

Follow-up revisions

RevisionCommit summaryAuthorDate
r76623With PHPUnit 3.5.0, use its autoloader (like r74831)....hashar12:45, 13 November 2010

Status & tagging log