MediaWiki  REL1_22
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
 testServernameFromDifferentProtocols ($server)
 Rough tests for {{SERVERNAME}} magic word Bug 31176 Database provideDataServernameFromDifferentProtocols.

Static Public Member Functions

static provideDataServernameFromDifferentProtocols ()
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.

Definition at line 223 of file MagicVariableTest.php.

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

Main assertion helper for magic variables padding.

Parameters:
$magicstring Magic variable name
$valuemixed Month or day
$formatstring sprintf format for $value

Definition at line 193 of file MagicVariableTest.php.

MagicVariableTest::assertUnPadded ( magic,
value 
)

assertion helper expecting a magic output which is unpadded

Definition at line 183 of file MagicVariableTest.php.

MagicVariableTest::assertZeroPadded ( magic,
value 
)

assertion helper expecting a magic output which is zero padded

Definition at line 178 of file MagicVariableTest.php.

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

Definition at line 59 of file MagicVariableTest.php.

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

Definition at line 78 of file MagicVariableTest.php.

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

Definition at line 71 of file MagicVariableTest.php.

MagicVariableTest::setParserTS ( ts) [private]

helper to set the parser timestamp and revision timestamp

Definition at line 215 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 90 of file MagicVariableTest.php.

provideDays

Definition at line 95 of file MagicVariableTest.php.

provideMonths

Definition at line 112 of file MagicVariableTest.php.

provideMonths

Definition at line 117 of file MagicVariableTest.php.

provideDays

Definition at line 100 of file MagicVariableTest.php.

provideDays

Definition at line 105 of file MagicVariableTest.php.

provideMonths

Definition at line 122 of file MagicVariableTest.php.

provideMonths

Definition at line 127 of file MagicVariableTest.php.

provideDays

Definition at line 134 of file MagicVariableTest.php.

provideDays

Definition at line 139 of file MagicVariableTest.php.

provideMonths

Definition at line 146 of file MagicVariableTest.php.

provideMonths

Definition at line 151 of file MagicVariableTest.php.

Rough tests for {{SERVERNAME}} magic word Bug 31176 Database provideDataServernameFromDifferentProtocols.

Definition at line 161 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: