Merge "Even more out-factoring to methods in the header"
[lhc/web/wiklou.git] / tests / phpunit / includes / installer / DatabaseUpdaterTest.php
index 81c9faf..2a75cf4 100644 (file)
@@ -16,11 +16,18 @@ class DatabaseUpdaterTest extends MediaWikiTestCase {
        }
 }
 
-class FakeDatabase extends DatabaseBase {
+class FakeDatabase extends Database {
        public $lastInsertTable;
        public $lastInsertData;
 
        function __construct() {
+               $this->cliMode = true;
+               $this->connLogger = new \Psr\Log\NullLogger();
+               $this->queryLogger = new \Psr\Log\NullLogger();
+               $this->errorLogger = function ( Exception $e ) {
+                       wfWarn( get_class( $e ) . ": {$e->getMessage()}" );
+               };
+               $this->currentDomain = DatabaseDomain::newUnspecified();
        }
 
        function clearFlag( $arg, $remember = self::REMEMBER_NOTHING ) {
@@ -63,7 +70,7 @@ class FakeDatabase extends DatabaseBase {
         * member variables.
         * If no more rows are available, false is returned.
         *
-        * @param ResultWrapper|stdClass $res Object as returned from DatabaseBase::query(), etc.
+        * @param ResultWrapper|stdClass $res Object as returned from Database::query(), etc.
         * @return stdClass|bool
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
@@ -76,7 +83,7 @@ class FakeDatabase extends DatabaseBase {
         * form. Fields are retrieved with $row['fieldname'].
         * If no more rows are available, false is returned.
         *
-        * @param ResultWrapper $res Result object as returned from DatabaseBase::query(), etc.
+        * @param ResultWrapper $res Result object as returned from Database::query(), etc.
         * @return array|bool
         * @throws DBUnexpectedError Thrown if the database returns an error
         */
@@ -96,7 +103,7 @@ class FakeDatabase extends DatabaseBase {
 
        /**
         * Get the number of fields in a result object
-        * @see http://www.php.net/mysql_num_fields
+        * @see https://secure.php.net/mysql_num_fields
         *
         * @param mixed $res A SQL result
         * @return int
@@ -107,7 +114,7 @@ class FakeDatabase extends DatabaseBase {
 
        /**
         * Get a field name in a result object
-        * @see http://www.php.net/mysql_field_name
+        * @see https://secure.php.net/mysql_field_name
         *
         * @param mixed $res A SQL result
         * @param int $n
@@ -135,7 +142,7 @@ class FakeDatabase extends DatabaseBase {
 
        /**
         * Change the position of the cursor in a result object
-        * @see http://www.php.net/mysql_data_seek
+        * @see https://secure.php.net/mysql_data_seek
         *
         * @param mixed $res A SQL result
         * @param int $row
@@ -146,7 +153,7 @@ class FakeDatabase extends DatabaseBase {
 
        /**
         * Get the last error number
-        * @see http://www.php.net/mysql_errno
+        * @see https://secure.php.net/mysql_errno
         *
         * @return int
         */
@@ -156,7 +163,7 @@ class FakeDatabase extends DatabaseBase {
 
        /**
         * Get a description of the last error
-        * @see http://www.php.net/mysql_error
+        * @see https://secure.php.net/mysql_error
         *
         * @return string
         */
@@ -190,7 +197,7 @@ class FakeDatabase extends DatabaseBase {
 
        /**
         * Get the number of rows affected by the last write query
-        * @see http://www.php.net/mysql_affected_rows
+        * @see https://secure.php.net/mysql_affected_rows
         *
         * @return int
         */
@@ -210,7 +217,7 @@ class FakeDatabase extends DatabaseBase {
 
        /**
         * Returns a wikitext link to the DB's website, e.g.,
-        *   return "[http://www.mysql.com/ MySQL]";
+        *   return "[https://www.mysql.com/ MySQL]";
         * Should at least contain plain text, if for some reason
         * your database has no website.
         *