jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/405411 )

Change subject: Make tests pass.
......................................................................


Make tests pass.

Bug:T185372
Change-Id: I8e6a4095fefab6d0e49a915bb38460931fcc92b9
---
A Gruntfile.js
M includes/SpecialVersionCompare.php
A package.json
3 files changed, 41 insertions(+), 5 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..a45071e
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,21 @@
+/*jshint node:true */
+module.exports = function ( grunt ) {
+       grunt.loadNpmTasks( 'grunt-jsonlint' );
+       grunt.loadNpmTasks( 'grunt-banana-checker' );
+
+       grunt.initConfig( {
+               banana: {
+                       all: 'i18n/'
+               },
+               jsonlint: {
+                       all: [
+                               '**/*.json',
+                               '!node_modules/**',
+                               '!vendor/**'
+                       ]
+               }
+       } );
+
+       grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+       grunt.registerTask( 'default', 'test' );
+};
diff --git a/includes/SpecialVersionCompare.php 
b/includes/SpecialVersionCompare.php
index df61395..bf1fda3 100644
--- a/includes/SpecialVersionCompare.php
+++ b/includes/SpecialVersionCompare.php
@@ -48,15 +48,16 @@
                $htmlForm->prepareForm()->displayForm( false );
 
                if ( $url1 === '' && $url1 !== $url2 ) {
-                       $url1 = $GLOBALS['wgServer'] .  
$GLOBALS['wgScriptPath'] . '/api.php';
+                       $url1 = $GLOBALS['wgServer'] . $GLOBALS['wgScriptPath'] 
. '/api.php';
                } elseif ( $url2 === '' && $url1 !== $url2 ) {
-                       $url2 = $GLOBALS['wgServer'] .  
$GLOBALS['wgScriptPath'] . '/api.php';
+                       $url2 = $GLOBALS['wgServer'] . $GLOBALS['wgScriptPath'] 
. '/api.php';
                }
 
                if ( $url1 !== '' && $url2 !== '' ) {
                        $info1 = $this->getVersionInfo( $url1 );
                        if ( is_null( $info1 ) ) {
-                               $html = Html::openElement( 'p', [ 'class' => 
'error' ] ) .
+                               $html = Html::element( 'br' ) .
+                                       Html::openElement( 'p', [ 'class' => 
'error' ] ) .
                                        wfMessage( 'version-compare-url-error', 
$url1 )->text() .
                                        Html::closeElement( 'p' );
                                $output->addHTML( $html );
@@ -65,7 +66,8 @@
 
                        $info2 = $this->getVersionInfo( $url2 );
                        if ( is_null( $info2 ) ) {
-                               $html = Html::openElement( 'p', [ 'class' => 
'error' ] ) .
+                               $html = Html::element( 'br' ) .
+                                       Html::openElement( 'p', [ 'class' => 
'error' ] ) .
                                        wfMessage( 'version-compare-url-error', 
$url2 )->text() .
                                        Html::closeElement( 'p' );
                                $output->addHTML( $html );
@@ -81,7 +83,9 @@
                $json = [];
                $query =
                        
"?action=query&meta=siteinfo&siprop=general%7Cextensions%7Cskins&format=json";
-       $ret = @file_get_contents( $url . $query );
+               \MediaWiki\suppressWarnings();
+               $ret = file_get_contents( $url . $query );
+               \MediaWiki\restoreWarnings();
                if ( $ret === false ) {
                        return null;
                }
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..bcf5b13
--- /dev/null
+++ b/package.json
@@ -0,0 +1,11 @@
+{
+       "private": true,
+       "scripts": {
+               "test": "grunt test"
+       },
+       "devDependencies": {
+               "grunt": "1.0.1",
+               "grunt-banana-checker": "0.5.0",
+               "grunt-jsonlint": "1.1.0"
+       }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e6a4095fefab6d0e49a915bb38460931fcc92b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VersionCompare
Gerrit-Branch: master
Gerrit-Owner: Cicalese <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to