MediaWiki  REL1_22
GenerateJqueryMsgData Class Reference

This PHP script defines the spec that the mediawiki.jqueryMsg module should conform to. More...

Inheritance diagram for GenerateJqueryMsgData:
Collaboration diagram for GenerateJqueryMsgData:

List of all members.

Public Member Functions

 __construct ()
 execute ()

Static Public Attributes

static $keyToTestArgs

Private Member Functions

 getMessagesAndTests ()
 writeJavascriptFile ($messages, $tests, $dataSpecFile)

Detailed Description

This PHP script defines the spec that the mediawiki.jqueryMsg module should conform to.

It does this by looking up the results of various kinds of string parsing, with various languages, in the current installation of MediaWiki. It then outputs a static specification, mapping expected inputs to outputs, which can be used fed into a unit test framework. (QUnit, Jasmine, anything, it just outputs an object with key/value pairs).

This is similar to Michael Dale ([email protected])'s parser tests, except that it doesn't look up the API results while doing the test, so the test run is much faster (at the cost of being out of date in rare circumstances. But mostly the parsing that we are doing in Javascript doesn't change much).

Definition at line 66 of file generateJqueryMsgData.php.


Constructor & Destructor Documentation

Reimplemented from Maintenance.

Definition at line 85 of file generateJqueryMsgData.php.


Member Function Documentation

Definition at line 96 of file generateJqueryMsgData.php.

References $key, $messages, $result, array(), as, and wfMessage().

Referenced by execute().

GenerateJqueryMsgData::writeJavascriptFile ( messages,
tests,
dataSpecFile 
) [private]

Definition at line 125 of file generateJqueryMsgData.php.

References $messages, $output, array(), and FormatJson\encode().

Referenced by execute().


Member Data Documentation

GenerateJqueryMsgData::$keyToTestArgs [static]
Initial value:
 array(
        'undelete_short' => array(
            array( 0 ),
            array( 1 ),
            array( 2 ),
            array( 5 ),
            array( 21 ),
            array( 101 )
        ),
        'category-subcat-count' => array(
            array( 0, 10 ),
            array( 1, 1 ),
            array( 1, 2 ),
            array( 3, 30 )
        )
    )

Definition at line 68 of file generateJqueryMsgData.php.


The documentation for this class was generated from the following file: