MediaWiki  REL1_24
FetchTextTest Class Reference

TestCase for FetchText. More...

Inheritance diagram for FetchTextTest:
Collaboration diagram for FetchTextTest:

List of all members.

Public Member Functions

 addDBData ()
 Stub.
 testCharacters ()
 testEmpty ()
 testExistingSeveral ()
 testExistingSimple ()
 testExistingSimpleWithNewline ()
 testFloatingPointNumberExisting ()
 testFloatingPointNumberNonExisting ()
 testMix ()
 testNegativeInteger ()
 testNonExisting ()

Protected Member Functions

 setUp ()

Private Member Functions

 addRevision ($page, $text, $summary)
 Adds a revision to a page, while returning the resuting text's id.
 assertFilter ($input, $expectedOutput)
 Helper to relate FetchText's input and output.

Private Attributes

Exception null $exceptionFromAddDBData
 As the current MediaWikiTestCase::run is not robust enough to recover from thrown exceptions directly, we cannot throw frow within addDBData, although it would be appropriate.
FetchText $fetchText
 The (mocked) FetchText that is to test.
 $textId1
 $textId2
 $textId3
 $textId4
 $textId5

Detailed Description

TestCase for FetchText.

Database Dump FetchText

Definition at line 71 of file fetchTextTest.php.


Member Function Documentation

Stub.

If a test needs to add additional data to the database, it should implement this method and do so

Since:
1.18

Reimplemented from MediaWikiTestCase.

Definition at line 121 of file fetchTextTest.php.

FetchTextTest::addRevision ( page,
text,
summary 
) [private]

Adds a revision to a page, while returning the resuting text's id.

Parameters:
WikiPage$pageThe page to add the revision to
string$textThe revisions text
string$summaryThe revisions summare
Returns:
int
Exceptions:
MWException

Definition at line 102 of file fetchTextTest.php.

FetchTextTest::assertFilter ( input,
expectedOutput 
) [private]

Helper to relate FetchText's input and output.

Parameters:
string$input
string$expectedOutput

Definition at line 182 of file fetchTextTest.php.

Referenced by testCharacters(), testExistingSeveral(), testExistingSimpleWithNewline(), testFloatingPointNumberExisting(), testMix(), testNegativeInteger(), and testNonExisting().

FetchTextTest::setUp ( ) [protected]

Reimplemented from MediaWikiTestCase.

Definition at line 166 of file fetchTextTest.php.

Definition at line 240 of file fetchTextTest.php.

References assertFilter().

Definition at line 217 of file fetchTextTest.php.

Definition at line 205 of file fetchTextTest.php.

References assertFilter().

Definition at line 195 of file fetchTextTest.php.

Definition at line 244 of file fetchTextTest.php.

References assertFilter().

Definition at line 225 of file fetchTextTest.php.

References assertFilter().

Definition at line 221 of file fetchTextTest.php.

References assertFilter().


Member Data Documentation

Exception null FetchTextTest::$exceptionFromAddDBData [private]

As the current MediaWikiTestCase::run is not robust enough to recover from thrown exceptions directly, we cannot throw frow within addDBData, although it would be appropriate.

Hence, we catch the exception and store it until we are in setUp and may finally rethrow the exception without crashing the test suite.

Definition at line 87 of file fetchTextTest.php.

FetchText FetchTextTest::$fetchText [private]

The (mocked) FetchText that is to test.

Definition at line 91 of file fetchTextTest.php.

FetchTextTest::$textId1 [private]

Definition at line 75 of file fetchTextTest.php.

FetchTextTest::$textId2 [private]

Definition at line 76 of file fetchTextTest.php.

FetchTextTest::$textId3 [private]

Definition at line 77 of file fetchTextTest.php.

FetchTextTest::$textId4 [private]

Definition at line 78 of file fetchTextTest.php.

FetchTextTest::$textId5 [private]

Definition at line 79 of file fetchTextTest.php.


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