Index: trunk/phase3/maintenance/tests/phpunit/phpunit.php |
— | — | @@ -23,6 +23,12 @@ |
24 | 24 | // To prevent tests from failing with SQLite, we need to turn database caching off |
25 | 25 | $wgCaches[CACHE_DB] = false; |
26 | 26 | |
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 | +} |
28 | 35 | PHPUnit_TextUI_Command::main(); |
29 | | - |