Mwjames has submitted this change and it was merged.

Change subject: Travis 67.4 / Fix MW 1.23 / DatabaseBase::__construct parameter 
array ... was deprecated 1.22
......................................................................


Travis 67.4 / Fix MW 1.23 / DatabaseBase::__construct parameter array ... was 
deprecated 1.22

1) SMW\Test\SQLStore\PropertiesCollectorTest::testConstructor
Use of DatabaseBase::__construct method called without parameter array. was 
deprecated in MediaWiki
1.22.

Change-Id: Ic4495b6ae95a58ffbcbf45bb524f85bd577facae
---
M tests/phpunit/includes/storage/sqlstore/PropertiesCollectorTest.php
M tests/phpunit/includes/storage/sqlstore/UnusedPropertiesCollectorTest.php
M tests/phpunit/includes/storage/sqlstore/WantedPropertiesCollectorTest.php
3 files changed, 19 insertions(+), 55 deletions(-)

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



diff --git 
a/tests/phpunit/includes/storage/sqlstore/PropertiesCollectorTest.php 
b/tests/phpunit/includes/storage/sqlstore/PropertiesCollectorTest.php
index 9621a70..c2249cc 100644
--- a/tests/phpunit/includes/storage/sqlstore/PropertiesCollectorTest.php
+++ b/tests/phpunit/includes/storage/sqlstore/PropertiesCollectorTest.php
@@ -56,13 +56,9 @@
                        'usage_count' => (string)$usageCount // 
PropertyStatisticsTable assert ctype_digit
                );
 
-               // Database stub object to make the test independent from any 
real DB
-               $connection = $this->getMock( 'DatabaseMysql' );
-
-               // Override method with expected return objects
-               $connection->expects( $this->any() )
-                       ->method( 'select' )
-                       ->will( $this->returnValue( new FakeResultWrapper( 
array( (object)$result ) ) ) );
+               $connection = $this->newMockBuilder()->newObject( 
'DatabaseBase', array(
+                       'select' => new FakeResultWrapper( array( 
(object)$result ) )
+               ) );
 
                return $connection;
        }
diff --git 
a/tests/phpunit/includes/storage/sqlstore/UnusedPropertiesCollectorTest.php 
b/tests/phpunit/includes/storage/sqlstore/UnusedPropertiesCollectorTest.php
index e91f4c9..50af1dc 100644
--- a/tests/phpunit/includes/storage/sqlstore/UnusedPropertiesCollectorTest.php
+++ b/tests/phpunit/includes/storage/sqlstore/UnusedPropertiesCollectorTest.php
@@ -37,34 +37,19 @@
        /**
         * @since 1.9
         *
-        * @return Database
-        */
-       private function getMockDBConnection( $smwTitle = 'Foo' ) {
-
-               $result = array(
-                       'smw_title' => $smwTitle,
-               );
-
-               // Database stub object to make the test independent from any 
real DB
-               $connection = $this->getMock( 'DatabaseMysql' );
-
-               // Override method with expected return objects
-               $connection->expects( $this->any() )
-                       ->method( 'select' )
-                       ->will( $this->returnValue( new FakeResultWrapper( 
array( (object)$result ) ) ) );
-
-               return $connection;
-       }
-
-       /**
-        * @since 1.9
-        *
         * @return UnusedPropertiesCollector
         */
        private function newInstance( $smwTitle = 'Foo', $cacheEnabled = false 
) {
 
                $mockStore  = $this->newMockBuilder()->newObject( 'Store' );
-               $connection = $this->getMockDBConnection( $smwTitle );
+
+               $result = array(
+                       'smw_title' => $smwTitle,
+               );
+
+               $connection = $this->newMockBuilder()->newObject( 
'DatabaseBase', array(
+                       'select' => new FakeResultWrapper( array( 
(object)$result ) )
+               ) );
 
                $settings = $this->newSettings( array(
                        'smwgCacheType'                   => 'hash',
diff --git 
a/tests/phpunit/includes/storage/sqlstore/WantedPropertiesCollectorTest.php 
b/tests/phpunit/includes/storage/sqlstore/WantedPropertiesCollectorTest.php
index 88f1b14..80ecc33 100644
--- a/tests/phpunit/includes/storage/sqlstore/WantedPropertiesCollectorTest.php
+++ b/tests/phpunit/includes/storage/sqlstore/WantedPropertiesCollectorTest.php
@@ -36,30 +36,6 @@
        /**
         * @since 1.9
         *
-        * @return Database
-        */
-       private function getMockDBConnection( $smwTitle = 'Foo', $count = 1 ) {
-
-               // Injection object expected as the DB fetchObject
-               $result = array(
-                       'count'     => $count,
-                       'smw_title' => $smwTitle
-               );
-
-               // Database stub object to make the test independent from any 
real DB
-               $connection = $this->getMock( 'DatabaseMysql' );
-
-               // Override method with expected return objects
-               $connection->expects( $this->any() )
-                       ->method( 'select' )
-                       ->will( $this->returnValue( new FakeResultWrapper( 
array( (object)$result ) ) ) );
-
-               return $connection;
-       }
-
-       /**
-        * @since 1.9
-        *
         * @return WantedPropertiesCollector
         */
        private function newInstance( $store = null, $property = 'Foo', $count 
= 1, $cacheEnabled = false ) {
@@ -68,7 +44,14 @@
                        $store = $this->newMockBuilder()->newObject( 'Store' );
                }
 
-               $connection = $this->getMockDBConnection( $property, $count );
+               $result = array(
+                       'count'     => $count,
+                       'smw_title' => $property
+               );
+
+               $connection = $this->newMockBuilder()->newObject( 
'DatabaseBase', array(
+                       'select' => new FakeResultWrapper( array( 
(object)$result ) )
+               ) );
 
                $settings = $this->newSettings( array(
                        'smwgPDefaultType'                => '_wpg',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4495b6ae95a58ffbcbf45bb524f85bd577facae
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Mwjames <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Mwjames <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to