aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/page
diff options
context:
space:
mode:
authorAmir Sarabadani <ladsgroup@gmail.com>2023-08-28 10:52:19 +0200
committerAmir Sarabadani <ladsgroup@gmail.com>2023-09-06 12:30:38 +0200
commit049b34b41ce07e12bb5da574cbfefdbb26e6a2ed (patch)
tree3c7b164461eaf24ed1c524dffbb7aa7bc60188ad /tests/phpunit/includes/page
parent53858466f1128a9195bd2b3599c2b4a994652105 (diff)
downloadmediawikicore-049b34b41ce07e12bb5da574cbfefdbb26e6a2ed.tar.gz
mediawikicore-049b34b41ce07e12bb5da574cbfefdbb26e6a2ed.zip
Introduce RevisionSelectQueryBuilder
Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code Also removing a brittle test that wasn't really testing anything. Bug: T344971 Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
Diffstat (limited to 'tests/phpunit/includes/page')
-rw-r--r--tests/phpunit/includes/page/PageArchiveTest.php12
-rw-r--r--tests/phpunit/includes/page/UndeletePageTest.php13
2 files changed, 7 insertions, 18 deletions
diff --git a/tests/phpunit/includes/page/PageArchiveTest.php b/tests/phpunit/includes/page/PageArchiveTest.php
index 768fe34f80ed..d785edd7d53c 100644
--- a/tests/phpunit/includes/page/PageArchiveTest.php
+++ b/tests/phpunit/includes/page/PageArchiveTest.php
@@ -145,15 +145,9 @@ class PageArchiveTest extends MediaWikiIntegrationTestCase {
$archive->undeleteAsUser( [], $this->getTestSysop()->getUser() );
// Should be back in revision
- $revQuery = $revisionStore->getQueryInfo();
- $row = $dbr->selectRow(
- $revQuery['tables'],
- $revQuery['fields'],
- [ 'rev_id' => $this->ipRev->getId() ],
- __METHOD__,
- [],
- $revQuery['joins']
- );
+ $row = $revisionStore->newSelectQueryBuilder( $dbr )
+ ->where( [ 'rev_id' => $this->ipRev->getId() ] )
+ ->caller( __METHOD__ )->fetchRow();
$this->assertNotFalse( $row, 'row exists in revision table' );
$this->assertEquals( $this->ipEditor, $row->rev_user_text );
diff --git a/tests/phpunit/includes/page/UndeletePageTest.php b/tests/phpunit/includes/page/UndeletePageTest.php
index bec657e2093f..0aa1c81d7a3b 100644
--- a/tests/phpunit/includes/page/UndeletePageTest.php
+++ b/tests/phpunit/includes/page/UndeletePageTest.php
@@ -124,17 +124,12 @@ class UndeletePageTest extends MediaWikiIntegrationTestCase {
$status = $undeletePage->setUndeleteAssociatedTalk( true )->undeleteUnsafe( '' );
$this->assertEquals( 2, $status->value[UndeletePage::REVISIONS_RESTORED] );
- $revQuery = $revisionStore->getQueryInfo();
// check subject page and talk page are both back in the revision table
foreach ( [ 0, 1 ] as $key ) {
- $row = $dbr->selectRow(
- $revQuery['tables'],
- $revQuery['fields'],
- [ 'rev_id' => $this->pages[$key]['revId'] ],
- __METHOD__,
- [],
- $revQuery['joins']
- );
+ $row = $revisionStore->newSelectQueryBuilder( $dbr )
+ ->where( [ 'rev_id' => $this->pages[$key]['revId'] ] )
+ ->caller( __METHOD__ )->fetchRow();
+
$this->assertNotFalse( $row, 'row exists in revision table' );
$this->assertEquals( $this->ipEditor, $row->rev_user_text );