Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Make EntityPerPageBuilderTest fields/methods private
......................................................................

Make EntityPerPageBuilderTest fields/methods private

This is split from I04767f2 to make it easier to review.

Change-Id: I752c3e3b9c7c7417ec4d0fc4e19e3235def7c20f
---
M repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
1 file changed, 25 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/13/176913/1

diff --git a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php 
b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
index 183e516..e93b408 100644
--- a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
+++ b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
@@ -30,17 +30,17 @@
        /**
         * @var EntityPerPage
         */
-       protected $entityPerPageTable;
+       private $entityPerPageTable;
 
        /**
         * @var array[]
         */
-       protected $entityPerPageRows;
+       private $entityPerPageRows;
 
        /**
         * @var WikibaseRepo
         */
-       protected $wikibaseRepo;
+       private $wikibaseRepo;
 
        protected function setUp() {
                parent::setUp();
@@ -61,7 +61,7 @@
        /**
         * @return User
         */
-       protected function getUser() {
+       private function getUser() {
                $user = User::newFromName( 'zombie1' );
 
                if ( $user->getId() === 0 ) {
@@ -71,7 +71,7 @@
                return $user;
        }
 
-       protected function clearTables() {
+       private function clearTables() {
                $dbw = wfGetDB( DB_MASTER );
 
                $dbw->delete( 'page', array( "1" ) );
@@ -82,12 +82,18 @@
                }
        }
 
+       /**
+        * @return bool
+        */
        private function itemSupportsRedirect() {
                $handler = ContentHandler::getForModelID( 
CONTENT_MODEL_WIKIBASE_ITEM );
                return $handler->supportsRedirects();
        }
 
-       protected function addItems() {
+       /**
+        * @return Item[]
+        */
+       private function addItems() {
                $user = $this->getUser();
 
                $labels = array( 'New York City', 'Tokyo', 'Jakarta', 'Nairobi',
@@ -125,16 +131,19 @@
                return $items;
        }
 
-       protected function partialClearEntityPerPageTable( $pageId ) {
+       /**
+        * @param int $pageId
+        */
+       private function partialClearEntityPerPageTable( $pageId ) {
                $dbw = wfGetDB( DB_MASTER );
                $dbw->delete( 'wb_entity_per_page', array( 'epp_page_id > ' . 
$pageId ) );
        }
 
        /**
-        * @return int
         * @throws RuntimeException
+        * @return int
         */
-       protected function getPageIdForPartialClear() {
+       private function getPageIdForPartialClear() {
                $dbw = wfGetDB( DB_MASTER );
                $pageRow = $dbw->select(
                        'page',
@@ -158,7 +167,7 @@
        /**
         * @return int
         */
-       protected function countPages() {
+       private function countPages() {
                $dbw = wfGetDB( DB_MASTER );
                $pages = $dbw->select( 'page', array( 'page_id' ), array(), 
__METHOD__ );
 
@@ -168,7 +177,7 @@
        /**
         * @return int
         */
-       protected function countEntityPerPageRows() {
+       private function countEntityPerPageRows() {
                $dbw = wfGetDB( DB_MASTER );
                $eppRows = $dbw->selectField( 'wb_entity_per_page', 'count(*)', 
array(), __METHOD__ );
 
@@ -176,9 +185,9 @@
        }
 
        /**
-        * @return array
+        * @return array[]
         */
-       protected function getEntityPerPageData() {
+       private function getEntityPerPageData() {
                $dbw = wfGetDB( DB_MASTER );
                $rows = $dbw->select(
                        'wb_entity_per_page',
@@ -235,6 +244,9 @@
                $this->assertRows( $this->entityPerPageRows );
        }
 
+       /**
+        * @param array[] $expectedRows
+        */
        private function assertRows( $expectedRows ) {
                $dbw = wfGetDB( DB_MASTER );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I752c3e3b9c7c7417ec4d0fc4e19e3235def7c20f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>

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

Reply via email to