Index: trunk/phase3/tests/phpunit/includes/api/ApiTest.php |
— | — | @@ -1,7 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -require_once( dirname( __FILE__ ) . '/ApiSetup.php' ); |
5 | | - |
6 | 4 | class MockApi extends ApiBase { |
7 | 5 | public function execute() { } |
8 | 6 | public function getVersion() { } |
Index: trunk/phase3/tests/phpunit/includes/api/ApiUploadTest.php |
— | — | @@ -17,9 +17,6 @@ |
18 | 18 | // TODO: refactor into several files |
19 | 19 | // TODO: port the other Upload tests, and other API tests to this framework |
20 | 20 | |
21 | | -require_once( dirname( __FILE__ ) . '/RandomImageGenerator.php' ); |
22 | | -require_once( dirname( __FILE__ ) . '/../../../../includes/User.php' ); |
23 | | - |
24 | 21 | /* Wraps the user object, so we can also retain full access to properties like password if we log in via the API */ |
25 | 22 | class ApiTestUser { |
26 | 23 | public $username; |
— | — | @@ -130,7 +127,7 @@ |
131 | 128 | // add edit token to fake session |
132 | 129 | $session['wsEditToken'] = $session['wsToken']; |
133 | 130 | // add token to request parameters |
134 | | - $params['token'] = md5( $session['wsToken'] ) . EDIT_TOKEN_SUFFIX; |
| 131 | + $params['token'] = md5( $session['wsToken'] ) . User::EDIT_TOKEN_SUFFIX; |
135 | 132 | return $this->doApiRequest( $params, $session ); |
136 | 133 | } else { |
137 | 134 | throw new Exception( "request data not in right format" ); |
Index: trunk/phase3/tests/phpunit/phpunit.php |
— | — | @@ -35,7 +35,6 @@ |
36 | 36 | require_once( 'PHPUnit/TextUI/Command.php' ); |
37 | 37 | } |
38 | 38 | |
39 | | -require_once( "$IP/tests/phpunit/MediaWikiPHPUnitCommand.php" ); |
40 | | -require_once( "$IP/tests/phpunit/MediaWikiTestCase.php" ); |
| 39 | +require_once( "$IP/tests/TestsAutoLoader.php" ); |
41 | 40 | MediaWikiPHPUnitCommand::main(); |
42 | 41 | |
Index: trunk/phase3/tests/TestsAutoLoader.php |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +global $wgAutoloadClasses; |
| 5 | +$testFolder = dirname( __FILE__ ); |
| 6 | + |
| 7 | +$wgAutoloadClasses += array( |
| 8 | + 'MediaWikiTestCase' => "$testFolder/phpunit/MediaWikiTestCase.php", |
| 9 | + 'MediaWikiPHPUnitCommand' => "$testFolder/phpunit/MediaWikiPHPUnitCommand.php", |
| 10 | + 'ApiTestSetup' => "$testFolder/phpunit/includes/api/ApiSetup.php", |
| 11 | + 'RandomImageGenerator' => "$testFolder/phpunit/includes/api/RandomImageGenerator.php", |
| 12 | + 'SeleniumTestConstants' => "$testFolder/selenium/SeleniumTestConstants.php", |
| 13 | +); |
| 14 | + |
Property changes on: trunk/phase3/tests/TestsAutoLoader.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 15 | + native |