summaryrefslogtreecommitdiff
path: root/tests/phpunit/maintenance/DumpTestCase.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/maintenance/DumpTestCase.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests/phpunit/maintenance/DumpTestCase.php')
-rw-r--r--tests/phpunit/maintenance/DumpTestCase.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/phpunit/maintenance/DumpTestCase.php b/tests/phpunit/maintenance/DumpTestCase.php
index 8b6aef53..8c763970 100644
--- a/tests/phpunit/maintenance/DumpTestCase.php
+++ b/tests/phpunit/maintenance/DumpTestCase.php
@@ -19,7 +19,7 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
protected $exceptionFromAddDBData = null;
/**
- * Holds the xmlreader used for analyzing an xml dump
+ * Holds the XMLReader used for analyzing an XML dump
*
* @var XMLReader|null
*/
@@ -30,13 +30,15 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
*
* @param Page $page Page to add the revision to
* @param string $text Revisions text
- * @param string $summary Revisions summare
- * @return array
+ * @param string $summary Revisions summary
+ * @param string $model The model ID (defaults to wikitext)
+ *
* @throws MWException
+ * @return array
*/
- protected function addRevision( Page $page, $text, $summary ) {
+ protected function addRevision( Page $page, $text, $summary, $model = CONTENT_MODEL_WIKITEXT ) {
$status = $page->doEditContent(
- ContentHandler::makeContent( $text, $page->getTitle() ),
+ ContentHandler::makeContent( $text, $page->getTitle(), $model ),
$summary
);
@@ -330,6 +332,12 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
$this->assertTextNode( "comment", $summary );
$this->skipWhitespace();
+ $this->assertTextNode( "model", $model );
+ $this->skipWhitespace();
+
+ $this->assertTextNode( "format", $format );
+ $this->skipWhitespace();
+
if ( $this->xml->name == "text" ) {
// note: <text> tag may occur here or at the very end.
$text_found = true;
@@ -340,12 +348,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
$this->assertTextNode( "sha1", $text_sha1 );
- $this->assertTextNode( "model", $model );
- $this->skipWhitespace();
-
- $this->assertTextNode( "format", $format );
- $this->skipWhitespace();
-
if ( !$text_found ) {
$this->assertText( $id, $text_id, $text_bytes, $text );
}