Merge "Rename ApiTestCaseUpload"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 18 Mar 2018 04:06:05 +0000 (04:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 18 Mar 2018 04:06:05 +0000 (04:06 +0000)
includes/api/ApiQuerySiteinfo.php
includes/libs/rdbms/database/Database.php
resources/src/mediawiki.legacy/commonPrint.css
resources/src/mediawiki.legacy/oldshared.css
resources/src/mediawiki.legacy/shared.css
resources/src/mediawiki.skinning/content.css
resources/src/mediawiki/mediawiki.toc.print.css
tests/phpunit/includes/libs/IPTest.php
tests/selenium/wdio.conf.beta.js [new file with mode: 0644]

index f924736..3048273 100644 (file)
@@ -465,7 +465,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                'host' => $showHostnames
                                                ? $lb->getServerName( $index )
                                                : '',
-                               'lag' => intval( $lag )
+                               'lag' => $lag
                        ];
                }
 
index 53cf55c..97ea266 100644 (file)
@@ -1590,17 +1590,12 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        public function estimateRowCount(
                $table, $vars = '*', $conds = '', $fname = __METHOD__, $options = [], $join_conds = []
        ) {
-               $rows = 0;
                $res = $this->select(
                        $table, [ 'rowcount' => 'COUNT(*)' ], $conds, $fname, $options, $join_conds
                );
+               $row = $res ? $this->fetchRow( $res ) : [];
 
-               if ( $res ) {
-                       $row = $this->fetchRow( $res );
-                       $rows = ( isset( $row['rowcount'] ) ) ? (int)$row['rowcount'] : 0;
-               }
-
-               return $rows;
+               return isset( $row['rowcount'] ) ? (int)$row['rowcount'] : 0;
        }
 
        public function selectRowCount(
@@ -2204,9 +2199,9 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        if ( is_array( $table ) ) {
                                // A parenthesized group
                                if ( count( $table ) > 1 ) {
-                                       $joinedTable = '('
-                                               . $this->tableNamesWithIndexClauseOrJOIN( $table, $use_index, $ignore_index, $join_conds )
-                                               . ')';
+                                       $joinedTable = '(' .
+                                               $this->tableNamesWithIndexClauseOrJOIN(
+                                                       $table, $use_index, $ignore_index, $join_conds ) . ')';
                                } else {
                                        // Degenerate case
                                        $innerTable = reset( $table );
@@ -2364,7 +2359,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        }
                }
 
-               return ' LIKE ' . $this->addQuotes( $s ) . ' ESCAPE ' . $this->addQuotes( $escapeChar ) . ' ';
+               return ' LIKE ' .
+                       $this->addQuotes( $s ) . ' ESCAPE ' . $this->addQuotes( $escapeChar ) . ' ';
        }
 
        public function anyChar() {
index df5aa0f..64870fd 100644 (file)
@@ -166,7 +166,6 @@ ul {
        margin: 0 !important; /* stylelint-disable-line declaration-no-important */
 }
 
-#toc,
 .toc {
        background-color: #f9f9f9;
        border: 1pt solid #aaa;
index 7b2d711..2572b52 100644 (file)
@@ -166,7 +166,6 @@ img {
        border: 0;
 }
 
-#toc,
 .toc {
        border: 1px solid #bba;
        background-color: #f7f8ff;
@@ -182,18 +181,15 @@ img {
 }
 
 /* CSS for backwards-compatibility with cached page renders and creative uses in wikitext */
-table#toc,
 table.toc {
        border-collapse: collapse;
 }
 
 /* Remove additional paddings inside table-cells that are not present in <div>s */
-table#toc td,
 table.toc td {
        padding: 0;
 }
 
-#toc h2,
 .toc h2 {
        display: inline;
        border: 0;
@@ -202,7 +198,6 @@ table.toc td {
        font-weight: bold;
 }
 
-#toc ul,
 .toc ul {
        list-style-type: none;
        list-style-image: none;
@@ -210,7 +205,6 @@ table.toc td {
        text-align: left;
 }
 
-#toc ul ul,
 .toc ul ul {
        margin: 0 0 0 2em;
 }
@@ -274,7 +268,7 @@ table.small {
        font-size: 100%;
 }
 
-/* use this instead of #toc for page content */
+/* use this instead of .toc for page content */
 .toccolours {
        border: 1px solid #aaa;
        background-color: #f9f9f9;
index e46c758..0f84ff1 100644 (file)
@@ -625,43 +625,31 @@ ol:lang( or ) li {
        list-style-type: oriya;
 }
 
-#toc ul,
 .toc ul {
        margin: 0.3em 0;
 }
 
 /* Correct directionality when page dir is different from site/user dir */
 /* @noflip */ .mw-content-ltr .toc ul,
-.mw-content-ltr #toc ul,
-.mw-content-rtl .mw-content-ltr .toc ul,
-.mw-content-rtl .mw-content-ltr #toc ul {
+.mw-content-rtl .mw-content-ltr .toc ul {
        text-align: left;
 }
 
 /* @noflip */ .mw-content-rtl .toc ul,
-.mw-content-rtl #toc ul,
-.mw-content-ltr .mw-content-rtl .toc ul,
-.mw-content-ltr .mw-content-rtl #toc ul {
+.mw-content-ltr .mw-content-rtl .toc ul {
        text-align: right;
 }
 
 /* @noflip */ .mw-content-ltr .toc ul ul,
-.mw-content-ltr #toc ul ul,
-.mw-content-rtl .mw-content-ltr .toc ul ul,
-.mw-content-rtl .mw-content-ltr #toc ul ul {
+.mw-content-rtl .mw-content-ltr .toc ul ul {
        margin: 0 0 0 2em;
 }
 
 /* @noflip */ .mw-content-rtl .toc ul ul,
-.mw-content-rtl #toc ul ul,
-.mw-content-ltr .mw-content-rtl .toc ul ul,
-.mw-content-ltr .mw-content-rtl #toc ul ul {
+.mw-content-ltr .mw-content-rtl .toc ul ul {
        margin: 0 2em 0 0;
 }
 
-#toc #toctitle,
-.toc #toctitle,
-#toc .toctitle,
 .toc .toctitle {
        direction: ltr;
 }
index 5ded184..890856a 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 /* Table of Contents */
-#toc,
 .toc,
 .mw-warning,
 .toccolours {
@@ -28,7 +27,6 @@
  * inline elements. In practice inline elements surrounding the TOC are uncommon enough that
  * this is an acceptable sacrifice.
  */
-#toc,
 .toc {
        display: inline-block;
        display: table;
 }
 
 /* CSS for backwards-compatibility with cached page renders and creative uses in wikitext */
-table#toc,
 table.toc {
        border-collapse: collapse;
 }
 
 /* Remove additional paddings inside table-cells that are not present in <div>s */
-table#toc td,
 table.toc td {
        padding: 0;
 }
 
-#toc h2,
 .toc h2 {
        display: inline;
        border: 0;
@@ -61,14 +56,10 @@ table.toc td {
        font-weight: bold;
 }
 
-#toc #toctitle,
-.toc #toctitle,
-#toc .toctitle,
 .toc .toctitle {
        text-align: center;
 }
 
-#toc ul,
 .toc ul {
        list-style-type: none;
        list-style-image: none;
@@ -77,7 +68,6 @@ table.toc td {
        text-align: left;
 }
 
-#toc ul ul,
 .toc ul ul {
        margin: 0 0 0 2em;
 }
index 6a75181..9702c82 100644 (file)
@@ -16,7 +16,7 @@ class IPTest extends PHPUnit\Framework\TestCase {
         * @covers IP::isIPAddress
         * @dataProvider provideInvalidIPs
         */
-       public function isNotIPAddress( $val, $desc ) {
+       public function testIsNotIPAddress( $val, $desc ) {
                $this->assertFalse( IP::isIPAddress( $val ), $desc );
        }
 
diff --git a/tests/selenium/wdio.conf.beta.js b/tests/selenium/wdio.conf.beta.js
new file mode 100644 (file)
index 0000000..8f5c2c7
--- /dev/null
@@ -0,0 +1,21 @@
+'use strict';
+const merge = require( 'deepmerge' ),
+       username = 'Selenium user',
+       wdioConf = require( './wdio.conf.js' );
+
+// Overwrite default settings
+exports.config = merge( wdioConf.config, {
+       username: process.env.MEDIAWIKI_USER === undefined ?
+               username :
+               process.env.MEDIAWIKI_USER,
+       password: process.env.MEDIAWIKI_PASSWORD,
+       baseUrl: (
+               process.env.MW_SERVER === undefined ?
+                       'https://en.wikipedia.beta.wmflabs.org:443' :
+                       process.env.MW_SERVER
+       ) + (
+               process.env.MW_SCRIPT_PATH === undefined ?
+                       '/w' :
+                       process.env.MW_SCRIPT_PATH
+       )
+} );