Merge "Use job queue for deletion of pages with many revisions"
[lhc/web/wiklou.git] / tests / phpunit / includes / Storage / RevisionStoreRecordTest.php
index 0295e90..12d950c 100644 (file)
@@ -34,7 +34,7 @@ class RevisionStoreRecordTest extends MediaWikiTestCase {
                $user = new UserIdentityValue( 11, 'Tester', 0 );
                $comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
 
-               $main = SlotRecord::newUnsaved( 'main', new TextContent( 'Lorem Ipsum' ) );
+               $main = SlotRecord::newUnsaved( SlotRecord::MAIN, new TextContent( 'Lorem Ipsum' ) );
                $aux = SlotRecord::newUnsaved( 'aux', new TextContent( 'Frumious Bandersnatch' ) );
                $slots = new RevisionSlots( [ $main, $aux ] );
 
@@ -62,7 +62,7 @@ class RevisionStoreRecordTest extends MediaWikiTestCase {
                $user = new UserIdentityValue( 11, 'Tester', 0 );
                $comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
 
-               $main = SlotRecord::newUnsaved( 'main', new TextContent( 'Lorem Ipsum' ) );
+               $main = SlotRecord::newUnsaved( SlotRecord::MAIN, new TextContent( 'Lorem Ipsum' ) );
                $aux = SlotRecord::newUnsaved( 'aux', new TextContent( 'Frumious Bandersnatch' ) );
                $slots = new RevisionSlots( [ $main, $aux ] );
 
@@ -168,7 +168,9 @@ class RevisionStoreRecordTest extends MediaWikiTestCase {
                $this->assertSame( $user, $rec->getUser( RevisionRecord::RAW ), 'getUser' );
                $this->assertSame( $comment, $rec->getComment(), 'getComment' );
 
+               $this->assertSame( $slots, $rec->getSlots(), 'getSlots' );
                $this->assertSame( $slots->getSlotRoles(), $rec->getSlotRoles(), 'getSlotRoles' );
+               $this->assertSame( $slots->getSlots(), $rec->getSlots()->getSlots(), 'getSlots' );
                $this->assertSame( $wikiId, $rec->getWikiId(), 'getWikiId' );
 
                $this->assertSame( (int)$row->rev_id, $rec->getId(), 'getId' );
@@ -218,7 +220,7 @@ class RevisionStoreRecordTest extends MediaWikiTestCase {
 
                $comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
 
-               $main = SlotRecord::newUnsaved( 'main', new TextContent( 'Lorem Ipsum' ) );
+               $main = SlotRecord::newUnsaved( SlotRecord::MAIN, new TextContent( 'Lorem Ipsum' ) );
                $aux = SlotRecord::newUnsaved( 'aux', new TextContent( 'Frumious Bandersnatch' ) );
                $slots = new RevisionSlots( [ $main, $aux ] );
 
@@ -345,19 +347,20 @@ class RevisionStoreRecordTest extends MediaWikiTestCase {
                );
 
                // NOTE: slot meta-data is never suppressed, just the content is!
-               $this->assertNotNull( $rev->getSlot( 'main', RevisionRecord::RAW ), 'raw can' );
-               $this->assertNotNull( $rev->getSlot( 'main', RevisionRecord::FOR_PUBLIC ), 'public can' );
+               $this->assertNotNull( $rev->getSlot( SlotRecord::MAIN, RevisionRecord::RAW ), 'raw can' );
+               $this->assertNotNull( $rev->getSlot( SlotRecord::MAIN, RevisionRecord::FOR_PUBLIC ),
+                       'public can' );
 
                $this->assertNotNull(
-                       $rev->getSlot( 'main', RevisionRecord::FOR_THIS_USER, $user ),
+                       $rev->getSlot( SlotRecord::MAIN, RevisionRecord::FOR_THIS_USER, $user ),
                        'user can'
                );
 
-               $rev->getSlot( 'main', RevisionRecord::RAW )->getContent();
+               $rev->getSlot( SlotRecord::MAIN, RevisionRecord::RAW )->getContent();
                // NOTE: the content of the current revision is never suppressed!
                // Check that getContent() doesn't throw SuppressedDataException
-               $rev->getSlot( 'main', RevisionRecord::FOR_PUBLIC )->getContent();
-               $rev->getSlot( 'main', RevisionRecord::FOR_THIS_USER, $user )->getContent();
+               $rev->getSlot( SlotRecord::MAIN, RevisionRecord::FOR_PUBLIC )->getContent();
+               $rev->getSlot( SlotRecord::MAIN, RevisionRecord::FOR_THIS_USER, $user )->getContent();
        }
 
 }