Set logger to null when connecting to DB in DBFileJournalIntegrationTest.php

The code is appropriately logging when it encounters a database
connection error. However, the CI interprets that as
an actual exception being thrown. Setting the logger to null
allows the CI to complete.

Bug: T248194
Change-Id: If8be607e93082202551d3e8b5421fc2e07268243
This commit is contained in:
Nikki Nikkhoui 2020-04-08 14:04:20 -07:00
parent 749c422cf1
commit 7c6b9b4121

View file

@ -41,6 +41,7 @@ class DBFileJournalIntegrationTest extends MediaWikiIntegrationTestCase {
* @covers ::doLogChangeBatch
*/
public function testDoLogChangeBatch_exceptionDbConnect() {
$this->setNullLogger( 'DBConnection' );
$journal = $this->getJournal( [ 'domain' => 'no-such-domain' ] );
$this->assertEquals(
@ -52,10 +53,10 @@ class DBFileJournalIntegrationTest extends MediaWikiIntegrationTestCase {
* @covers ::doLogChangeBatch
*/
public function testDoLogChangeBatch_exceptionDbQuery() {
MediaWikiServices::getInstance()->getConfiguredReadOnlyMode()->setReason( 'testing' );
$this->setNullLogger( 'DBQuery' );
$journal = $this->getJournal();
// Null value for 'op' will make the query fail
$this->assertEquals(
StatusValue::newFatal( 'filejournal-fail-dbquery', 'local-backend' ),
$journal->logChangeBatch(