Merge "Suppress notice from ParserOutput::__sleep()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 1 Aug 2019 16:31:57 +0000 (16:31 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 1 Aug 2019 16:31:57 +0000 (16:31 +0000)
includes/resourceloader/MessageBlobStore.php
includes/resourceloader/ResourceLoaderStartUpModule.php
resources/Resources.php
tests/phpunit/structure/ResourcesTest.php

index fca06c9..d0f6729 100644 (file)
@@ -224,7 +224,7 @@ class MessageBlobStore implements LoggerAwareInterface {
                        }
                }
 
-               $json = FormatJson::encode( (object)$messages );
+               $json = FormatJson::encode( (object)$messages, false, FormatJson::UTF8_OK );
                // @codeCoverageIgnoreStart
                if ( $json === false ) {
                        $this->logger->warning( 'Failed to encode message blob for {module} ({lang})', [
index 6b38ee4..dbf6b21 100644 (file)
@@ -283,8 +283,9 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        }
 
                        if ( $versionHash !== '' && strlen( $versionHash ) !== 7 ) {
-                               $this->getLogger()->warning(
-                                       "Module '{module}' produced an invalid version hash: '{version}'.",
+                               $e = new RuntimeException( "Badly formatted module version hash" );
+                               $resourceLoader->outputErrorAndLog( $e,
+                                               "Module '{module}' produced an invalid version hash: '{version}'.",
                                        [
                                                'module' => $name,
                                                'version' => $versionHash,
index e29d658..980bdc4 100644 (file)
@@ -1154,6 +1154,7 @@ return [
                        'upload-form-label-usage-filename',
                        'action-upload',
                        'apierror-mustbeloggedin',
+                       'apierror-permissiondenied',
                        'badaccess-groups',
                        'apierror-timeout',
                        'apierror-offline',
index 4f9664f..acd8a19 100644 (file)
@@ -36,14 +36,6 @@ class ResourcesTest extends MediaWikiTestCase {
                );
        }
 
-       public function testVersionHash() {
-               $data = self::getAllModules();
-               foreach ( $data['modules'] as $moduleName => $module ) {
-                       $version = $module->getVersionHash( $data['context'] );
-                       $this->assertEquals( 7, strlen( $version ), "$moduleName must use ResourceLoader::makeHash" );
-               }
-       }
-
        /**
         * Verify that all modules specified as dependencies of other modules actually
         * exist and are not illegal.