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

List of all members.

Public Member Functions

PUBLIC assertUnPadded ($magic, $value)
 assertion helper expecting a magic output which is unpadded
PUBLIC assertZeroPadded ($magic, $value)
 assertion helper expecting a magic output which is zero padded
 setUp ()
 setup a basic parser object
 tearDown ()
 destroy parser (TODO: is it really neded?)
 testCurrentdayIsUnPadded ($day)
 MediaWikiProvide::Days
 testCurrentdaytwoIsZeroPadded ($day)
 MediaWikiProvide::Days
 testCurrentmonthIsZeroPadded ($month)
 MediaWikiProvide::Months
 testCurrentmonthoneIsUnPadded ($month)
 MediaWikiProvide::Months
 testLocaldayIsUnPadded ($day)
 MediaWikiProvide::Days
 testLocaldaytwoIsZeroPadded ($day)
 MediaWikiProvide::Days
 testLocalmonthIsZeroPadded ($month)
 MediaWikiProvide::Months
 testLocalmonthoneIsUnPadded ($month)
 MediaWikiProvide::Months
 testRevisiondayIsUnPadded ($day)
 MediaWikiProvide::Days
 testRevisiondaytwoIsZeroPadded ($day)
 MediaWikiProvide::Days
 testRevisionmonthIsZeroPadded ($month)
 MediaWikiProvide::Months
 testRevisionmonthoneIsUnPadded ($month)
 MediaWikiProvide::Months
 testServernameFromDifferentProtocols ()
 Rough tests for {{SERVERNAME}} magic word Bug 31176.

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

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.
 $testParser = null
 Will contains a parser object.

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 183 of file MagicVariableTest.php.

Referenced by assertMagicPadding().

Here is the caller graph for this function:

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 156 of file MagicVariableTest.php.

References assertMagic(), and setParserTS().

Referenced by assertUnPadded(), and assertZeroPadded().

Here is the call graph for this function:

Here is the caller graph for this function:

PUBLIC MagicVariableTest::assertUnPadded ( magic,
value 
)

assertion helper expecting a magic output which is unpadded

Definition at line 146 of file MagicVariableTest.php.

References assertMagicPadding().

Here is the call graph for this function:

PUBLIC MagicVariableTest::assertZeroPadded ( magic,
value 
)

assertion helper expecting a magic output which is zero padded

Definition at line 141 of file MagicVariableTest.php.

References assertMagicPadding().

Here is the call graph for this function:

MagicVariableTest::setParserTS ( ts) [private]

helper to set the parser timestamp and revision timestamp

Definition at line 175 of file MagicVariableTest.php.

Referenced by assertMagicPadding().

Here is the caller graph for this function:

setup a basic parser object

Definition at line 32 of file MagicVariableTest.php.

References $title, $wgContLang, Language\factory(), and Title\newFromText().

Here is the call graph for this function:

destroy parser (TODO: is it really neded?)

Definition at line 50 of file MagicVariableTest.php.

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

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

MagicVariableTest::$testParser = null [private]

Will contains a parser object.

Definition at line 17 of file MagicVariableTest.php.


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