From 85000a975b0aa4eae9b9e32e120412f356537766 Mon Sep 17 00:00:00 2001 From: Christian Aistleitner Date: Wed, 27 Jun 2012 22:15:57 +0200 Subject: [PATCH] Choose parentids in tests as they are in real dumps Change-Id: Ib6e9e0a7bebce2a54c039dea16ddc2115776e777 --- .../maintenance/backupPrefetchTest.php | 2 +- .../maintenance/backupTextPassTest.php | 31 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/phpunit/maintenance/backupPrefetchTest.php b/tests/phpunit/maintenance/backupPrefetchTest.php index 6ec802c772..965d7beeaf 100644 --- a/tests/phpunit/maintenance/backupPrefetchTest.php +++ b/tests/phpunit/maintenance/backupPrefetchTest.php @@ -209,7 +209,6 @@ class BaseDumpTest extends MediaWikiTestCase { 2 2 - 5 2012-04-01T16:46:05Z 127.0.0.1 @@ -220,6 +219,7 @@ class BaseDumpTest extends MediaWikiTestCase { 5 + 2 2012-04-01T16:46:05Z 127.0.0.1 diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php index 8b5928dca8..35e7e32a77 100644 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ b/tests/phpunit/maintenance/backupTextPassTest.php @@ -114,16 +114,16 @@ class TextPassDumperTest extends DumpTestCase { $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" ); $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1", $this->revId2_2 ); + "BackupDumperTestP2Text1" ); $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_3 ); + "BackupDumperTestP2Text2", $this->revId2_1 ); $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_4 ); + "BackupDumperTestP2Text3", $this->revId2_2 ); $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text" ); + "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); $this->assertPageEnd(); // Page 3 @@ -180,18 +180,18 @@ class TextPassDumperTest extends DumpTestCase { $this->assertPageStart( $this->pageId2, NS_MAIN, "BackupDumperTestP2" ); $this->assertRevision( $this->revId2_1, "BackupDumperTestP2Summary1", $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1", $this->revId2_2 ); + "BackupDumperTestP2Text1" ); $this->assertRevision( $this->revId2_2, "BackupDumperTestP2Summary2", $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_3 ); + "BackupDumperTestP2Text2", $this->revId2_1 ); // Prefetch kicks in. This is still the SHA-1 of the original text, // But the actual text (with different SHA-1) comes from prefetch. $this->assertRevision( $this->revId2_3, "BackupDumperTestP2Summary3", $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "Prefetch_________2Text3", $this->revId2_4 ); + "Prefetch_________2Text3", $this->revId2_2 ); $this->assertRevision( $this->revId2_4, "BackupDumperTestP2Summary4 extra", $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text" ); + "BackupDumperTestP2Text4 some additional Text", $this->revId2_3 ); $this->assertPageEnd(); // Page 3 @@ -332,17 +332,18 @@ class TextPassDumperTest extends DumpTestCase { "BackupDumperTestP2" ); $this->assertRevision( $this->revId2_1 + $i * self::$numOfRevs, "BackupDumperTestP2Summary1", $this->textId2_1, false, "jprywrymfhysqllua29tj3sc7z39dl2", - "BackupDumperTestP2Text1", $this->revId2_2 + $i * self::$numOfRevs ); + "BackupDumperTestP2Text1" ); $this->assertRevision( $this->revId2_2 + $i * self::$numOfRevs, "BackupDumperTestP2Summary2", $this->textId2_2, false, "b7vj5ks32po5m1z1t1br4o7scdwwy95", - "BackupDumperTestP2Text2", $this->revId2_3 + $i * self::$numOfRevs ); + "BackupDumperTestP2Text2", $this->revId2_1 + $i * self::$numOfRevs ); $this->assertRevision( $this->revId2_3 + $i * self::$numOfRevs, "BackupDumperTestP2Summary3", $this->textId2_3, false, "jfunqmh1ssfb8rs43r19w98k28gg56r", - "BackupDumperTestP2Text3", $this->revId2_4 + $i * self::$numOfRevs ); + "BackupDumperTestP2Text3", $this->revId2_2 + $i * self::$numOfRevs ); $this->assertRevision( $this->revId2_4 + $i * self::$numOfRevs, "BackupDumperTestP2Summary4 extra", $this->textId2_4, false, "6o1ciaxa6pybnqprmungwofc4lv00wv", - "BackupDumperTestP2Text4 some additional Text" ); + "BackupDumperTestP2Text4 some additional Text", + $this->revId2_3 + $i * self::$numOfRevs ); $this->assertPageEnd(); $lookingForPage = 4; @@ -490,7 +491,6 @@ class TextPassDumperTest extends DumpTestCase { ' . ( $this->pageId2 + $i * self::$numOfPages ) . ' ' . ( $this->revId2_1 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_2 + $i * self::$numOfRevs ) . ' 2012-04-01T16:46:05Z 127.0.0.1 @@ -501,7 +501,7 @@ class TextPassDumperTest extends DumpTestCase { ' . ( $this->revId2_2 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_3 + $i * self::$numOfRevs ) . ' + ' . ( $this->revId2_1 + $i * self::$numOfRevs ) . ' 2012-04-01T16:46:05Z 127.0.0.1 @@ -512,7 +512,7 @@ class TextPassDumperTest extends DumpTestCase { ' . ( $this->revId2_3 + $i * self::$numOfRevs ) . ' - ' . ( $this->revId2_4 + $i * self::$numOfRevs ) . ' + ' . ( $this->revId2_2 + $i * self::$numOfRevs ) . ' 2012-04-01T16:46:05Z 127.0.0.1 @@ -523,6 +523,7 @@ class TextPassDumperTest extends DumpTestCase { ' . ( $this->revId2_4 + $i * self::$numOfRevs ) . ' + ' . ( $this->revId2_3 + $i * self::$numOfRevs ) . ' 2012-04-01T16:46:05Z 127.0.0.1 -- 2.20.1