3 years agoMerge "mediawiki.loader: Clean up unit tests"
jenkins-bot [Tue, 17 Apr 2018 18:34:19 +0000 (18:34 +0000)]
Merge "mediawiki.loader: Clean up unit tests"

3 years agoMerge "mw.widgets.UsersMultiselectWidget: Compat with mw.special.preferences.confirmC...
jenkins-bot [Tue, 17 Apr 2018 15:55:08 +0000 (15:55 +0000)]
Merge "mw.widgets.UsersMultiselectWidget: Compat with mw.special.preferences.confirmClose"

3 years agoMerge "mw.special.preferences.confirmClose: Handle textareas"
jenkins-bot [Tue, 17 Apr 2018 15:50:38 +0000 (15:50 +0000)]
Merge "mw.special.preferences.confirmClose: Handle textareas"

3 years agoMerge "RCFilters: Prevent trigger element movement"
jenkins-bot [Tue, 17 Apr 2018 15:44:56 +0000 (15:44 +0000)]
Merge "RCFilters: Prevent trigger element movement"

3 years agoMerge "Handle extension dependencies in the installer"
jenkins-bot [Tue, 17 Apr 2018 15:18:39 +0000 (15:18 +0000)]
Merge "Handle extension dependencies in the installer"

3 years agoMerge "resourceloader: Remove getHashMtime() and getDefinitionMtime() methods"
jenkins-bot [Tue, 17 Apr 2018 14:55:19 +0000 (14:55 +0000)]
Merge "resourceloader: Remove getHashMtime() and getDefinitionMtime() methods"

3 years agomw.widgets.UsersMultiselectWidget: Compat with mw.special.preferences.confirmClose
Bartosz Dziewoński [Tue, 17 Apr 2018 13:05:05 +0000 (15:05 +0200)]
mw.widgets.UsersMultiselectWidget: Compat with mw.special.preferences.confirmClose

Replace `<input type="hidden">` with a `<textarea>` hidden using
`display: none`, because the former does not have separate 'value'
and 'defaultValue' properties, and the Special:Preferences script to
enable/disable the "Save" button depends on them to work correctly.
We use a similar approach in OOUI (RadioSelectInputWidget).

Also correct a code comment (we need to trigger a 'change' event for
any kind of input, not just `<input type="hidden">`).

Bug: T192147
Change-Id: I2351bc752f9cf25a607f4b197c132062d52ecb1e

3 years agomw.special.preferences.confirmClose: Handle textareas
Bartosz Dziewoński [Tue, 17 Apr 2018 13:11:59 +0000 (15:11 +0200)]
mw.special.preferences.confirmClose: Handle textareas

Bug: T192147
Change-Id: Ie02c5d8cab7db091054f7d66633c6ec34354ee19

3 years agoRCFilters: Prevent trigger element movement
Volker E [Tue, 17 Apr 2018 04:20:39 +0000 (21:20 -0700)]
RCFilters: Prevent trigger element movement

Change-Id: Ic04229ade53a42a47ccbd909640b848cf9979eb1

3 years agoUse module.exports for mediawiki.libs.jpegmeta
Fomafix [Fri, 16 Feb 2018 10:36:59 +0000 (11:36 +0100)]
Use module.exports for mediawiki.libs.jpegmeta

Deprecate mw.libs.jpegmeta. Use
  mw.loader.require( 'mediawiki.libs.jpegmeta' )

Change-Id: I8a7fb7377248a2ce1cf9c6d3c888ca9835cadaad

3 years agoresourceloader: Remove getHashMtime() and getDefinitionMtime() methods
Timo Tijhof [Tue, 17 Apr 2018 00:42:00 +0000 (01:42 +0100)]
resourceloader: Remove getHashMtime() and getDefinitionMtime() methods

Deprecated since 1.26, no callers or implementors in Wikimedia Git.

Change-Id: Ie44b4be47db7a4799fe39d66294c41238c62f51f

3 years agoresourceloader: Add @covers for covered deprecated methods
Timo Tijhof [Tue, 17 Apr 2018 00:40:48 +0000 (01:40 +0100)]
resourceloader: Add @covers for covered deprecated methods

These are deprecated for extensions to implement, but still
supported and already triggered by the test cases. Previously
not mentioned because they were ignored by PHPUnit, but not anymore.

Change-Id: I594788e322bfd83be1e7847d3272d57c549f3e8b

3 years agoMerge "resourceloader: Clean up CSSMinTest"
jenkins-bot [Mon, 16 Apr 2018 22:58:47 +0000 (22:58 +0000)]
Merge "resourceloader: Clean up CSSMinTest"

