--- /dev/null
+<?php
+
+global $wgAutoloadClasses;
+$testFolder = dirname( __FILE__ );
+
+$wgAutoloadClasses += array(
+ 'MediaWikiTestCase' => "$testFolder/phpunit/MediaWikiTestCase.php",
+ 'MediaWikiPHPUnitCommand' => "$testFolder/phpunit/MediaWikiPHPUnitCommand.php",
+ 'ApiTestSetup' => "$testFolder/phpunit/includes/api/ApiSetup.php",
+ 'RandomImageGenerator' => "$testFolder/phpunit/includes/api/RandomImageGenerator.php",
+ 'SeleniumTestConstants' => "$testFolder/selenium/SeleniumTestConstants.php",
+);
+
<?php
-require_once( dirname( __FILE__ ) . '/ApiSetup.php' );
-
class MockApi extends ApiBase {
public function execute() { }
public function getVersion() { }
// TODO: refactor into several files
// TODO: port the other Upload tests, and other API tests to this framework
-require_once( dirname( __FILE__ ) . '/RandomImageGenerator.php' );
-require_once( dirname( __FILE__ ) . '/../../../../includes/User.php' );
-
/* Wraps the user object, so we can also retain full access to properties like password if we log in via the API */
class ApiTestUser {
public $username;
// add edit token to fake session
$session['wsEditToken'] = $session['wsToken'];
// add token to request parameters
- $params['token'] = md5( $session['wsToken'] ) . EDIT_TOKEN_SUFFIX;
+ $params['token'] = md5( $session['wsToken'] ) . User::EDIT_TOKEN_SUFFIX;
return $this->doApiRequest( $params, $session );
} else {
throw new Exception( "request data not in right format" );
require_once( 'PHPUnit/TextUI/Command.php' );
}
-require_once( "$IP/tests/phpunit/MediaWikiPHPUnitCommand.php" );
-require_once( "$IP/tests/phpunit/MediaWikiTestCase.php" );
+require_once( "$IP/tests/TestsAutoLoader.php" );
MediaWikiPHPUnitCommand::main();