28 $numberOfSlots = count(
$rev->getSlotRoles() );
34 [
'slot_revision_id' => $rev->
getId() ],
35 [ [ (
string)$numberOfSlots ] ]
39 $revQuery = $store->getSlotsQueryInfo( [
'content' ] );
45 'slot_revision_id' => $rev->
getId(),
47 [ [ (
string)$numberOfSlots ] ],
52 parent::assertRevisionExistsInDatabase(
$rev );
60 parent::assertSameSlotContent( $a, $b );
63 $this->assertSame( $a->getContentId(), $b->getContentId() );
67 foreach ( parent::provideInsertRevisionOn_successes() as $case ) {
71 yield
'Multi-slot revision insertion' => [
79 'timestamp' =>
'20171117010101',
86 foreach ( parent::provideNewNullRevision() as $case ) {
91 Title::newFromText(
'UTPage_notAutoCreated' ),
98 CommentStoreComment::newUnsavedComment( __METHOD__ .
' comment multi' ),
103 foreach ( parent::provideNewMutableRevisionFromArray() as $case ) {
107 yield
'Basic array, multiple roles' => [
111 'timestamp' =>
'20171017114835',
112 'user_text' =>
'111.0.1.2',
114 'minor_edit' =>
false,
118 'sha1' =>
'89qs83keq9c9ccw9olvvm4oc9oq50ii',
119 'comment' =>
'Goat Comment!',
130 $queryInfo = $store->getQueryInfo();
133 $this->assertFalse( array_key_exists(
'a_slot_data', $queryInfo[
'tables'] ) );
134 $this->assertFalse( array_key_exists(
'a_slot_data', $queryInfo[
'joins'] ) );
144 if ( $this->db->getType() !==
'mysql' ) {
145 $this->assertTrue(
true );
152 $maxRevId = $this->db->selectField(
'revision',
'MAX(rev_id)' );
157 $this->db->insert(
'slots', [
158 'slot_revision_id' => $maxRevId + 1,
160 'slot_content_id' => 0,
165 $rev->setTimestamp(
'20180101000000' );
166 $rev->setComment( CommentStoreComment::newUnsavedComment(
'test' ) );
169 $rev->setPageId( $page->getId() );
172 $return = $store->insertRevisionOn(
$rev, $this->db );
174 $this->assertSame( $maxRevId + 2, $return->getId() );
184 $loaded = $store->getRevisionById( $return->getId() );
Content object implementation for representing flat text.
Represents a title within MediaWiki.
Content object for wiki text pages.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev