Addshore has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311441

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cognate 
refs/changes/41/311441/1

diff --git a/src/CognateHooks.php b/src/CognateHooks.php
index 8bd0c19..2099ce9 100644
--- a/src/CognateHooks.php
+++ b/src/CognateHooks.php
@@ -43,8 +43,8 @@
                if ( !in_array( $title->getNamespace(), $wgCognateNamespaces ) 
) {
                        return true;
                }
-               $interlanguage = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
-               $interlanguage->savePage( $wgLanguageCode, 
$article->getTitle()->getDBkey() );
+               $store = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
+               $store->savePage( $wgLanguageCode, 
$article->getTitle()->getDBkey() );
 
                return true;
        }
@@ -64,8 +64,8 @@
                        return true;
                }
 
-               $interlanguage = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
-               $interlanguage->deletePage( $wgLanguageCode, 
$article->getTitle()->getDBkey() );
+               $store = MediaWikiServices::getInstance()->getService( 
'CognateStore' );
+               $store->deletePage( $wgLanguageCode, 
$article->getTitle()->getDBkey() );
 
                return true;
        }
@@ -83,9 +83,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: newchange
Gerrit-Change-Id: I772988a0f94aa476349bc04f62c71f0de2e46e07
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cognate
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>

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

Reply via email to