MediaWiki  REL1_22
TextPassDumperTest Class Reference

Tests for page dumps of BackupDumper. More...

Inheritance diagram for TextPassDumperTest:
Collaboration diagram for TextPassDumperTest:

List of all members.

Public Member Functions

 addDBData ()
 Stub.
 testCheckpointGzip ()
 tests for working checkpoint generation in gzip format work.
 testCheckpointPlain ()
 large
 testPlain ()
 testPrefetchPlain ()

Public Attributes

 $pageId2
 $pageId3
 $pageId4
 $revId2_2
 $revId2_4
 $revId3_2
 $textId1_1
 $textId2_1
 $textId2_2
 $textId2_3
 $textId2_4
 $textId3_1
 $textId3_2
 $textId4_1

Protected Member Functions

 setUp ()
 Default set up function.

Private Member Functions

 checkpointHelper ($checkpointFormat="file")
 Ensures that checkpoint dumps are used and written, by successively increasing the stub size and dumping until the duration crosses a threshold.
 setUpStub ($fname=null, $iterations=1)
 Creates a stub file that is used for testing the text pass of dumps.

Private Attributes

 $pageId1
 $revId1_1
 $revId2_1
 $revId2_3
 $revId3_1
 $revId4_1

Static Private Attributes

static $numOfPages = 4
static $numOfRevs = 8

Detailed Description

Tests for page dumps of BackupDumper.

Database Dump

Definition at line 11 of file backupTextPassTest.php.


Member Function Documentation

Stub.

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

Reimplemented from MediaWikiTestCase.

Definition at line 24 of file backupTextPassTest.php.

References $title, DumpTestCase\addRevision(), WikiPage\factory(), MediaWikiTestCase\getDefaultWikitextNS(), list, and Title\newFromText().

TextPassDumperTest::checkpointHelper ( checkpointFormat = "file") [private]

Ensures that checkpoint dumps are used and written, by successively increasing the stub size and dumping until the duration crosses a threshold.

Parameters:
$checkpointFormatstring: Either "file" for plain text or "gzip" for gzipped checkpoint files.

Definition at line 224 of file backupTextPassTest.php.

References $dumper, $files, $fname, array(), DumpTestCase\assertDumpEnd(), DumpTestCase\assertDumpStart(), DumpTestCase\assertPageEnd(), DumpTestCase\assertPageStart(), DumpTestCase\assertRevision(), DumpTestCase\expectETAOutput(), fail, WikiExporter\FULL, MediaWikiTestCase\getNewTempDirectory(), MediaWikiTestCase\getNewTempFile(), DumpTestCase\gunzip(), setUpStub(), WikiExporter\TEXT, wfMkdirParents(), and wfRecursiveRemoveDir().

Referenced by testCheckpointGzip(), and testCheckpointPlain().

TextPassDumperTest::setUp ( ) [protected]

Default set up function.

Clears $wgUser, and reports errors from addDBData to PHPUnit

Reimplemented from DumpTestCase.

Definition at line 85 of file backupTextPassTest.php.

References array().

TextPassDumperTest::setUpStub ( fname = null,
iterations = 1 
) [private]

Creates a stub file that is used for testing the text pass of dumps.

Parameters:
$fnamestring: (Optional) Absolute name of the file to write the stub into. If this parameter is null, a new temporary file is generated that is automatically removed upon tearDown.
$iterationsinteger: (Optional) specifies how often the block of 3 pages should go into the stub file. The page and revision id increase further and further, while the text id of the first iteration is reused. The pages and revision of iteration > 1 have no corresponding representation in the database.
Returns:
string absolute filename of the stub

Definition at line 436 of file backupTextPassTest.php.

References $fname, $numOfPages, $numOfRevs, and MediaWikiTestCase\getNewTempFile().

Referenced by checkpointHelper(), testPlain(), and testPrefetchPlain().

tests for working checkpoint generation in gzip format work.

We keep this test in addition to the simpler self::testCheckpointPlain, as there were once problems when the used sinks were DumpPipeOutputs.

xmldumps-backup typically uses bzip2 instead of gzip. However, as bzip2 requires PHP extensions, we go for gzip instead, which triggers the same relevant code paths while still being testable on more systems.

large

Definition at line 415 of file backupTextPassTest.php.

References MediaWikiTestCase\checkHasGzip(), and checkpointHelper().

large

Definition at line 399 of file backupTextPassTest.php.

References checkpointHelper().


Member Data Documentation

TextPassDumperTest::$numOfPages = 4 [static, private]

Definition at line 16 of file backupTextPassTest.php.

Referenced by setUpStub().

TextPassDumperTest::$numOfRevs = 8 [static, private]

Definition at line 22 of file backupTextPassTest.php.

Referenced by setUpStub().

TextPassDumperTest::$pageId1 [private]

Definition at line 15 of file backupTextPassTest.php.

TextPassDumperTest::$pageId2

Definition at line 15 of file backupTextPassTest.php.

TextPassDumperTest::$pageId3

Definition at line 15 of file backupTextPassTest.php.

TextPassDumperTest::$pageId4

Definition at line 15 of file backupTextPassTest.php.

TextPassDumperTest::$revId1_1 [private]

Definition at line 17 of file backupTextPassTest.php.

TextPassDumperTest::$revId2_1 [private]

Definition at line 18 of file backupTextPassTest.php.

TextPassDumperTest::$revId2_2

Definition at line 18 of file backupTextPassTest.php.

TextPassDumperTest::$revId2_3 [private]

Definition at line 19 of file backupTextPassTest.php.

TextPassDumperTest::$revId2_4

Definition at line 19 of file backupTextPassTest.php.

TextPassDumperTest::$revId3_1 [private]

Definition at line 20 of file backupTextPassTest.php.

TextPassDumperTest::$revId3_2

Definition at line 20 of file backupTextPassTest.php.

TextPassDumperTest::$revId4_1 [private]

Definition at line 21 of file backupTextPassTest.php.

TextPassDumperTest::$textId1_1

Definition at line 17 of file backupTextPassTest.php.

TextPassDumperTest::$textId2_1

Definition at line 18 of file backupTextPassTest.php.

TextPassDumperTest::$textId2_2

Definition at line 18 of file backupTextPassTest.php.

TextPassDumperTest::$textId2_3

Definition at line 19 of file backupTextPassTest.php.

TextPassDumperTest::$textId2_4

Definition at line 19 of file backupTextPassTest.php.

TextPassDumperTest::$textId3_1

Definition at line 20 of file backupTextPassTest.php.

TextPassDumperTest::$textId3_2

Definition at line 20 of file backupTextPassTest.php.

TextPassDumperTest::$textId4_1

Definition at line 21 of file backupTextPassTest.php.


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