diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2022-03-24 14:51:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2022-03-24 14:51:48 +0000 |
commit | b89c59ba9aa7d559d00673770473d38209870f8a (patch) | |
tree | 2fc1faec81329512934631a5470f40970f723c01 | |
parent | 33ab5b8acafe5b90c39a508eddb8ffe8790a1988 (diff) | |
parent | 8a54b5ec38314ca0a6c0669742d168fb46c7da1b (diff) | |
download | mediawikicore-b89c59ba9aa7d559d00673770473d38209870f8a.tar.gz mediawikicore-b89c59ba9aa7d559d00673770473d38209870f8a.zip |
Merge "phpunit: Set $wgSQLMode from DevelopmentSettings instead of MediaWikiIntegrationTestCase"
-rw-r--r-- | includes/DevelopmentSettings.php | 2 | ||||
-rw-r--r-- | tests/phpunit/MediaWikiIntegrationTestCase.php | 12 |
2 files changed, 2 insertions, 12 deletions
diff --git a/includes/DevelopmentSettings.php b/includes/DevelopmentSettings.php index fa1e7f860a24..3ad81ac28bc6 100644 --- a/includes/DevelopmentSettings.php +++ b/includes/DevelopmentSettings.php @@ -96,7 +96,7 @@ global $wgSQLMode, $wgLocalisationCacheConf, $wgCacheDirectory, $wgEnableUploads, $wgCiteBookReferencing; // Enable MariaDB/MySQL strict mode (T108255) -$wgSQLMode = 'TRADITIONAL'; +$wgSQLMode = 'STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY'; // Localisation Cache to StaticArray (T218207) $wgLocalisationCacheConf['store'] = 'array'; diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index dce558c09fb4..b9a86913d27e 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -588,12 +588,6 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { while ( $this->db->trxLevel() > 0 ) { $this->db->rollback( __METHOD__, 'flush' ); } - // Check for unsafe queries - if ( $this->db->getType() === 'mysql' ) { - $this->db->query( - "SET sql_mode = 'STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY'", - __METHOD__ ); - } } // Reset all caches between tests. @@ -617,7 +611,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { * @after */ final protected function mediaWikiTearDown(): void { - global $wgRequest, $wgSQLMode; + global $wgRequest; $status = ob_get_status(); if ( isset( $status['name'] ) && @@ -631,10 +625,6 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { while ( $this->db->trxLevel() > 0 ) { $this->db->rollback( __METHOD__, 'flush' ); } - if ( $this->db->getType() === 'mysql' ) { - $this->db->query( "SET sql_mode = " . $this->db->addQuotes( $wgSQLMode ), - __METHOD__ ); - } } // Clear any cached test users so they don't retain references to old services |