Aaron Schulz has uploaded a new change for review.

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

Change subject: Made DB ignoreErrors() method protected
......................................................................

Made DB ignoreErrors() method protected

* This should *only* ever be used internal for error suppression,
  such as in the exeption reporting methods.

Change-Id: I5916830d1bd53ee948308f394e55c17dd515ad33
---
M includes/db/Database.php
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/includes/db/ORMTableTest.php
3 files changed, 1 insertion(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/195088/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index b3c81f9..95a1151 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -228,7 +228,7 @@
         * @param null|bool $ignoreErrors
         * @return bool The previous value of the flag.
         */
-       public function ignoreErrors( $ignoreErrors = null ) {
+       protected function ignoreErrors( $ignoreErrors = null ) {
                return wfSetBit( $this->mFlags, DBO_IGNORE, $ignoreErrors );
        }
 
diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index e49c391..f33d73d 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -205,9 +205,6 @@
                        while ( $this->db->trxLevel() > 0 ) {
                                $this->db->rollback();
                        }
-
-                       // don't ignore DB errors
-                       $this->db->ignoreErrors( false );
                }
 
                DeferredUpdates::clearPendingUpdates();
@@ -234,9 +231,6 @@
                        while ( $this->db->trxLevel() > 0 ) {
                                $this->db->rollback();
                        }
-
-                       // don't ignore DB errors
-                       $this->db->ignoreErrors( false );
                }
 
                // Restore mw globals
diff --git a/tests/phpunit/includes/db/ORMTableTest.php 
b/tests/phpunit/includes/db/ORMTableTest.php
index cc5543f..166fd1f 100644
--- a/tests/phpunit/includes/db/ORMTableTest.php
+++ b/tests/phpunit/includes/db/ORMTableTest.php
@@ -69,25 +69,6 @@
                $this->assertInstanceOf( $class, $class::singleton() );
                $this->assertTrue( $class::singleton() === $class::singleton() 
);
        }
-
-       /**
-        * @since 1.21
-        */
-       public function testIgnoreErrorsOverride() {
-               $table = $this->getTable();
-
-               $db = $table->getReadDbConnection();
-               $db->ignoreErrors( true );
-
-               try {
-                       $table->rawSelect( "this is invalid" );
-                       $this->fail( "An invalid query should trigger a 
DBQueryError even if ignoreErrors is enabled." );
-               } catch ( DBQueryError $ex ) {
-                       $this->assertTrue( true, "just making phpunit happy" );
-               }
-
-               $db->ignoreErrors( false );
-       }
 }
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5916830d1bd53ee948308f394e55c17dd515ad33
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

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

Reply via email to