3 years agoresourceloader: Clean up CSSMinTest
Timo Tijhof [Mon, 16 Apr 2018 22:05:46 +0000 (23:05 +0100)]
resourceloader: Clean up CSSMinTest

* Consistently name data providers as "provide.." and make them

* Document why wgServer is being mocked.

* Use TestingAccessWrapper instead of ad-hoc sub class for
  accessing protected methods.

Change-Id: Ife2d98091200bbc8fb16b7ac6eafd3f2c22c1463

3 years agordbms: add $flags argument to ILoadBalancer::getAnyOpenConnection
Aaron Schulz [Thu, 5 Apr 2018 02:44:21 +0000 (19:44 -0700)]
rdbms: add $flags argument to ILoadBalancer::getAnyOpenConnection

Make LoadMonitor use this flag for getting a connection.

Change-Id: I32ea9aadc0223c86db5979d6579d781a6af0ff53

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Mon, 16 Apr 2018 19:55:08 +0000 (21:55 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: Id2377abe03165cfbdf22d0417471efa18af02cde

3 years agoRestrict shell commands by default
Max Semenik [Sat, 6 Jan 2018 12:41:37 +0000 (15:41 +0300)]
Restrict shell commands by default

Before it's too late, let's boil the oceans
and just do it. This patch assumes that old code
calling wfShellExec() doesn't know about restrictions
so it doesn't restrict anything. New code, however,
needs to specify its restrictions or deal with defaults.

Change-Id: I58963901087202d4a405bcdb6bd12758bb6b0ff7

3 years agoMerge "Deprecate wfShellWikiCmd()"
jenkins-bot [Mon, 16 Apr 2018 16:57:14 +0000 (16:57 +0000)]
Merge "Deprecate wfShellWikiCmd()"

3 years agoMerge "Title: Simplify use of MWNamespace::getCanonicalName()"
jenkins-bot [Mon, 16 Apr 2018 16:55:43 +0000 (16:55 +0000)]
Merge "Title: Simplify use of MWNamespace::getCanonicalName()"

3 years agoDeprecate wfShellWikiCmd()
Max Semenik [Fri, 19 Jan 2018 01:44:03 +0000 (17:44 -0800)]
Deprecate wfShellWikiCmd()

Bug: T184339

Change-Id: Ic86a451e0e9d609e06865a4969560d151efa844c

3 years agoUpdate wikimedia/utfnormal to 2.0.0
Kunal Mehta [Mon, 16 Apr 2018 07:06:56 +0000 (00:06 -0700)]
Update wikimedia/utfnormal to 2.0.0

Bug: T188480
Depends-On: I6dc14850ba4dfb0ba237b68337b6a86768739b5b
Change-Id: I5f1fc27d5bb588c15cabb7f1c909c104f6325e96

3 years agoMerge "Remove gadget special-case from preferences cleanup"
jenkins-bot [Mon, 16 Apr 2018 03:06:05 +0000 (03:06 +0000)]
Merge "Remove gadget special-case from preferences cleanup"

3 years agoMerge "rdbms: make LoadBalancer::doWait() cast $timeout to an integer"
jenkins-bot [Mon, 16 Apr 2018 01:01:21 +0000 (01:01 +0000)]
Merge "rdbms: make LoadBalancer::doWait() cast $timeout to an integer"

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sun, 15 Apr 2018 20:08:59 +0000 (22:08 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I8ef3d6d1aaef6a49e92ace4fa3581c17fec2f894

3 years agoMerge "tests: Support passing null to setExpectedException() in compat layer"
jenkins-bot [Sun, 15 Apr 2018 18:48:10 +0000 (18:48 +0000)]
Merge "tests: Support passing null to setExpectedException() in compat layer"

3 years agoMerge "Add release notes for 036f5b47efc99"
jenkins-bot [Sun, 15 Apr 2018 18:41:32 +0000 (18:41 +0000)]
Merge "Add release notes for 036f5b47efc99"

3 years agoMerge "Add release notes for 8de958444f1d36"
jenkins-bot [Sun, 15 Apr 2018 18:38:47 +0000 (18:38 +0000)]
Merge "Add release notes for 8de958444f1d36"

3 years agoMerge "phan: Provide stub for wikidiff2_inline_diff()"
jenkins-bot [Sun, 15 Apr 2018 08:44:34 +0000 (08:44 +0000)]
Merge "phan: Provide stub for wikidiff2_inline_diff()"

3 years agotests: Support passing null to setExpectedException() in compat layer
Kunal Mehta [Sat, 14 Apr 2018 23:10:24 +0000 (16:10 -0700)]
tests: Support passing null to setExpectedException() in compat layer

PHPUnit 4's setExpectedException() accepted null for the exception class
name to indicate that no exception would be thrown. PHPUnit 6's
expectException() is stricter and only allows strings.

Change-Id: I8c8783faec808a8f111af2ee533f5c61feccf099

3 years agoAdd release notes for 036f5b47efc99
Kunal Mehta [Sat, 14 Apr 2018 23:00:28 +0000 (16:00 -0700)]
Add release notes for 036f5b47efc99

Change-Id: Ia25937b3308ed1caeae9e4a5510648c7f6e19586

3 years agoAdd release notes for 8de958444f1d36
Kunal Mehta [Sat, 14 Apr 2018 22:40:30 +0000 (15:40 -0700)]
Add release notes for 8de958444f1d36

Change-Id: I5adc2758ca5e61a291139fc4b4a08d686601f285

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Sat, 14 Apr 2018 19:55:19 +0000 (21:55 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I1d1d9da19da9f5a9b282d957232c3adea9219e4d

3 years agophan: Provide stub for wikidiff2_inline_diff()
Kunal Mehta [Sat, 14 Apr 2018 10:54:12 +0000 (03:54 -0700)]
phan: Provide stub for wikidiff2_inline_diff()

Needed by MobileFrontend

Change-Id: I5c6dfae873b5292f26652631943d42de08df49b3

3 years agordbms: make LoadBalancer::doWait() cast $timeout to an integer
Aaron Schulz [Thu, 29 Mar 2018 02:42:31 +0000 (19:42 -0700)]
rdbms: make LoadBalancer::doWait() cast $timeout to an integer

Make sure that fractional values are not sent to masterPosWait()

Change-Id: I0a66471d4bf7005774b5741702c7f9c65bbfd5d0

3 years agoMerge "Use constants for rc_patrolled values instead of numbers"
jenkins-bot [Sat, 14 Apr 2018 02:39:33 +0000 (02:39 +0000)]
Merge "Use constants for rc_patrolled values instead of numbers"

3 years agoMerge "Add an "editor" extension type"
jenkins-bot [Sat, 14 Apr 2018 02:27:05 +0000 (02:27 +0000)]
Merge "Add an "editor" extension type"

3 years agoMerge "selenium: Remove Jenkins configuration file"
Krinkle [Sat, 14 Apr 2018 00:11:56 +0000 (00:11 +0000)]
Merge "selenium: Remove Jenkins configuration file"

3 years agoMerge "Selenium: move logic for running tests from package.json to selenium.sh"
Krinkle [Sat, 14 Apr 2018 00:11:51 +0000 (00:11 +0000)]
Merge "Selenium: move logic for running tests from package.json to selenium.sh"

3 years agoMerge "Remove unused $titleObj"
jenkins-bot [Fri, 13 Apr 2018 23:20:08 +0000 (23:20 +0000)]
Merge "Remove unused $titleObj"

3 years agoMerge "LoadBalancerTest: Clean up transaction handling for sqlite"
jenkins-bot [Fri, 13 Apr 2018 22:45:57 +0000 (22:45 +0000)]
Merge "LoadBalancerTest: Clean up transaction handling for sqlite"

3 years agoMerge "Fix testGetMap_twoValues() failures for sqlite"
jenkins-bot [Fri, 13 Apr 2018 22:42:03 +0000 (22:42 +0000)]
Merge "Fix testGetMap_twoValues() failures for sqlite"

3 years agoAdd an "editor" extension type
Kunal Mehta [Fri, 13 Apr 2018 22:35:07 +0000 (15:35 -0700)]
Add an "editor" extension type

For extensions that provide an editor or enhance the editing experience.

Extensions like CodeEditor, WikiEditor, or VisualEditor could use this type.

Change-Id: Id5714caa492f10b97ea272c2ec181cded60fc47f

3 years agoHandle extension dependencies in the installer
Kunal Mehta [Sun, 8 Apr 2018 23:26:01 +0000 (16:26 -0700)]
Handle extension dependencies in the installer

As there will likely be extensions bundled with the 1.31 release that
depend upon other extensions, we should have the installer prevent users
from enabling extensions that depend on other, not-enabled extensions.

We can build a dependency map from extension.json's "requires"
component. On the client-side, we'll first disable all checkboxes that
require other extensions, and evaluate each checkbox click, updating the
disabled checkboxes as possible.

This required some refactoring of how ExtensionRegistry reports issues
with dependency resolution so we could get a list of what was missing.

While we're at it, sort the extensions under headings by type.

This does not support skins that have dependencies yet (T186092).

Bug: T31134
Bug: T55985
Change-Id: I5f0e3b1b540b5ef6f9b8e3fc2bbaad1c65b4b680

3 years agoUse constants for rc_patrolled values instead of numbers
Amir Sarabadani [Fri, 13 Apr 2018 21:36:34 +0000 (23:36 +0200)]
Use constants for rc_patrolled values instead of numbers

These are recently introduced, better to use them

Change-Id: Id904ff09081cb5a1fe2f1c24c5d415da18fd2294

3 years agoMerge "Remove the feature switch for disabling autopatrol logging"
jenkins-bot [Fri, 13 Apr 2018 21:27:38 +0000 (21:27 +0000)]
Merge "Remove the feature switch for disabling autopatrol logging"

3 years agoMerge "Remove old hacks in StringUtils::isUtf8()"
jenkins-bot [Fri, 13 Apr 2018 21:17:20 +0000 (21:17 +0000)]
Merge "Remove old hacks in StringUtils::isUtf8()"

3 years agoFix testGetMap_twoValues() failures for sqlite
Aaron Schulz [Fri, 13 Apr 2018 21:16:39 +0000 (14:16 -0700)]
Fix testGetMap_twoValues() failures for sqlite

Change-Id: I3f42208d8e42ba923d4b08bb7efe15f871165899

3 years agoselenium: Remove Jenkins configuration file
Željko Filipin [Sat, 7 Apr 2018 13:56:56 +0000 (15:56 +0200)]
selenium: Remove Jenkins configuration file

Both Mocha and Cucumber tests should run. Since WebdriverIO supports only
running one test framework, the only way to do it is to have a generic
configuration file and two framework-specific files (Mocha, Cucumber). Having
Jenkins configuration file complicates things, and there is no need for

Bug: T179190
Change-Id: I710066f7b5479dcad27aa57cd61007c1c2d88931

3 years agoRemove the feature switch for disabling autopatrol logging
Amir Sarabadani [Thu, 12 Apr 2018 19:03:44 +0000 (21:03 +0200)]
Remove the feature switch for disabling autopatrol logging

Per the RFC, it will now become the default and only behaviour
to not log autpatrol actions. The information is already
recorded via the rc_patrolled field.

Bug: T184485
Change-Id: I98ae895a2b4cde4bb945f1df23be4a070b0bf9c4

3 years agoMerge "OOUI: Apex: Point pending.gif texture to a directory that exists"
jenkins-bot [Fri, 13 Apr 2018 20:10:36 +0000 (20:10 +0000)]
Merge "OOUI: Apex: Point pending.gif texture to a directory that exists"

3 years agoRemove old hacks in StringUtils::isUtf8()
Max Semenik [Fri, 13 Apr 2018 20:02:50 +0000 (13:02 -0700)]
Remove old hacks in StringUtils::isUtf8()

We don't support any of the affected PHP or HHVM versions.

Change-Id: I22a9252e621b519147168fab3197662c30131e71

3 years agoOOUI: Apex: Point pending.gif texture to a directory that exists
Kunal Mehta [Fri, 13 Apr 2018 19:54:46 +0000 (12:54 -0700)]
OOUI: Apex: Point pending.gif texture to a directory that exists

This is a manual cherry-pick of I6ad0ce9d62245255e.

Bug: T192173
Change-Id: I74374c49407dcb789ef8a9219158a9a773c09d81

3 years agoLocalisation updates from https://translatewiki.net.
Translation updater bot [Fri, 13 Apr 2018 19:53:54 +0000 (21:53 +0200)]
Localisation updates from https://translatewiki.net.

Change-Id: I0576df03594cb55e93ba4414c9deb0749063e904

3 years agoMerge "Allow PHPUnit 6 optionally in require-dev"
jenkins-bot [Fri, 13 Apr 2018 17:59:57 +0000 (17:59 +0000)]
Merge "Allow PHPUnit 6 optionally in require-dev"

3 years agoLoadBalancerTest: Clean up transaction handling for sqlite
Brad Jorsch [Fri, 13 Apr 2018 17:32:48 +0000 (13:32 -0400)]
LoadBalancerTest: Clean up transaction handling for sqlite

We need to make sure a DBO_TRX transaction was started before doing the
CREATE TABLE, because CREATE TABLE itself won't start one and sqlite
breaks if schema changes are done on one handle while another is open.

Also, incidentally, have the handles in these LoadBalancerTests log to
the standard channel. And clean up the auto-rollback of DBO_TRX
transactions to use ->rollback() instead of ->doRollback() plus
incorrect manual setting of trxStatus.

Bug: T191863
Change-Id: Ib422ef89e7eba21281e6ea98def9f98ae762b9fe

3 years agoMerge "Reset table sequences and skip some test assertions for sqlite"
jenkins-bot [Fri, 13 Apr 2018 16:36:02 +0000 (16:36 +0000)]
Merge "Reset table sequences and skip some test assertions for sqlite"

3 years agoMerge "rdbms: make $i in LoadBalancer::getConnection override $groups"
jenkins-bot [Fri, 13 Apr 2018 16:30:37 +0000 (16:30 +0000)]
Merge "rdbms: make $i in LoadBalancer::getConnection override $groups"

3 years agoSelenium: move logic for running tests from package.json to selenium.sh
Željko Filipin [Sat, 7 Apr 2018 14:35:26 +0000 (16:35 +0200)]
Selenium: move logic for running tests from package.json to selenium.sh

Just running `npm run selenium` in CI does not work. If WebdriverIO fails, the
job still passes since the last command to run is  `killall chromedriver`.
Reusing the script from CI that starts and stops Chromedriver should fix the

Bug: T179190
Change-Id: If29227263d23a3e4f26e2329dfa13c49f976cf8e

3 years agoMerge "Display PHP version in old version error messages"
jenkins-bot [Fri, 13 Apr 2018 13:10:43 +0000 (13:10 +0000)]
Merge "Display PHP version in old version error messages"

3 years agoMerge "CSSMin::serializeStringValue: Update implementation to new specification"
jenkins-bot [Fri, 13 Apr 2018 12:30:30 +0000 (12:30 +0000)]
Merge "CSSMin::serializeStringValue: Update implementation to new specification"

3 years agoDisplay PHP version in old version error messages
Reedy [Fri, 13 Apr 2018 11:32:55 +0000 (11:32 +0000)]
Display PHP version in old version error messages

Change-Id: I3a6135871de0fdc94fa3fe622c6534746035a209

3 years agoMake ImageGallery more flexible for use in Wikibase
Marius Hoch [Fri, 13 Apr 2018 10:45:32 +0000 (12:45 +0200)]
Make ImageGallery more flexible for use in Wikibase

Also add missing declaration/ documentation of

Bug: T46727
Change-Id: I314061b224ff2921eb5532be53e0c9cdc4f52c01

3 years agoReset table sequences and skip some test assertions for sqlite
Aaron Schulz [Fri, 13 Apr 2018 08:39:22 +0000 (01:39 -0700)]
Reset table sequences and skip some test assertions for sqlite

Various revision storage tests assume the sequences are reset
and fail otherwise.

Also disable some failing tests that are not applicable to sqlite
as well as postgres.

Change-Id: Ibdb034121a44e16bb35059a92baafb1867951ea8

3 years agoRemove unused $titleObj
Reedy [Fri, 13 Apr 2018 08:56:43 +0000 (08:56 +0000)]
Remove unused $titleObj

Change-Id: I77d302deb35d8269d15ae4b1e614090000e84683

3 years agoCSSMin::serializeStringValue: Update implementation to new specification
Fomafix [Wed, 11 Apr 2018 04:23:50 +0000 (06:23 +0200)]
CSSMin::serializeStringValue: Update implementation to new specification

The current version of https://www.w3.org/TR/cssom/ is

The new specification for CSS string serialization
has some changes compared to the old specification
* U+0000 get replaced by the REPLACEMENT CHARACTER (U+FFFD) instead of
  throwing an exception.
* U+0080 to U+009F are not escaped.

The old implementation has a bug because it selects the byte range
[\x7f-\x9f] and not unicode codepoint range [\u007f-\u009f]. This
breaks the encoding because CSS is in UTF-8 not in ISO 8859-x.

Also add tests to cover CSSMin::serializeStringValue.

Bug: T192048
Change-Id: I894824c216b95dbba461308488fba33121ffea54

3 years agoAllow PHPUnit 6 optionally in require-dev
Reedy [Sun, 3 Dec 2017 14:49:31 +0000 (14:49 +0000)]
Allow PHPUnit 6 optionally in require-dev

MediaWiki uses a back-compat layer to preserve most of the PHPUnit 4
runtime, so existing tests will continue to run fine with minimal
modification. Once PHP < 7.0 support is dropped, we can drop PHPUnit 4
support, and adapt tests to use PHPUnit 6 features directly.

Bug: T177132
Depends-On: I884b240307e3fcad253aa64eeae9944ed4eb7d50
Change-Id: I497712c7693d137be197a69873baa58383ce9646

3 years agoMerge "Add HamcrestPHPUnitIntegration trait"
jenkins-bot [Fri, 13 Apr 2018 03:36:32 +0000 (03:36 +0000)]
Merge "Add HamcrestPHPUnitIntegration trait"

3 years agoMerge "Default installations to using RemexHtml for tidying"
jenkins-bot [Fri, 13 Apr 2018 03:36:24 +0000 (03:36 +0000)]
Merge "Default installations to using RemexHtml for tidying"

3 years agoAdd HamcrestPHPUnitIntegration trait
Kunal Mehta [Fri, 13 Apr 2018 02:52:05 +0000 (19:52 -0700)]
Add HamcrestPHPUnitIntegration trait

Hamcrest has its own assertThat() function, which is used in PHPUnit
tests. However, in PHPUnit 6, tests that don't have any assertions are
marked as risky.

To work around that, add a HamcrestPHPUnitIntegration trait that
provides a $this->assertThatHamcrest() - it wraps around Hamcrest's
assertThat(), and increments PHPUnit's assertion counter, so using it
ensures that the test is not risky.

Change-Id: Ia4a4ec226f64ebe90d1091ffd27420a356ca76ff

3 years agoMerge "Selenium: pass -no-sandbox to Chrome under Docker"
jenkins-bot [Fri, 13 Apr 2018 01:43:36 +0000 (01:43 +0000)]
Merge "Selenium: pass -no-sandbox to Chrome under Docker"

3 years agomediawiki.loader: Clean up unit tests
Timo Tijhof [Fri, 13 Apr 2018 00:49:43 +0000 (01:49 +0100)]
mediawiki.loader: Clean up unit tests

* Avoid parenthesis in module name to make it easier to remember
  and type. Use "mediawiki.loader", which matches the naming for
  other mediawiki.js tests (e.g, 'mediawiki.html').

* Simplify teardown: Remove redundant check before deletion.
  The delete operator already performs this check and varies it
  returns value based on it (which we aren't using here).

* Remove 'Basic', which did the same as 'using() Promise'.

* Add test for 'using(, callback)' parameter.

* Simplify "did the script run" assertions by checking once
  afterwards, instead of checking both during the test and afterwards.
  The one during the test isn't a strict assertion, given it could
  be skipped. To preserve the detection of whether it ran twice,
  use a counter.

* Remove various redundant 'fail' assertions from Promise fail
  handlers in tests that were already returning said Promise,
  given QUnit already checks if the Promise is rejected.

* Simplify a few assert captions.

* Make assertion for 'messages load first' its own test,
  instead of happening in an unrelated test about @import CSS.

Change-Id: Icbb4ea7f16bb1f702fd92eb8007b7179d4763151

3 years agoMediaWikiServicesTest::testDisableStorageBackend: Make PHPUnit6 happy
James D. Forrester [Thu, 12 Apr 2018 20:58:31 +0000 (13:58 -0700)]
MediaWikiServicesTest::testDisableStorageBackend: Make PHPUnit6 happy

Ugly, but it works.

Bug: T191678
Change-Id: I0436034370dd66191990aa195ee3bdf5cd638e76

3 years agoMake WatchedItemStoreUnitTest compatible with PHPUnit 6
Kunal Mehta [Thu, 12 Apr 2018 20:18:39 +0000 (13:18 -0700)]
Make WatchedItemStoreUnitTest compatible with PHPUnit 6

A few tests were mocking the wrong object due to a typo, so have those
mock the correct object, and update the tests to reflect reality.

Change-Id: Ifd1e4ae8a98124b9055ec4023382305f743f9b43

3 years agoMerge "Replace rc_patrolled values with contants, part I"
jenkins-bot [Thu, 12 Apr 2018 20:56:54 +0000 (20:56 +0000)]
Merge "Replace rc_patrolled values with contants, part I"

3 years agordbms: make $i in LoadBalancer::getConnection override $groups
Aaron Schulz [Thu, 12 Apr 2018 20:15:34 +0000 (13:15 -0700)]
rdbms: make $i in LoadBalancer::getConnection override $groups

Previously, passing a specific server index (even the master index)
would result in a connection to some server in $groups or the generic
read group being selected.

Change-Id: Ifb497f5f4bb61f16b310d4d30fb8315e3bcdce8e

3 years agoMerge "Make BatchRowUpdateTest compatible with PHPUnit 6"
jenkins-bot [Thu, 12 Apr 2018 20:42:52 +0000 (20:42 +0000)]
Merge "Make BatchRowUpdateTest compatible with PHPUnit 6"

3 years agoMerge "rdbms: rename CONN_TRX_AUTO constant to CONN_TRX_AUTOCOMMIT"
jenkins-bot [Thu, 12 Apr 2018 20:38:58 +0000 (20:38 +0000)]
Merge "rdbms: rename CONN_TRX_AUTO constant to CONN_TRX_AUTOCOMMIT"

3 years agoMake BatchRowUpdateTest compatible with PHPUnit 6
Kunal Mehta [Thu, 12 Apr 2018 19:51:10 +0000 (12:51 -0700)]
Make BatchRowUpdateTest compatible with PHPUnit 6

Explicitly declare all the methods that will be mocked. Also
testReaderBasicIterate needs to mock addQuotes as well, so use the
mockDbConsecutiveSelect() function that already takes care of that.

Change-Id: Ic02253cf25758124f320d0b46e0b1d43195c4bc0

3 years agordbms: rename CONN_TRX_AUTO constant to CONN_TRX_AUTOCOMMIT
Aaron Schulz [Wed, 4 Apr 2018 23:29:18 +0000 (16:29 -0700)]
rdbms: rename CONN_TRX_AUTO constant to CONN_TRX_AUTOCOMMIT

The "AUTO" means AUTOCOMMIT, not "automatic transactions"/DBO_TRX,
which is basically the opposite concept. The new name does not
suffer from that ambiguity.

Keep the old constant as an alias for backwards compatibility.

Also remove LoadBalancer comment about non-existing field

Change-Id: I63beeb061fc9be73f320308e4d6393b58628b8c8

3 years agoMerge "Test ApiUserrights"
jenkins-bot [Thu, 12 Apr 2018 19:54:51 +0000 (19:54 +0000)]
Merge "Test ApiUserrights"

3 years agoMerge "AuthManagerTest: Fix for PHPUnit 6"
jenkins-bot [Thu, 12 Apr 2018 19:18:27 +0000 (19:18 +0000)]
Merge "AuthManagerTest: Fix for PHPUnit 6"

3 years agoMerge "maintenance: Document secondary purpose of --server"
jenkins-bot [Thu, 12 Apr 2018 18:56:42 +0000 (18:56 +0000)]
Merge "maintenance: Document secondary purpose of --server"

3 years agoTest ApiUserrights
Aryeh Gregor [Mon, 9 Apr 2018 18:38:09 +0000 (21:38 +0300)]
Test ApiUserrights

Fixed bug: in PHP versions less than 5.6.0, any request that didn't
attempt to add any groups would warn, because it would call array_fill()
with the second argument (num) equal to 0.  From PHP 5.6.0, the num
argument to array_fill() is allowed to be 0.

Change-Id: I0c5772f15d8f550dc43fb37c3c58d15dd73ea584

3 years agoMerge "Use PHPUnit 4/6 compat in VersionCheckerTest"
jenkins-bot [Thu, 12 Apr 2018 18:01:59 +0000 (18:01 +0000)]
Merge "Use PHPUnit 4/6 compat in VersionCheckerTest"

3 years agoMerge "Fix KafkaHandlerTest hack to work with PHPUnit 6"
jenkins-bot [Thu, 12 Apr 2018 18:01:56 +0000 (18:01 +0000)]
Merge "Fix KafkaHandlerTest hack to work with PHPUnit 6"

3 years agoAuthManagerTest: Fix for PHPUnit 6
Brad Jorsch [Thu, 12 Apr 2018 17:25:19 +0000 (13:25 -0400)]
AuthManagerTest: Fix for PHPUnit 6

PHPUnit 6 apparently needs methods explicitly declared as mockable in
some cases where PHPUnit 4 didn't, specifically
'providerAllowsAuthenticationDataChange' in testGetAuthenticationRequests.

That also means we need to remove the (fortunately unnecessary) forcing
of the mocked class name in there, or else it reuses the generic
configuration created under that name for earlier tests.

For good measure, let's also remove the mocked class name forcing from
several other places where it isn't needed (but was presumably
copy-pasted from the places where it was).

Change-Id: If12ed836c7e47797f20deb0bdaa3ea852a921069

3 years agoMerge "ApiMainTest: Fix typo"
jenkins-bot [Thu, 12 Apr 2018 17:12:46 +0000 (17:12 +0000)]
Merge "ApiMainTest: Fix typo"

3 years agoMerge "Update User::getOption() PHPDoc"
jenkins-bot [Thu, 12 Apr 2018 17:11:16 +0000 (17:11 +0000)]
Merge "Update User::getOption() PHPDoc"

3 years agoMerge "Deprecate DO_MAINTENANCE"
jenkins-bot [Thu, 12 Apr 2018 17:07:41 +0000 (17:07 +0000)]
Merge "Deprecate DO_MAINTENANCE"

3 years agoApiMainTest: Fix typo
Brad Jorsch [Thu, 12 Apr 2018 17:00:35 +0000 (13:00 -0400)]
ApiMainTest: Fix typo

The mock wants to mock getRawIP, not getIP.

Change-Id: Id7febba6ba6a6762ebdd273fc882330c65882cd6

3 years agoUse PHPUnit 4/6 compat in VersionCheckerTest
Kunal Mehta [Thu, 12 Apr 2018 16:49:27 +0000 (09:49 -0700)]
Use PHPUnit 4/6 compat in VersionCheckerTest

Change-Id: Idff5d83ce20262b159c00722301e519590e80d66

3 years agoFix KafkaHandlerTest hack to work with PHPUnit 6
Kunal Mehta [Thu, 12 Apr 2018 16:41:20 +0000 (09:41 -0700)]
Fix KafkaHandlerTest hack to work with PHPUnit 6

Change-Id: I2b2ae31b327976c7c6ba72a49f1d7d068e234928

3 years agoMerge "Fix LocalFileMoveBatch query that was incompatibile with Postgres"
jenkins-bot [Thu, 12 Apr 2018 16:46:06 +0000 (16:46 +0000)]
Merge "Fix LocalFileMoveBatch query that was incompatibile with Postgres"

3 years agoDeprecate DO_MAINTENANCE
Kunal Mehta [Thu, 12 Apr 2018 16:44:51 +0000 (09:44 -0700)]

This has been replaced by RUN_MAINTENANCE_IF_MAIN for quite a while now,
but never officially deprecated.

The main motiviation for this is that tools like CodeSniffer have been
using RUN_MAINTENANCE_IF_MAIN to detect whether a file is a maintenance
script, and missed files that used the old constant.

Change-Id: Iebbe1ecaa7157ba22ebcac9c481592e09410a9f5

3 years agoUpdate User::getOption() PHPDoc
Kunal Mehta [Thu, 12 Apr 2018 16:42:14 +0000 (09:42 -0700)]
Update User::getOption() PHPDoc

The default value could be an array, as is used in Echo.

Change-Id: I90f1d4821ec544cfba9ad48bd1a44f8bb8275317

3 years agojquery.makeCollapsible: Use pseudo elements for square brackets around toggle
jdlrobson [Wed, 4 Apr 2018 23:12:38 +0000 (16:12 -0700)]
jquery.makeCollapsible: Use pseudo elements for square brackets around toggle

We want to use this in Minerva and mixing presentation with functionality
makes styling it differently difficult.

This change will also make it easier to deal with the reflow on
initialisation (see follow up If9c8f0974e3a4b08e4a66d37f7f5adf67d7305).

Change-Id: I4d96226c63563f16ad181e06f6bd12e6cf6bec67

3 years agoMerge "Improve test coverage for ApiParse"
jenkins-bot [Thu, 12 Apr 2018 16:27:03 +0000 (16:27 +0000)]
Merge "Improve test coverage for ApiParse"

3 years agoMerge "ParserTestRunner: Reset InterwikiLookup service"
jenkins-bot [Thu, 12 Apr 2018 16:25:16 +0000 (16:25 +0000)]
Merge "ParserTestRunner: Reset InterwikiLookup service"

3 years agoMerge "RCFilters: Convert patrolled filter to three states"
jenkins-bot [Thu, 12 Apr 2018 16:07:07 +0000 (16:07 +0000)]
Merge "RCFilters: Convert patrolled filter to three states"

3 years agoMerge "Remove checkIcon from TitleOptionWidget"
jenkins-bot [Thu, 12 Apr 2018 15:50:08 +0000 (15:50 +0000)]
Merge "Remove checkIcon from TitleOptionWidget"