From cd2e19c050002f2ea1165d0fcccb3bb9ed1d7631 Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Mon, 25 Sep 2023 20:49:16 +0200 Subject: tests: Use $this->getDb() instead of wfGetDB() in integration tests Deprecated long time ago. Bug: T330641 Change-Id: Ia57f12d350c3346029aafae25534c9ed262a7e98 --- tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php') diff --git a/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php b/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php index 52ae188b60ca..3a7bfb6c0940 100644 --- a/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php +++ b/tests/phpunit/includes/api/query/ApiQuerySiteinfoTest.php @@ -156,15 +156,15 @@ class ApiQuerySiteinfoTest extends ApiTestCase { } public function testSpecialPageAliases() { - $this->assertCount( - count( $this->getServiceContainer()->getSpecialPageFactory()->getNames() ), + $this->assertSameSize( + $this->getServiceContainer()->getSpecialPageFactory()->getNames(), $this->doQuery( 'specialpagealiases' ) ); } public function testMagicWords() { - $this->assertCount( - count( $this->getServiceContainer()->getContentLanguage()->getMagicWords() ), + $this->assertSameSize( + $this->getServiceContainer()->getContentLanguage()->getMagicWords(), $this->doQuery( 'magicwords' ) ); } @@ -181,8 +181,7 @@ class ApiQuerySiteinfoTest extends ApiTestCase { MainConfigNames::ScriptPath => '/w', ] ); - $dbw = wfGetDB( DB_PRIMARY ); - $dbw->insert( + $this->getDb()->insert( 'interwiki', [ [ -- cgit v1.2.3