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
Merge "resourceloader: Re-enable testGetBlobCached() test case"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
RevisionDbTestBase.php
diff --git
a/tests/phpunit/includes/RevisionDbTestBase.php
b/tests/phpunit/includes/RevisionDbTestBase.php
index
b05a742
..
ba1249a
100644
(file)
--- a/
tests/phpunit/includes/RevisionDbTestBase.php
+++ b/
tests/phpunit/includes/RevisionDbTestBase.php
@@
-43,9
+43,21
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
);
}
);
}
+ /**
+ * @return int
+ */
+ abstract protected function getMcrMigrationStage();
+
+ /**
+ * @return string[]
+ */
+ abstract protected function getMcrTablesToReset();
+
protected function setUp() {
global $wgContLang;
protected function setUp() {
global $wgContLang;
+ $this->tablesUsed += $this->getMcrTablesToReset();
+
parent::setUp();
$this->mergeMwGlobalArrayValue(
parent::setUp();
$this->mergeMwGlobalArrayValue(
@@
-72,11
+84,17
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
);
$this->setMwGlobals( 'wgContentHandlerUseDB', $this->getContentHandlerUseDB() );
);
$this->setMwGlobals( 'wgContentHandlerUseDB', $this->getContentHandlerUseDB() );
+ $this->setMwGlobals(
+ 'wgMultiContentRevisionSchemaMigrationStage',
+ $this->getMcrMigrationStage()
+ );
MWNamespace::clearCaches();
// Reset namespace cache
$wgContLang->resetNamespaces();
MWNamespace::clearCaches();
// Reset namespace cache
$wgContLang->resetNamespaces();
+ $this->overrideMwServices();
+
if ( !$this->testPage ) {
/**
* We have to create a new page for each subclass as the page creation may result
if ( !$this->testPage ) {
/**
* We have to create a new page for each subclass as the page creation may result
@@
-108,7
+126,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
+263,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
+276,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
+366,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'] );
@@
-397,7
+409,8
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
$services->getDBLoadBalancer(),
$services->getService( '_SqlBlobStore' ),
$services->getMainWANObjectCache(),
$services->getDBLoadBalancer(),
$services->getService( '_SqlBlobStore' ),
$services->getMainWANObjectCache(),
- $services->getCommentStore()
+ $services->getCommentStore(),
+ $services->getActorMigration()
);
$store->setContentHandlerUseDB( $this->getContentHandlerUseDB() );
);
$store->setContentHandlerUseDB( $this->getContentHandlerUseDB() );
@@
-745,15
+758,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 );
@@
-1349,6
+1364,7
@@
abstract class RevisionDbTestBase extends MediaWikiTestCase {
*/
public function testNewKnownCurrent() {
// Setup the services
*/
public function testNewKnownCurrent() {
// Setup the services
+ $this->resetGlobalServices();
$cache = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
$this->setService( 'MainWANObjectCache', $cache );
$db = wfGetDB( DB_MASTER );
$cache = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
$this->setService( 'MainWANObjectCache', $cache );
$db = wfGetDB( DB_MASTER );