r79543 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79542‎ | r79543 | r79544 >
Date:01:33, 4 January 2011
Author:soxred93
Status:ok (Comments)
Tags:
Comment:
Update to use the PHPUnit autoloader, define $IP
Modified paths:
  • /trunk/phase3/tests/RunSeleniumTests.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/RunSeleniumTests.php
@@ -24,13 +24,25 @@
2525 * http://www.gnu.org/copyleft/gpl.html
2626 */
2727
 28+$IP = dirname( dirname( __FILE__ ) );
 29+
2830 define( 'SELENIUMTEST', true );
2931
3032 //require_once( dirname( __FILE__ ) . '/../maintenance/commandLine.inc' );
3133 require( dirname( __FILE__ ) . '/../maintenance/Maintenance.php' );
32 -require_once( 'PHPUnit/Framework.php' );
 34+
 35+require_once( 'PHPUnit/Runner/Version.php' );
 36+if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
 37+ # PHPUnit 3.5.0 introduced a nice autoloader based on class name
 38+ require_once( 'PHPUnit/Autoload.php' );
 39+} else {
 40+ # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
 41+ require_once( 'PHPUnit/TextUI/Command.php' );
 42+}
 43+
3344 require_once( 'PHPUnit/Extensions/SeleniumTestCase.php' );
3445 include_once( 'PHPUnit/Util/Log/JUnit.php' );
 46+
3547 require_once( dirname( __FILE__ ) . "/selenium/SeleniumServerManager.php" );
3648
3749 class SeleniumTester extends Maintenance {

Comments

#Comment by Hashar (talk | contribs)   17:14, 7 March 2011

To avoid code duplication with r74831, those parts should be factored out in a common file!

Status & tagging log