X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=blobdiff_plain;f=tests%2Fqunit%2Fdata%2FgenerateJqueryMsgData.php;h=12e5a2dca001f3f56ba4acf3928f9cbd9ddaeab5;hb=beb1c4a0eced04ce2098433c383f1fbe469569c9;hp=911dc3ac0c8cff6dfd33934dc33ee5e8c162a91e;hpb=a62274a1579e0e320becc416df1adc9885e53c25;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/qunit/data/generateJqueryMsgData.php b/tests/qunit/data/generateJqueryMsgData.php index 911dc3ac0c..12e5a2dca0 100644 --- a/tests/qunit/data/generateJqueryMsgData.php +++ b/tests/qunit/data/generateJqueryMsgData.php @@ -61,9 +61,7 @@ * */ -$maintenanceDir = dirname( dirname( dirname( __DIR__ ) ) ) . '/maintenance'; - -require( "$maintenanceDir/Maintenance.php" ); +require __DIR__ . '/../../../maintenance/Maintenance.php'; class GenerateJqueryMsgData extends Maintenance { @@ -85,9 +83,9 @@ class GenerateJqueryMsgData extends Maintenance { ); public function __construct() { - parent::__construct(); - $this->mDescription = 'Create a specification for message parsing ini JSON format'; - // add any other options here + parent::__construct(); + $this->mDescription = 'Create a specification for message parsing ini JSON format'; + // add any other options here } public function execute() { @@ -100,7 +98,7 @@ class GenerateJqueryMsgData extends Maintenance { $tests = array(); foreach ( array( 'en', 'fr', 'ar', 'jp', 'zh' ) as $languageCode ) { foreach ( self::$keyToTestArgs as $key => $testArgs ) { - foreach ($testArgs as $args) { + foreach ( $testArgs as $args ) { // Get the raw message, without any transformations. $template = wfMessage( $key )->inLanguage( $languageCode )->plain(); @@ -132,14 +130,14 @@ class GenerateJqueryMsgData extends Maintenance { $output = "// This file stores the output from the PHP parser for various messages, arguments,\n" - . "// languages, and parser modes. Intended for use by a unit test framework by looping\n" - . "// through the object and comparing its parser return value with the 'result' property.\n" - . '// Last generated with ' . basename( __FILE__ ) . ' at ' . gmdate( 'r' ) . "\n" - // This file will contain unquoted JSON strings as javascript native object literals, - // flip the quotemark convention for this file. - . "/*jshint quotmark: double */\n" - . "\n" - . 'mediaWiki.libs.phpParserData = ' . FormatJson::encode( $phpParserData, true ) . ";\n"; + . "// languages, and parser modes. Intended for use by a unit test framework by looping\n" + . "// through the object and comparing its parser return value with the 'result' property.\n" + . '// Last generated with ' . basename( __FILE__ ) . ' at ' . gmdate( 'r' ) . "\n" + // This file will contain unquoted JSON strings as javascript native object literals, + // flip the quotemark convention for this file. + . "/*jshint quotmark: double */\n" + . "\n" + . 'mediaWiki.libs.phpParserData = ' . FormatJson::encode( $phpParserData, true ) . ";\n"; $fp = file_put_contents( $dataSpecFile, $output ); if ( $fp === false ) { @@ -149,4 +147,4 @@ class GenerateJqueryMsgData extends Maintenance { } $maintClass = "GenerateJqueryMsgData"; -require_once( "$maintenanceDir/doMaintenance.php" ); +require_once RUN_MAINTENANCE_IF_MAIN;