dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop archive.ar_text and ar_flags
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
RevisionDbTestBase.php
diff --git
a/tests/phpunit/includes/RevisionDbTestBase.php
b/tests/phpunit/includes/RevisionDbTestBase.php
index
511b109
..
5de34d1
100644
(file)
--- a/
tests/phpunit/includes/RevisionDbTestBase.php
+++ b/
tests/phpunit/includes/RevisionDbTestBase.php
@@
-108,7
+108,9
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
}
if ( !isset( $props['user_text'] ) ) {
}
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'] ) ) {
}
if ( !isset( $props['user'] ) ) {
@@
-243,7
+245,6
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
'rev_id',
'rev_page',
'rev_text_id',
'rev_id',
'rev_page',
'rev_text_id',
- 'rev_user',
'rev_minor_edit',
'rev_deleted',
'rev_len',
'rev_minor_edit',
'rev_deleted',
'rev_len',
@@
-257,7
+258,6
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
strval( $textId ),
'0',
'0',
strval( $textId ),
'0',
'0',
- '0',
'13',
strval( $parentId ),
's0ngbdoxagreuf2vjtuxzwdz64n29xm',
'13',
strval( $parentId ),
's0ngbdoxagreuf2vjtuxzwdz64n29xm',
@@
-348,12
+348,6
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
return $f + [ 'ar_namespace', 'ar_title' ];
},
];
return $f + [ 'ar_namespace', 'ar_title' ];
},
];
- yield [
- function ( $f ) {
- unset( $f['ar_text'] );
- return $f;
- },
- ];
yield [
function ( $f ) {
unset( $f['ar_text_id'] );
yield [
function ( $f ) {
unset( $f['ar_text_id'] );
@@
-396,7
+390,9
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
$store = new RevisionStore(
$services->getDBLoadBalancer(),
$services->getService( '_SqlBlobStore' ),
$store = new RevisionStore(
$services->getDBLoadBalancer(),
$services->getService( '_SqlBlobStore' ),
- $services->getMainWANObjectCache()
+ $services->getMainWANObjectCache(),
+ $services->getCommentStore(),
+ $services->getActorMigration()
);
$store->setContentHandlerUseDB( $this->getContentHandlerUseDB() );
);
$store->setContentHandlerUseDB( $this->getContentHandlerUseDB() );
@@
-744,15
+740,17
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
// test it ---------------------------------
$since = $revisions[$sinceIdx]->getTimestamp();
// test it ---------------------------------
$since = $revisions[$sinceIdx]->getTimestamp();
+ $revQuery = Revision::getQueryInfo();
$allRows = iterator_to_array( $dbw->select(
$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__,
[
'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 );
) );
$wasLast = Revision::userWasLastToEdit( $dbw, $page->getId(), $userA->getId(), $since );
@@
-902,7
+900,7
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
'text_id' => 123456789, // not in the test DB
] );
'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." );
@@
-911,7
+909,7
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
$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() {
}
public function provideGetSize() {