MediaWiki  master
MediaWiki\Tests\Maintenance\BackupDumperPageTest Class Reference

Tests for page dumps of BackupDumper. More...

Inheritance diagram for MediaWiki\Tests\Maintenance\BackupDumperPageTest:
Collaboration diagram for MediaWiki\Tests\Maintenance\BackupDumperPageTest:

Public Member Functions

 addDBData ()
 
 schemaVersionProvider ()
 
 tearDown ()
 
 testCurrentStubGzip ()
 
 testCurrentStubPlain ( $schemaVersion)
 schemaVersionProvider More...
 
 testFullStubPlain ( $schemaVersion)
 schemaVersionProvider More...
 
 testFullTextPlain ( $schemaVersion)
 schemaVersionProvider More...
 
 testXmlDumpsBackupUseCase ( $schemaVersion)
 xmldumps-backup typically performs a single dump that that writes out three files More...
 
- Public Member Functions inherited from MediaWiki\Tests\Maintenance\DumpTestCase
 expectETAOutput ()
 Checks for test output consisting only of lines containing ETA announcements. More...
 

Public Attributes

 $pageId2
 
 $pageId3
 
 $pageId4
 
 $pageId5
 
 $pageTitle2
 
 $pageTitle3
 
 $pageTitle4
 
 $pageTitle5
 
 $revId2_2
 
 $revId2_4
 
 $revId3_2
 
 $talk_namespace
 
 $textId1_1
 
 $textId2_1
 
 $textId2_2
 
 $textId2_3
 
 $textId2_4
 
 $textId3_1
 
 $textId3_2
 
 $textId4_1
 
 $textId5_1
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from MediaWiki\Tests\Maintenance\DumpTestCase
 addRevision (WikiPage $page, $text, $summary, $model=CONTENT_MODEL_WIKITEXT)
 Adds a revision to a page, while returning the resuting revision's id. More...
 
 assertDumpSchema ( $fname, $schemaFile)
 Checks an XML file against an XSD schema. More...
 
 checkHasGzip ()
 Skip the test if 'gzip' is not in $PATH. More...
 
 getDumpAsserter ( $schemaVersion=null)
 
 getXmlSchemaPath ( $schemaVersion=null)
 Returns the path to the XML schema file for the given schema version. More...
 
 gunzip ( $fname)
 gunzips the given file and stores the result in the original file name More...
 
 setUp ()
 Default set up function. More...
 
- Protected Member Functions inherited from MediaWikiLangTestCase
 setUp ()
 

Private Member Functions

 corruptRevisionData (RevisionRecord $revision)
 Corrupt the information about the given revision in the database. More...
 
 newDumpBackup ( $argv, $startId, $endId)
 
 newStreamingDBConnection ()
 Returns a new database connection which is separate from the conenctions returned by the default LoadBalancer instance. More...
 

Private Attributes

 $namespace
 
 $pageId1
 
 $pageTitle1
 
 $revId1_1
 
 $revId2_1
 
 $revId2_3
 
 $revId3_1
 
 $revId4_1
 
 $revId5_1
 
LoadBalancer null $streamingLoadBalancer = null
 

Additional Inherited Members

- Static Public Member Functions inherited from MediaWiki\Tests\Maintenance\DumpTestCase
static setUpBeforeClass ()
 
- Protected Attributes inherited from MediaWiki\Tests\Maintenance\DumpTestCase
Exception null $exceptionFromAddDBData = null
 exception to be rethrown once in sound PHPUnit surrounding More...
 
- Static Protected Attributes inherited from MediaWiki\Tests\Maintenance\DumpTestCase
static bool null $hasGzip = null
 Whether the 'gzip' utility is available. More...
 

Detailed Description

Tests for page dumps of BackupDumper.

Database Dump BackupDumper

Definition at line 28 of file backup_PageTest.php.

Member Function Documentation

◆ addDBData()

◆ corruptRevisionData()

MediaWiki\Tests\Maintenance\BackupDumperPageTest::corruptRevisionData ( RevisionRecord  $revision)
private

Corrupt the information about the given revision in the database.

Parameters
RevisionRecord$revision

Definition at line 133 of file backup_PageTest.php.

References $wgMultiContentRevisionSchemaMigrationStage, Revision\RevisionRecord\getId(), Revision\RevisionRecord\getSlot(), Revision\SlotRecord\MAIN, SCHEMA_COMPAT_WRITE_NEW, and SCHEMA_COMPAT_WRITE_OLD.

Referenced by MediaWiki\Tests\Maintenance\BackupDumperPageTest\addDBData().

◆ newDumpBackup()

◆ newStreamingDBConnection()

MediaWiki\Tests\Maintenance\BackupDumperPageTest::newStreamingDBConnection ( )
private

Returns a new database connection which is separate from the conenctions returned by the default LoadBalancer instance.

Returns
IDatabase

Definition at line 188 of file backup_PageTest.php.

References DB_REPLICA, and MediaWiki\MediaWikiServices\getInstance().

Referenced by MediaWiki\Tests\Maintenance\BackupDumperPageTest\newDumpBackup().

◆ schemaVersionProvider()

