$title = Title::newFromText( 'Dummy' );
$title->resetArticleID( 17 );
- $user = new UserIdentityValue( 11, 'Tester' );
+ $user = new UserIdentityValue( 11, 'Tester', 0 );
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
$main = SlotRecord::newUnsaved( 'main', new TextContent( 'Lorem Ipsum' ) );
$title = Title::newFromText( 'Dummy' );
$title->resetArticleID( 17 );
- $user = new UserIdentityValue( 11, 'Tester' );
+ $user = new UserIdentityValue( 11, 'Tester', 0 );
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
$main = SlotRecord::newUnsaved( 'main', new TextContent( 'Lorem Ipsum' ) );
$title = Title::newFromText( 'Dummy' );
$title->resetArticleID( 17 );
- $user = new UserIdentityValue( 11, 'Tester' );
+ $user = new UserIdentityValue( 11, 'Tester', 0 );
$comment = CommentStoreComment::newUnsavedComment( 'Hello World' );
$rev = $this->newRevision( [ 'rev_deleted' => $visibility ] );
// 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->assertTrue( $rev->hasSlot( 'main' ), 'hasSlot is never suppressed' );
+ $this->assertNotNull( $rev->getSlot( 'main', RevisionRecord::RAW ), 'raw meta' );
+ $this->assertNotNull( $rev->getSlot( 'main', RevisionRecord::FOR_PUBLIC ), 'public meta' );
$this->assertNotNull(
$rev->getSlot( 'main', RevisionRecord::FOR_THIS_USER, $user ),
$this->assertSame( 'main', $slot->getRole(), 'getRole()' );
}
+ public function testHasSlot() {
+ $rev = $this->newRevision();
+
+ $this->assertTrue( $rev->hasSlot( 'main' ) );
+ $this->assertFalse( $rev->hasSlot( 'xyz' ) );
+ }
+
public function testGetContent() {
$rev = $this->newRevision();
return new RevisionStoreRecord(
$title,
- new UserIdentityValue( 11, __METHOD__ ),
+ new UserIdentityValue( 11, __METHOD__, 0 ),
CommentStoreComment::newUnsavedComment( __METHOD__ ),
(object)[
'rev_id' => strval( $revId ),