jenkins-bot has submitted this change and it was merged.

Change subject: Rename $interlanguage to $store everywhere
......................................................................


Rename $interlanguage to $store everywhere

Change-Id: I772988a0f94aa476349bc04f62c71f0de2e46e07
---
M src/CognateHooks.php
M tests/phpunit/CognateStoreTest.php
2 files changed, 18 insertions(+), 18 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/CognateHooks.php b/src/CognateHooks.php
index e016eef..f9766d2 100644
--- a/src/CognateHooks.php
+++ b/src/CognateHooks.php
@@ -43,8 +43,8 @@
                if ( !$title->inNamespaces( $wgCognateNamespaces ) ) {
                        return true;
                }
-               $interlanguage = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
-               $interlanguage->savePage( $wgLanguageCode, $title->getDBkey() );
+               $store = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
+               $store->savePage( $wgLanguageCode, $title->getDBkey() );
 
                return true;
        }
@@ -68,8 +68,8 @@
                        $updates[] = new MWCallableUpdate(
                                function () use ( $title ){
                                        global $wgLanguageCode;
-                                       $interlanguage = 
MediaWikiServices::getInstance()->getService( 'CognateStore' );
-                                       $interlanguage->deletePage( 
$wgLanguageCode, $title->getDBkey() );
+                                       $store = 
MediaWikiServices::getInstance()->getService( 'CognateStore' );
+                                       $store->deletePage( $wgLanguageCode, 
$title->getDBkey() );
                                },
                                __METHOD__
                        );
@@ -91,9 +91,9 @@
                        return true;
                }
 
-               $interlanguage = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
+               $store = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
                $dbKey = $title->getDBkey();
-               $languages = $interlanguage->getTranslationsForPage( 
$wgLanguageCode, $dbKey );
+               $languages = $store->getTranslationsForPage( $wgLanguageCode, 
$dbKey );
 
                foreach( $languages as $lang ) {
                        if ( !isset( $links[$lang] ) ) {
diff --git a/tests/phpunit/CognateStoreTest.php 
b/tests/phpunit/CognateStoreTest.php
index 7016c43..bf8ec45 100644
--- a/tests/phpunit/CognateStoreTest.php
+++ b/tests/phpunit/CognateStoreTest.php
@@ -8,16 +8,16 @@
 class CognateStoreTest extends MediaWikiTestCase {
 
        /** @var CognateStore */
-       private $interlanguage;
+       private $store;
 
        protected function setUp() {
                parent::setUp();
                $this->tablesUsed = [ 'inter_language_titles' ];
-               $this->interlanguage = new CognateStore( wfGetLB(), false );
+               $this->store = new CognateStore( wfGetLB(), false );
        }
 
        public function testSavePageCreatesNewEntry() {
-               $this->interlanguage->savePage( 'en', 'My_test_page' );
+               $this->store->savePage( 'en', 'My_test_page' );
                $this->assertSelect(
                        'inter_language_titles',
                        [ 'ilt_language', 'ilt_title' ],
@@ -27,8 +27,8 @@
        }
 
        public function testSavePageWithExistingEntryIgnoresErrors() {
-               $this->interlanguage->savePage( 'en', 'My_second_test_page' );
-               $this->interlanguage->savePage( 'en', 'My_second_test_page' );
+               $this->store->savePage( 'en', 'My_second_test_page' );
+               $this->store->savePage( 'en', 'My_second_test_page' );
                $this->assertSelect(
                        'inter_language_titles',
                        [ 'ilt_language', 'ilt_title' ],
@@ -38,17 +38,17 @@
        }
 
        public function testGetTranslationsForPageReturnsAllLanguages() {
-               $this->interlanguage->savePage( 'en', 'My_test_page' );
-               $this->interlanguage->savePage( 'en', 'Another_unrelated_page' 
);
-               $this->interlanguage->savePage( 'de', 'My_test_page' );
-               $this->interlanguage->savePage( 'eo', 'My_test_page' );
-               $languages = $this->interlanguage->getTranslationsForPage( 
'en', 'My_test_page' );
+               $this->store->savePage( 'en', 'My_test_page' );
+               $this->store->savePage( 'en', 'Another_unrelated_page' );
+               $this->store->savePage( 'de', 'My_test_page' );
+               $this->store->savePage( 'eo', 'My_test_page' );
+               $languages = $this->store->getTranslationsForPage( 'en', 
'My_test_page' );
                $this->assertArrayEquals( [ 'de', 'eo' ], $languages );
        }
 
        public function testSaveAndDeletePageResultsInNoEntry() {
-               $this->interlanguage->savePage( 'en', 'My_test_page' );
-               $this->interlanguage->deletePage( 'en', 'My_test_page' );
+               $this->store->savePage( 'en', 'My_test_page' );
+               $this->store->deletePage( 'en', 'My_test_page' );
                $this->assertSelect(
                        'inter_language_titles',
                        [ 'ilt_language', 'ilt_title' ],

-- 
To view, visit https://gerrit.wikimedia.org/r/311441
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I772988a0f94aa476349bc04f62c71f0de2e46e07
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Cognate
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: Gabriel Birke <gabriel.bi...@wikimedia.de>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to