MediaWiki  REL1_24
MagicVariableTest Class Reference
Inheritance diagram for MagicVariableTest:
Collaboration diagram for MagicVariableTest:

List of all members.

Public Member Functions

 assertUnPadded ($magic, $value)
 assertion helper expecting a magic output which is unpadded
 assertZeroPadded ($magic, $value)
 assertion helper expecting a magic output which is zero padded
 testCurrentdayIsUnPadded ($day)
 provideDays
 testCurrentdaytwoIsZeroPadded ($day)
 provideDays
 testCurrentmonthIsZeroPadded ($month)
 provideMonths
 testCurrentmonthoneIsUnPadded ($month)
 provideMonths
 testLocaldayIsUnPadded ($day)
 provideDays
 testLocaldaytwoIsZeroPadded ($day)
 provideDays
 testLocalmonthIsZeroPadded ($month)
 provideMonths
 testLocalmonthoneIsUnPadded ($month)
 provideMonths
 testRevisiondayIsUnPadded ($day)
 provideDays
 testRevisiondaytwoIsZeroPadded ($day)
 provideDays
 testRevisionmonthIsZeroPadded ($month)
 provideMonths
 testRevisionmonthoneIsUnPadded ($month)
 provideMonths

Static Public Member Functions

static provideDays ()
static provideMonths ()

Protected Member Functions

 setUp ()
 setup a basic parser object

Private Member Functions

 assertMagic ($expected, $magic)
 Assertion helper to test a magic variable output.
 assertMagicPadding ($magic, $value, $format)
 Main assertion helper for magic variables padding.
 setParserTS ($ts)
 helper to set the parser timestamp and revision timestamp

Static Private Member Functions

static createProviderUpTo ($num)

Private Attributes

 $expectedAsInteger
 An array of magicword returned as type integer by the parser They are usually returned as a string for i18n since we support persan numbers for example, but some magic explicitly return them as integer.
Parser $testParser = null

Detailed Description

Definition at line 15 of file MagicVariableTest.php.


Member Function Documentation

MagicVariableTest::assertMagic ( expected,
magic 
) [private]

Assertion helper to test a magic variable output.

Parameters:
string | int$expected
string$magic

Definition at line 210 of file MagicVariableTest.php.

MagicVariableTest::assertMagicPadding ( magic,
value,
format 
) [private]

Main assertion helper for magic variables padding.

Parameters:
string$magicMagic variable name
mixed$valueMonth or day
string$formatSprintf format for $value

Definition at line 175 of file MagicVariableTest.php.

MagicVariableTest::assertUnPadded ( magic,
value 
)

assertion helper expecting a magic output which is unpadded

Definition at line 165 of file MagicVariableTest.php.

MagicVariableTest::assertZeroPadded ( magic,
value 
)

assertion helper expecting a magic output which is zero padded

Definition at line 160 of file MagicVariableTest.php.

static MagicVariableTest::createProviderUpTo ( num) [static, private]
Parameters:
int$numUpper limit for numbers
Returns:
array Array of numbers from 1 up to $num

Definition at line 61 of file MagicVariableTest.php.

static MagicVariableTest::provideDays ( ) [static]
Returns:
array Array of days numbers (as an integer)

Definition at line 80 of file MagicVariableTest.php.

static MagicVariableTest::provideMonths ( ) [static]
Returns:
array Array of months numbers (as an integer)

Definition at line 73 of file MagicVariableTest.php.

MagicVariableTest::setParserTS ( ts) [private]

helper to set the parser timestamp and revision timestamp

Parameters:
string$ts

Definition at line 200 of file MagicVariableTest.php.

MagicVariableTest::setUp ( ) [protected]

setup a basic parser object

Reimplemented from MediaWikiTestCase.

Definition at line 33 of file MagicVariableTest.php.

provideDays

Definition at line 92 of file MagicVariableTest.php.

provideDays

Definition at line 97 of file MagicVariableTest.php.

provideMonths

Definition at line 114 of file MagicVariableTest.php.

provideMonths

Definition at line 119 of file MagicVariableTest.php.

provideDays

Definition at line 102 of file MagicVariableTest.php.

provideDays

Definition at line 107 of file MagicVariableTest.php.

provideMonths

Definition at line 124 of file MagicVariableTest.php.

provideMonths

Definition at line 129 of file MagicVariableTest.php.

provideDays

Definition at line 136 of file MagicVariableTest.php.

provideDays

Definition at line 141 of file MagicVariableTest.php.

provideMonths

Definition at line 148 of file MagicVariableTest.php.

provideMonths

Definition at line 153 of file MagicVariableTest.php.


Member Data Documentation

MagicVariableTest::$expectedAsInteger [private]
Initial value:
 array(
        'revisionday',
        'revisionmonth1',
    )

An array of magicword returned as type integer by the parser They are usually returned as a string for i18n since we support persan numbers for example, but some magic explicitly return them as integer.

See also:
MagicVariableTest::assertMagic()

Definition at line 27 of file MagicVariableTest.php.

Parser MagicVariableTest::$testParser = null [private]

Definition at line 18 of file MagicVariableTest.php.


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