MediaWiki\Tests\Maintenance\BackupDumperPageTest::schemaVersionProvider ( )

Definition at line 232 of file backup_PageTest.php.

References XmlDumpWriter\$supportedSchemas, and as.

◆ setUp()

MediaWiki\Tests\Maintenance\BackupDumperPageTest::setUp ( )
protected

Definition at line 161 of file backup_PageTest.php.

◆ tearDown()

MediaWiki\Tests\Maintenance\BackupDumperPageTest::tearDown ( )

Definition at line 174 of file backup_PageTest.php.

◆ testCurrentStubGzip()

◆ testCurrentStubPlain()

◆ testFullStubPlain()

◆ testFullTextPlain()

◆ testXmlDumpsBackupUseCase()

MediaWiki\Tests\Maintenance\BackupDumperPageTest::testXmlDumpsBackupUseCase (   $schemaVersion)

xmldumps-backup typically performs a single dump that that writes out three files

  • gzipped stubs of everything (meta-history)
  • gzipped stubs of latest revisions of all pages (meta-current)
  • gzipped stubs of latest revisions of all pages of namespage 0 (articles)

We reproduce such a setup with our mini fixture, although we omit chunks, and all the other gimmicks of xmldumps-backup.

schemaVersionProvider

Definition at line 652 of file backup_PageTest.php.

References MediaWiki\Tests\Maintenance\DumpTestCase\assertDumpSchema(), MediaWiki\Tests\Maintenance\DumpTestCase\checkHasGzip(), MediaWiki\Tests\Maintenance\DumpTestCase\expectETAOutput(), WikiExporter\FULL, MediaWiki\Tests\Maintenance\DumpTestCase\getDumpAsserter(), MediaWiki\Tests\Maintenance\DumpTestCase\getXmlSchemaPath(), MediaWiki\Tests\Maintenance\DumpTestCase\gunzip(), MediaWiki\Tests\Maintenance\BackupDumperPageTest\newDumpBackup(), null, and WikiExporter\STUB.

Member Data Documentation

◆ $namespace

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$namespace
private

Definition at line 40 of file backup_PageTest.php.

◆ $pageId1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageId1
private

Definition at line 32 of file backup_PageTest.php.

◆ $pageId2

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageId2

Definition at line 32 of file backup_PageTest.php.

◆ $pageId3

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageId3

Definition at line 32 of file backup_PageTest.php.

◆ $pageId4

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageId4

Definition at line 32 of file backup_PageTest.php.

◆ $pageId5

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageId5

Definition at line 32 of file backup_PageTest.php.

◆ $pageTitle1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageTitle1
private

Definition at line 33 of file backup_PageTest.php.

◆ $pageTitle2

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageTitle2

Definition at line 33 of file backup_PageTest.php.

◆ $pageTitle3

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageTitle3

Definition at line 33 of file backup_PageTest.php.

◆ $pageTitle4

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageTitle4

Definition at line 33 of file backup_PageTest.php.

◆ $pageTitle5

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$pageTitle5

Definition at line 33 of file backup_PageTest.php.

◆ $revId1_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId1_1
private

Definition at line 34 of file backup_PageTest.php.

◆ $revId2_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId2_1
private

Definition at line 35 of file backup_PageTest.php.

◆ $revId2_2

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId2_2

Definition at line 35 of file backup_PageTest.php.

◆ $revId2_3

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId2_3
private

Definition at line 36 of file backup_PageTest.php.

◆ $revId2_4

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId2_4

Definition at line 36 of file backup_PageTest.php.

◆ $revId3_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId3_1
private

Definition at line 37 of file backup_PageTest.php.

◆ $revId3_2

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId3_2

Definition at line 37 of file backup_PageTest.php.

◆ $revId4_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId4_1
private

Definition at line 38 of file backup_PageTest.php.

◆ $revId5_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$revId5_1
private

Definition at line 39 of file backup_PageTest.php.

◆ $streamingLoadBalancer

LoadBalancer null MediaWiki\Tests\Maintenance\BackupDumperPageTest::$streamingLoadBalancer = null
private

Definition at line 45 of file backup_PageTest.php.

◆ $talk_namespace

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$talk_namespace

Definition at line 40 of file backup_PageTest.php.

◆ $textId1_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId1_1

Definition at line 34 of file backup_PageTest.php.

◆ $textId2_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId2_1

Definition at line 35 of file backup_PageTest.php.

◆ $textId2_2

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId2_2

Definition at line 35 of file backup_PageTest.php.

◆ $textId2_3

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId2_3

Definition at line 36 of file backup_PageTest.php.

◆ $textId2_4

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId2_4

Definition at line 36 of file backup_PageTest.php.

◆ $textId3_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId3_1

Definition at line 37 of file backup_PageTest.php.

◆ $textId3_2

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId3_2

Definition at line 37 of file backup_PageTest.php.

◆ $textId4_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId4_1

Definition at line 38 of file backup_PageTest.php.

◆ $textId5_1

MediaWiki\Tests\Maintenance\BackupDumperPageTest::$textId5_1

Definition at line 39 of file backup_PageTest.php.


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