use Wikimedia\Rdbms\IMaintainableDatabase;
use Wikimedia\Rdbms\Database;
use Wikimedia\TestingAccessWrapper;
use Wikimedia\Rdbms\IMaintainableDatabase;
use Wikimedia\Rdbms\Database;
use Wikimedia\TestingAccessWrapper;
- echo 'A working MediaWiki installation with a configured LocalSettings.php file is'
- . ' required for tests that extend ' . self::class;
+ echo "File \"$IP/LocalSettings.php\" could not be found. "
+ . "Test case " . static::class . " extends " . self::class . " "
+ . "which requires a working MediaWiki installation.\n"
+ . ( new RuntimeException() )->getTraceAsString();
+ private static function formatErrorLevel( $errorLevel ) {
+ switch ( gettype( $errorLevel ) ) {
+ case 'integer':
+ return '0x' . strtoupper( dechex( $errorLevel ) );
+ case 'NULL':
+ return 'null';
+ default:
+ throw new MWException( 'Unexpected error level type ' . gettype( $errorLevel ) );
+ }
+ }
+
protected function tearDown() {
global $wgRequest, $wgSQLMode;
protected function tearDown() {
global $wgRequest, $wgSQLMode;
if ( $phpErrorLevel !== $this->phpErrorLevel ) {
ini_set( 'error_reporting', $this->phpErrorLevel );
if ( $phpErrorLevel !== $this->phpErrorLevel ) {
ini_set( 'error_reporting', $this->phpErrorLevel );
- $oldHex = strtoupper( dechex( $this->phpErrorLevel ) );
- $newHex = strtoupper( dechex( $phpErrorLevel ) );
+ $oldVal = self::formatErrorLevel( $this->phpErrorLevel );
+ $newVal = self::formatErrorLevel( $phpErrorLevel );
$pageTables = [
'page', 'revision', 'ip_changes', 'revision_comment_temp', 'comment', 'archive',
'revision_actor_temp', 'slots', 'content', 'content_models', 'slot_roles',
$pageTables = [
'page', 'revision', 'ip_changes', 'revision_comment_temp', 'comment', 'archive',
'revision_actor_temp', 'slots', 'content', 'content_models', 'slot_roles',