diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2013-02-26 18:56:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2013-02-26 18:56:35 +0000 |
commit | 019ede87172494f1e2352926095b81d201723eee (patch) | |
tree | bf225d0ad26aad901f6267c2445cdb83e1b52e1b | |
parent | 14bb1bc68c1d76a273dbac0530d1d9b183b61248 (diff) | |
parent | d01be611d0ccc9aa60eede8b64b3ca0724d27796 (diff) | |
download | mediawikicore-019ede87172494f1e2352926095b81d201723eee.tar.gz mediawikicore-019ede87172494f1e2352926095b81d201723eee.zip |
Merge "Script calling cleanups"
-rw-r--r-- | includes/normal/UtfNormalTest2.php | 2 | ||||
-rw-r--r-- | tests/RunSeleniumTests.php | 7 | ||||
-rw-r--r-- | tests/phpunit/includes/api/generateRandomImages.php | 5 | ||||
-rwxr-xr-x | tests/phpunit/phpunit.php | 5 | ||||
-rw-r--r-- | tests/qunit/data/generateJqueryMsgData.php | 6 | ||||
-rw-r--r-- | tests/qunit/data/load.mock.php | 2 | ||||
-rw-r--r-- | tests/selenium/installer/MediaWikiInstallerTestSuite.php | 5 |
7 files changed, 14 insertions, 18 deletions
diff --git a/includes/normal/UtfNormalTest2.php b/includes/normal/UtfNormalTest2.php index f4a83792231e..2266696e708f 100644 --- a/includes/normal/UtfNormalTest2.php +++ b/includes/normal/UtfNormalTest2.php @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php <?php /** * Other tests for the unicode normalization module. diff --git a/tests/RunSeleniumTests.php b/tests/RunSeleniumTests.php index 716a8db24d63..6e212ebaec70 100644 --- a/tests/RunSeleniumTests.php +++ b/tests/RunSeleniumTests.php @@ -1,4 +1,4 @@ -#!/usr/bin/php +#!/usr/bin/env php <?php /** * @file @@ -24,11 +24,12 @@ * http://www.gnu.org/copyleft/gpl.html */ -$IP = dirname( __DIR__ ); +if ( PHP_SAPI != 'cli' ) { + die( "Run me from the command line please.\n" ); +} define( 'SELENIUMTEST', true ); -//require_once( __DIR__ . '/../maintenance/commandLine.inc' ); require( __DIR__ . '/../maintenance/Maintenance.php' ); require_once( 'PHPUnit/Runner/Version.php' ); diff --git a/tests/phpunit/includes/api/generateRandomImages.php b/tests/phpunit/includes/api/generateRandomImages.php index cba8312bf9e5..bdd15c48980e 100644 --- a/tests/phpunit/includes/api/generateRandomImages.php +++ b/tests/phpunit/includes/api/generateRandomImages.php @@ -5,11 +5,8 @@ * @file */ -// Evaluate the include path relative to this file -$IP = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ); - // Start up MediaWiki in command-line mode -require_once( "$IP/maintenance/Maintenance.php" ); +require_once( __DIR__ . "/../../../../maintenance/Maintenance.php" ); require( __DIR__ . "/RandomImageGenerator.php" ); class GenerateRandomImages extends Maintenance { diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 2a0298a4a398..cce5dde5ae73 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -8,14 +8,11 @@ /* Configuration */ -// Evaluate the include path relative to this file -$IP = dirname( dirname( __DIR__ ) ); - // Set a flag which can be used to detect when other scripts have been entered through this entry point or not define( 'MW_PHPUNIT_TEST', true ); // Start up MediaWiki in command-line mode -require_once( "$IP/maintenance/Maintenance.php" ); +require_once( dirname( dirname( __DIR__ ) ) . "/maintenance/Maintenance.php" ); class PHPUnitMaintClass extends Maintenance { diff --git a/tests/qunit/data/generateJqueryMsgData.php b/tests/qunit/data/generateJqueryMsgData.php index 774000b7b661..604ede8114cf 100644 --- a/tests/qunit/data/generateJqueryMsgData.php +++ b/tests/qunit/data/generateJqueryMsgData.php @@ -61,9 +61,7 @@ * </code> */ -$maintenanceDir = dirname( dirname( dirname( __DIR__ ) ) ) . '/maintenance'; - -require( "$maintenanceDir/Maintenance.php" ); +require( __DIR__ . '/../../../maintenance/Maintenance.php' ); class GenerateJqueryMsgData extends Maintenance { @@ -149,4 +147,4 @@ class GenerateJqueryMsgData extends Maintenance { } $maintClass = "GenerateJqueryMsgData"; -require_once( "$maintenanceDir/doMaintenance.php" ); +require_once( RUN_MAINTENANCE_IF_MAIN ); diff --git a/tests/qunit/data/load.mock.php b/tests/qunit/data/load.mock.php index 1c189703eead..7ff392ab4a3b 100644 --- a/tests/qunit/data/load.mock.php +++ b/tests/qunit/data/load.mock.php @@ -24,7 +24,7 @@ */ header( 'Content-Type: text/javascript; charset=utf-8' ); -require_once '../../../includes/Xml.php'; +require_once __DIR__ . '/../../../includes/Xml.php'; $moduleImplementations = array( 'testUsesMissing' => " diff --git a/tests/selenium/installer/MediaWikiInstallerTestSuite.php b/tests/selenium/installer/MediaWikiInstallerTestSuite.php index 1356ce662983..f17911310f2c 100644 --- a/tests/selenium/installer/MediaWikiInstallerTestSuite.php +++ b/tests/selenium/installer/MediaWikiInstallerTestSuite.php @@ -1,5 +1,4 @@ <?php - /** * MediaWikiInstallerTestSuite * @@ -27,6 +26,10 @@ * */ +if ( PHP_SAPI != 'cli' ) { + die( "Run me from the command line please.\n" ); +} + require_once 'PHPUnit/Framework/TestSuite.php'; require_once ( __DIR__ . '/MediaWikiUserInterfaceTestCase.php' ); |