}
if ( !isset( $props['user_text'] ) ) {
- $props['user_text'] = 'Tester';
+ $user = $this->getTestUser()->getUser();
+ $props['user_text'] = $user->getName();
+ $props['user'] = $user->getId();
}
if ( !isset( $props['user'] ) ) {
'rev_id',
'rev_page',
'rev_text_id',
- 'rev_user',
'rev_minor_edit',
'rev_deleted',
'rev_len',
strval( $textId ),
'0',
'0',
- '0',
'13',
strval( $parentId ),
's0ngbdoxagreuf2vjtuxzwdz64n29xm',
return $f + [ 'ar_namespace', 'ar_title' ];
},
];
- yield [
- function ( $f ) {
- unset( $f['ar_text'] );
- return $f;
- },
- ];
yield [
function ( $f ) {
unset( $f['ar_text_id'] );
$store = new RevisionStore(
$services->getDBLoadBalancer(),
$services->getService( '_SqlBlobStore' ),
- $services->getMainWANObjectCache()
+ $services->getMainWANObjectCache(),
+ $services->getCommentStore(),
+ $services->getActorMigration()
);
$store->setContentHandlerUseDB( $this->getContentHandlerUseDB() );
// test it ---------------------------------
$since = $revisions[$sinceIdx]->getTimestamp();
+ $revQuery = Revision::getQueryInfo();
$allRows = iterator_to_array( $dbw->select(
- 'revision',
- [ 'rev_id', 'rev_timestamp', 'rev_user' ],
+ $revQuery['tables'],
+ [ 'rev_id', 'rev_timestamp', 'rev_user' => $revQuery['fields']['rev_user'] ],
[
'rev_page' => $page->getId(),
//'rev_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $since ) )
],
__METHOD__,
- [ 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 50 ]
+ [ 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 50 ],
+ $revQuery['joins']
) );
$wasLast = Revision::userWasLastToEdit( $dbw, $page->getId(), $userA->getId(), $since );
public function provideGetContentHandler() {
// NOTE: we expect the help namespace to always contain wikitext
return [
- [ 'hello world', 'Help:Hello', null, null, 'WikitextContentHandler' ],
- [ 'hello world', 'User:hello/there.css', null, null, 'CssContentHandler' ],
- [ serialize( 'hello world' ), 'Dummy:Hello', null, null, 'DummyContentHandlerForTesting' ],
+ [ 'hello world', 'Help:Hello', null, null, WikitextContentHandler::class ],
+ [ 'hello world', 'User:hello/there.css', null, null, CssContentHandler::class ],
+ [ serialize( 'hello world' ), 'Dummy:Hello', null, null, DummyContentHandlerForTesting::class ],
];
}
'text_id' => 123456789, // not in the test DB
] );
- MediaWiki\suppressWarnings(); // bad text_id will trigger a warning.
+ Wikimedia\suppressWarnings(); // bad text_id will trigger a warning.
$this->assertNull( $rev->getContent(),
"getContent() should return null if the revision's text blob could not be loaded." );
$this->assertNull( $rev->getContent(),
"getContent() should return null if the revision's text blob could not be loaded." );
- MediaWiki\suppressWarnings( 'end' );
+ Wikimedia\restoreWarnings();
}
public function provideGetSize() {