Commit graph

275 commits

Author SHA1 Message Date
Umherirrender
4a45ced42c build: Manage exclude pattern for Squiz.Scope.MethodScope
242 files with 1311 functions left, but split the exclude pattern to
files in root and the affected folders
That avoids new issues in already "clean" classes/folders

Change-Id: Iffccc381987081b17161481ca6c4371b7646af28
2019-12-09 19:15:58 +01:00
Umherirrender
844c6db2b6 Set method visibility on languages classes
Change-Id: I5db62d8243ce3abd7c442de10d6143de6dd1aad3
2019-12-09 16:37:38 +00:00
Umherirrender
a1f0be1c21 Use nullable type in function signature
Enable the sniff

Change-Id: I9fff860706b0ffb99bb9e78ff26d15bc7c87bdb4
2019-11-20 19:20:38 +01:00
Umherirrender
b4fe9c4bcc Set method visibility on maintenance scripts
Change-Id: I44c82fbe65e1d002803ce065df6563f06dd39cd4
2019-11-16 22:54:17 +00:00
Umherirrender
b1a38362f3 Add missing @param and @return to documentation
Using @see is not enough description

Enable the php sniffs for now, but skip /tests/ to fix it later.
That avoids new issues in future patch sets

Change-Id: I49cb341a2880bfaeefb6bbfbb1717051ea3a4b16
2019-11-13 17:26:55 +01:00
Timo Tijhof
0da1ecfd89 profiler: Remove ProfilerOutputDb and profileinfo.php entry point
Bug: T231366
Change-Id: I211c8192200d9af00914f9847608a6daf2898f91
2019-11-06 15:28:00 -05:00
Max Semenik
48a323f702 tests: Add explicit return type void to setUp() and tearDown()
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
2019-10-30 14:31:22 -07:00
James D. Forrester
83d76f4cb5 phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass
Change-Id: I63f97497714a32236268be6965c5e181dade6c58
2019-10-14 12:48:48 -07:00
Umherirrender
f59e308097 Remove extra param comment and enable phpcs rule
Cleanup .phpcs.xml a bit

Change-Id: I65d99cc933c3fe22bbca3be3258761add4b2024f
2019-10-11 21:36:25 +02:00
Umherirrender
ba4adc3fc9 phpcs: Enable PSR12.Files.ImportStatement.LeadingSlash and make pass
Change-Id: Ifaa7bef925cc4e1b3f1751bb66abdda7fe6763d8
2019-10-11 20:01:32 +02:00
James D. Forrester
9be9e77b51 build: Upgrade mediawiki-codesniffer from 26.0.0 to 28.0.0
Newly-disabled general rules:
* MediaWiki.Commenting.FunctionComment.MissingSplatVariadicArg
* MediaWiki.Commenting.FunctionComment.SuperfluousVariadicArgComment
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessage
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessageRegExp
* MediaWiki.Usage.NullableType.PHP71NullableStyle
* MediaWiki.Usage.PHPUnitTypeHints.MissingTypehint
* PSR12.Files.ImportStatement.LeadingSlash
* PSR12.Properties.ConstantVisibility.NotFound

Change-Id: Ifcf8c6d5fecc47a32741114b5a5b746a41510045
2019-10-11 10:05:43 -07:00
Umherirrender
5bd311b1a2 Add public as visibility in tests folder
Add public, protected or private to function missing a visibility
Enable the tests folder for the phpcs sniff

Change-Id: Ibefce76ea9984c47e08c94889ea2eafca7565e2c
2019-10-10 21:55:37 +02:00
Daimona Eaytoy
e3412efac3 Unsuppress PhanParamReqAfterOpt, use PHP71 nullable types
These were all checked with codesearch to ensure nothing is overriding
these methods.
For the most part, I've updated the signature to use nullable types; for
two Pager's, I've just made all parameters non-optional, because you're
already forced to pass them with a required parameter at the end.

Bug: T231636
Change-Id: Ie047891f55fcd322039194cfa9a8549e4f1f6f14
2019-10-10 11:53:58 +02:00
James D. Forrester
52ed3261d9 HHVM removal: Drop HHVM code for maintenance/
Change-Id: Id713c523caacdf829d107f6d7473fe22ed9c75d6
2019-10-02 17:06:56 -07:00
Reedy
dd71a77512 Make most special pages class names match filename
Change-Id: I3a9f932acb7d9cf44a984b5d97f9fbc6b8670f7d
2019-09-10 02:47:08 +01:00
Amir Sarabadani
06f645c453 Load GlobalFunctions.php to tests/phpunit/bootstrap.php
That mostly enables testing global functions

Bug: T87781
Change-Id: Ib42c56a67926ebcdba53f4c6c54a5bff98cb77a3
2019-07-14 01:28:07 +02:00
Kosta Harlan
822efb467d Assert that LocalSettings file exists
This time, use $IP to get correct path to LocalSettings so that tests can be run
from outside MediaWiki root.

Change-Id: I0dd3dd281cff67b0d8acdc09b97328c44eca2bb6
Follows-Up: Ia36d22217f94e019bb5945705243bd0daace72e0
Bug: T226977
2019-07-02 11:57:00 -04:00
Kosta Harlan
214750d8d2 Define unit and integration test suites
Following discussion in Ibb8175981092d7f41864e641cc3c118af70a5c76, this patch
proposes to further reduce the scope of what unit tests may access, by removing
the loading of DefaultSettings and GlobalFunctions.php. This also has the
implied effect of disabling the storage backend, as well as the global service
locator.

MediaWikiTestCase is renamed to MediaWikiIntegrationTestCase so it's scope and
purpose is more clear. Whether we still need to keep `@group Database`
annotation around is debatable, as it's unclear to me what the performance costs
are of implying database access for all tests which extend IntegrationTestCase.
As far as I can tell, `@group Database` is primarily used in CI to run faster
tests before slower ones, and with the new UnitTestCase the annotation seems
redundant.

To run all testsuites, use `composer phpunit`. Other composer scripts:

- `composer phpunit:unit` to run unit tests
- `composer phpunit:integration` to run integration tests
- `composer phpunit:coverage` to generate code coverage reports from unit
   tests (requires XDebug).

Note that you can pass arguments to composer scripts with `--`, e.g. `composer
phpunit:integration --exclude-group Dump`.

Other changes:

- Rename bootstrap.php to bootstrap.maintenance.php so it's clear it's part of
  the legacy PHPUnit-as-maintenance-class setup
- Create new bootstrap.php which loads the minimal configuration necessary for
  the tests, and do additional setup in the run() method of the unit/integration
	test case classes
- Move the unit-tests.xml file to phpunit.xml.dist in preparation for this being
  the default test configuration

For a follow-up patch:

- Find unit/integration tests for extensions/skins
- Migrate other test suites from suite.xml
- Support running all tests via vendor/bin/phpunit

Bug: T84948
Bug: T89432
Bug: T87781
Change-Id: Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76
2019-06-28 12:18:18 -04:00
Legoktm
4e35134f7a Revert "Separate MediaWiki unit and integration tests"
This reverts commit 0a2b996278.

Reason for revert: Broke postgres tests.

Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
2019-06-13 23:00:08 +00:00
Máté Szabó
0a2b996278 Separate MediaWiki unit and integration tests
This changeset implements T89432 and related tickets and is based on exploration
done at the Prague Hackathon. The goal is to identify tests in MediaWiki core
that can be run without having to install & configure MediaWiki and its dependencies,
and provide a way to execute these tests via the standard phpunit entry point,
allowing for faster development and integration with existing tooling like IDEs.

The initial set of tests that met these criteria were identified using the work Amir did in
I88822667693d9e00ac3d4639c87bc24e5083e5e8. These tests were then moved into a new subdirectory
under phpunit/ and organized into a separate test suite. The environment for this suite
is set up via a PHPUnit bootstrap file without a custom entry point.

You can execute these tests by running:
$ vendor/bin/phpunit -d memory_limit=512M -c tests/phpunit/unit-tests.xml

Bug: T89432
Bug: T87781
Bug: T84948
Change-Id: Iad01033a0548afd4d2a6f2c1ef6fcc9debf72c0d
2019-06-13 22:56:31 +02:00
Gergő Tisza
45d4e8d13a Exempt structure tests from @covers checks
@covers does not make any sense for structure tests, which either
do not cover any PHP lines (they test things like configuration or
messages), or cover lines which cannot be determined at the time
of writing the tests (e.g. they cover all classes implementing a
certain interface). Requiring @coversNothing to be manually added
for all of them is a waste of developer time.

tests/phpunit/suite.xml has forceCoversAnnotation=true so removing
the annotations will not change test coverage, these files will
still be skipped.

Change-Id: I27cb58e92341b9b1a76f109701f5bc843adbaa9b
2019-06-11 21:40:14 +00:00
Ariel T. Glenn
ee66a53468 move 7zip.inc to a regular php file
Bug: T182814
Change-Id: I53746333fe3c1cdc357bf46d71a351231a845e2f
2019-05-13 11:25:24 +00:00
Ariel T. Glenn
bb880f74b1 move most of dumpTextPass to an include file so it can be subclassed
Bug: T164262
Change-Id: I9b3c54503dd9ad193af7765459613a7e73ffbb45
2019-05-13 10:14:09 +03:00
Reedy
9f2ffdfbd4 Remove "Squiz.WhiteSpace.FunctionSpacing" from phpcs exclusions
Change-Id: I78b3315f26ab91b6b443f5b028a635552f82f5a3
2019-05-11 02:44:26 +01:00
Reedy
d3aea5dc09 Update some composer dependancies
Update composer/semver from 1.4.2 to 1.5.0

https://github.com/composer/semver/releases/tag/1.5.0
https://github.com/composer/semver/compare/1.4.2...1.5.0

Update composer/spdx-licenses from 1.4.0 to 1.5.1

https://github.com/composer/spdx-licenses/compare/1.4.0...1.5.1
https://github.com/composer/spdx-licenses/releases/tag/1.5.1

Update mediawiki/codesniffer from 25.0.0 to 26.0.0

https://github.com/wikimedia/mediawiki-tools-codesniffer/releases/tag/v26.0.0
https://github.com/wikimedia/mediawiki-tools-codesniffer/compare/25.0.0...v26.0.0

Disable failing Squiz.WhiteSpace.FunctionSpacing, can be fixed in a later
commit

Change-Id: I89062c8f28bef893f054650f2e81287291ba9ca0
Depends-On: I8f55e77283f83d853ce340f5c1b7704c65e45bc4
2019-05-11 00:06:45 +00:00
Zoranzoki21
4226fada45 Split parser related files to have one class in one file
Change-Id: I36b26609ccb3f135a22961b32a46cdc06603b3e4
2019-04-27 00:41:47 +00:00
Zoranzoki21
2d4eacf50b Split ApiErrorFormatter.php to have one class in one file
Change-Id: I5c6904e32f9bc7fe3aac511c56b03757bfde15a9
2019-04-21 22:20:22 +00:00
Aryeh Gregor
e6df285854 Remove all $wgParser use from core
Bug: T160811

Change-Id: I0556c04d33386d0339e02e2bf7a1ee74d97c2abd
2019-04-17 15:16:50 +03:00
Reedy
40552888fc Split DairikiDiff to class per file
Change-Id: Ica426312ec69707b9a99dfe2a7deee945c38ba35
2019-04-14 23:37:52 +01:00
jenkins-bot
6955a4afc3 Merge "Split filebackend files to class per file" 2019-04-14 22:24:56 +00:00
Reedy
79502d48e6 Rename PhpBugTests -> PhpXMLBugTester
Only contains one class (probably should be removed when we bump to PHP 7 fully)

Change-Id: Iab2bb837e2ed5d5556bd49f4236030b43aba29f1
2019-04-14 22:03:47 +00:00
Reedy
7f04a47d68 Split filebackend files to class per file
Change-Id: Idf9f4177fb9a523ce41227bda2af923bf418396b
2019-04-14 23:02:13 +01:00
jenkins-bot
63e017f4fc Merge "Split HTMLFormElement.php into class per file" 2019-04-14 21:59:45 +00:00
jenkins-bot
2ba7a9f28d Merge "Move ClassCollector to its own file" 2019-04-14 21:54:10 +00:00
jenkins-bot
81c888ab85 Merge "Move SectionProfileCallback to its own file" 2019-04-14 21:53:00 +00:00
jenkins-bot
89b0d88c38 Merge "Remove XMPReader back compat" 2019-04-14 21:25:47 +00:00
Reedy
14826d1e0c Move ClassCollector to its own file
Change-Id: I881f1ccc4aaf8babc40ad534a2a91f1ccf3baad4
2019-04-14 19:46:18 +00:00
Reedy
6341ee8fa6 Move SectionProfileCallback to its own file
Change-Id: Iccb2048eed6631caa4f20639f55866e76f9fabf0
2019-04-14 19:25:56 +00:00
jenkins-bot
492215443d Merge "Fix casing of Special Pages to match class name" 2019-04-14 19:25:29 +00:00
Reedy
95b8b3a4de Remove XMPReader back compat
Change-Id: I4e3ecbf6c13a7e7cfed88253eb6820e78e49e9c3
2019-04-14 19:12:54 +00:00
Zoranzoki21
e996b53913 Split StubObject.php to have one class in one file
Change-Id: If00625b700962a1c6d6412c6de30c28fa3df9f81
2019-04-14 14:20:42 +00:00
Reedy
c28707d371 Fix casing of Special Pages to match class name
Change-Id: Ifc9e827202493e8f055a21875c54ff827a38d1f7
2019-04-14 13:55:04 +01:00
Reedy
a32b1b16ef Split HTMLFormElement.php into class per file
Change-Id: Ia8a35056fa6df5b81cda3e5bfcaac91d0b898d51
2019-04-14 13:38:49 +01:00
Umherirrender
b8ec4a8ff8 Split LocalFile.php to have one class in one file
Change-Id: Ic8e5220f2a1832dfc39f00720001235429ed2cab
2019-04-14 11:45:39 +02:00
Reedy
d1a3d98be9 Move UploadStashFile to its own file
Change-Id: I557bcd8369014bf2ea43c5eb8336562cb6295890
2019-04-14 03:50:59 +01:00
jenkins-bot
2a710e256f Merge "Split logging classes to individual files" 2019-04-14 02:26:45 +00:00
Reedy
f032d27d0c Split logging classes to individual files
Change-Id: I3eaaf23612fe1aed65e49c06a9e5e565399af9ce
2019-04-14 02:13:47 +00:00
Reedy
d8f480bad3 Remove PreferencesFormLegacy.php
Now unused, deprecated in 1.32

Change-Id: I4fc4bdf36b3832786c0266786cff57d512140d8e
2019-04-14 02:08:32 +00:00
jenkins-bot
a51c518005 Merge "Remove LoginSignupSpecialPage.php from OneObjectStructurePerFile.MultipleFound" 2019-04-14 01:10:26 +00:00
Reedy
9e78841aa0 Remove LoginSignupSpecialPage.php from OneObjectStructurePerFile.MultipleFound
Change-Id: I145759b29d9e845d175cc7ac43ad72248b258df0
2019-04-14 01:38:27 +01:00
Reedy
4be4fdc9cf Split SVGReader to its own file
Change-Id: I9fc442225a37c14d0606508aed5ef496a5ad82ba
2019-04-14 00:29:52 +00:00
jenkins-bot
862a462211 Merge "Split ApiImport.php to have one class in one file" 2019-04-14 00:29:32 +00:00
jenkins-bot
ca542c1dc9 Merge "Remove PathRouter.php from Generic.Files.OneObjectStructurePerFile.MultipleFound" 2019-04-14 00:20:32 +00:00
Zoranzoki21
3f16fda078 Split ApiImport.php to have one class in one file
Change-Id: I3fbf5d271585722e95b7966ba62dd5e16fa3623f
2019-04-14 01:13:12 +01:00
Reedy
d85ef6f056 Remove PathRouter.php from Generic.Files.OneObjectStructurePerFile.MultipleFound
Change-Id: I9aa1eb7903dca3f63675c3be5a597829dc6d9ab3
2019-04-14 01:01:52 +01:00
Reedy
6b5f1a6cdb Remove ApiMessage from Generic.Files.OneObjectStructurePerFile.MultipleFound
Change-Id: Ib1a08c53f509bdae96ff8d3a5dadc9a55eb6b6af
2019-04-14 00:51:13 +01:00
jenkins-bot
7cb562ce79 Merge "Fix a couple of Generic.Files.OneObjectStructurePerFile.MultipleFound in api" 2019-04-13 23:49:50 +00:00
Reedy
821a4e84dd Fix a couple of Generic.Files.OneObjectStructurePerFile.MultipleFound in api
Change-Id: Ibb6b324b286f62153ce5d08a66454e0b05a0ef78
2019-04-13 23:32:53 +00:00
Timo Tijhof
04e8493822 changes: Split Feed.php into a class per file
Change-Id: I1f11a52871dcb249b3ba790e484dd10fe8bb049f
2019-04-13 23:29:04 +00:00
Zoranzoki21
26faca6a20 Move PackedHoverImageGallery from PackedOverlayImageGallery.php
Change-Id: I7a764fa89637dc7c3865dbbbbe0d90d5bc268ed2
2019-04-06 14:12:02 +02:00
Umherirrender
b233e9d188 Move MediaTransformOutput classes to own files
Change-Id: I1c676f18101250ffc28ea412213d568c5a4f527d
2019-03-30 12:23:14 +01:00
Umherirrender
6745cb572a Move class SearchEngineDummy to own file
Each class should have its own file, even it is a no-op

Change-Id: I90124ed35e354c546fcd69d52dc1febb71b2c71f
2019-03-29 20:35:35 +01:00
jenkins-bot
670cd4802b Merge "Move PrefixSearch classes to own files" 2019-03-28 21:42:50 +00:00
Umherirrender
8d5a8fb181 Move PrefixSearch classes to own files
Move all into search subfolder

Change-Id: I4097b9745d22545afe6761da1fa67cf98af5b811
2019-03-27 21:40:33 +01:00
Umherirrender
7ede3c619a Move HistoryBlob classes to own files
Move all into own subfolder

Change-Id: Iccf1bb9a2c8927c1b4dc0952d59d745109a71f76
2019-03-25 20:29:47 +01:00
Umherirrender
c71a50e2a0 Rename PoolCounter_Stub to PoolCounterNull
Also move to own file
Remove "Stub", because it refers a php concept,
which is not used here

Change-Id: Ife952901b5ad8e4a408d229ee72de953a9acc220
2019-03-24 22:44:46 +01:00
Umherirrender
3265bbb184 Move class RevisionListBase and friends to own file
Change-Id: I2c3675286bef948585ee0364288081aad9fd4376
2019-03-14 19:50:40 +01:00
jenkins-bot
c4022f1e98 Merge "Move class HistoryPager to own file" 2019-03-10 03:25:36 +00:00
Umherirrender
9d5e2fd751 Move class RangeDifference to own file
Change-Id: I5262c7484017a0d920cc24297515d5946f614ee6
2019-03-08 23:29:14 +01:00
Umherirrender
ba03d8f32a Move CacheDependency classes to own files
Change-Id: Icacf36674f10fa19a09499d68d596d5e2cc235f0
2019-03-08 22:27:29 +01:00
Umherirrender
11ce0ab99b Move class HistoryPager to own file
Change-Id: Ie12e79e6f32225442b5bd794826f8c760b2c02d6
2019-03-08 21:56:38 +01:00
Umherirrender
d515f784e5 Move class JobQueueAggregatorNull to own file
Change-Id: Icb76f25eb9c2a26c91ba564a78edd4c07b49b944
2019-03-08 20:19:26 +01:00
James D. Forrester
3f717984c1 Drop AuthPlugin and related code, deprecated in 1.27
Bug: T215843
Depends-On: Ie49709faa6f67b0a31bd546823d29dbfea0a70eb
Depends-On: If8109dbfdeeb88a6265f4cd79d1ae81bff48d934
Depends-On: I36b195fa2d6c23a76631ebaf869c787e44427d60
Depends-On: Iaa171b085fde331eab7d85c7de74523e27fc625a
Change-Id: I330b30d6582034a233fed204c0680b1ce84eec6e
2019-03-05 08:23:14 +00:00
Umherirrender
7edafc29c6 Move specialpage redirects related classes to own files
Change-Id: Ibddbb0c4e40fff310b1720ec9c72f2683cc93f54
2019-03-03 17:59:24 +00:00
Umherirrender
8d52cf3d12 Move FauxResponse class to own file
Similar to FauxRequest

Change-Id: Ia9e4e7287ade605899d935db7c9f1f017e0bcb85
2019-03-02 18:55:13 +00:00
jenkins-bot
1811f3f46a Merge "Move upload stash related exceptions to own files" 2019-02-08 02:50:54 +00:00
Kunal Mehta
cc5d9a92a2 build: Updating mediawiki/mediawiki-codesniffer to 24.0.0
Change-Id: I66b1775b7c1d36076d9ca78cbeb42787a743f2aa
2019-02-07 18:39:42 +00:00
Umherirrender
b0a75622d3 Move upload stash related exceptions to own files
Change-Id: I23e81af2f1bf73f5cd78a01bcc2fcebb4c4ea038
2019-02-06 22:22:01 +01:00
jenkins-bot
7caf6176df Merge "Move exceptions JobQueueError to own file" 2019-02-06 20:31:19 +00:00
Bartosz Dziewoński
09eb0271e2 .phpcs.xml: Remove ignores for removed files
* includes/compat/normal/UtfNormalUtil.php
  Removed in 88ea69f2f7.

* maintenance/benchmarks/bench_strtr_str_replace.php
  Rewritten in 1031825f3b.

Change-Id: Ie88fb420e688f11c8a94ecf91cb8b839944d991d
2019-02-06 19:45:43 +00:00
Umherirrender
fa29c3c09d Move exceptions JobQueueError to own file
Change-Id: Ibd67358cb7a14497dce8a3982ceba3b4300bdd65
2019-02-06 19:39:20 +01:00
Umherirrender
6ebe568c4e Remove deprecated class SquidUpdate
Change-Id: Iac53864296990befe7c573a29dd2f35aca52a79e
2019-02-05 20:35:05 +01:00
Umherirrender
1c851623b0 Move interface ICacheHelper to own class
Change-Id: I6f2b6507b0038f0988e4db5566ebddbe0d734a70
2019-02-05 20:04:12 +01:00
Umherirrender
1ca06c64af Move interface IJobSpecification to own file
Change-Id: Iabb10f8473b2ef0f4aea2aaca0dad39745028ece
2019-02-04 21:04:12 +01:00
jenkins-bot
800be73dc1 Merge "Add @coversNothing for left over tests and enable sniff" 2019-02-03 20:28:49 +00:00
Umherirrender
d28f315d24 Add @coversNothing for left over tests and enable sniff
LessFileCompilationTest is checking less files for valid syntax
doc test is checking xml file for valid syntax
MediaWikiTest is testing a complex situation with many functions involved
SideBarTest is self checking, needs no coverage
structure tests not covers functions, there are covers global structures

Change-Id: I3ac65db561cae0be8418aa9c830e7a9f46ad11fe
2019-02-02 21:53:40 -08:00
Umherirrender
5d2e39401d Move interface ILocalizedException to own file
Change-Id: I66429a89633a74a22999775214aa23ae189b837e
2019-02-01 20:05:30 +01:00
Kunal Mehta
b9bf03b9a6 Remove some exemptions that are no longer needed
Manually identified, it's possible that there are more.

Change-Id: Ifda5ecdb12915f4005161f1f98eae5f1162fbee1
2019-01-29 23:57:12 -08:00
Kunal Mehta
b6b10bb58f Require ClassMatchesFilename sniff to pass for most of tests/
phpunit-patch-coverage assumes that the filename matches the classname
as a performance optimization. And for most test cases, this is true. We
should enforce this with PHPCS, mostly to help developers not make
mistakes.

Test cases that have mock classes will need to ensure that the test case
class that matches the filename comes first, since that's the only class
the sniff will look at.

Tests in GlobalFunctions/ and maintenance/ are still exempted for now,
since they don't match yet.

Change-Id: Iede341504290f5ba2da1c81908069ba9d465600f
2019-01-29 23:57:12 -08:00
Kunal Mehta
951690c02e Rename tests/phpunit/includes/media files to match class names
The classes were renamed in 9bf39163, this updates the test cases to
match. Also take care of XCF while we're at it too.

Change-Id: Iaaeee93e496af6cdd610df5bc75302ecfe273f64
2019-01-29 23:21:13 -08:00
C. Scott Ananian
6db35b3c98 Remove most support for configuring Tidy, including Raggett
Remex is pure PHP so there is no reason to use an external tidy any
more. Configuration variables and implementation classes were
deprecated in 1.32 or earlier.  We've kept only $wgTidyConfig
which can be used for experimental features or debugging Remex.

Bug: T198214
Change-Id: I99d48f858d97b6e1d1e6cd76a42c960cc2c61f9f
2018-11-15 12:22:06 -05:00
Umherirrender
a4caa4d0c6 build: Updating mediawiki/mediawiki-codesniffer to 22.0.0
Added spaces around .
Removed empty return statement which are not required
Removed return after phpunit markTestIncomplete,
which is throwing to exit the test, no need for a return

Change-Id: I2c80b965ee52ba09949e70ea9e7adfc58a1d89ce
2018-09-16 15:51:11 +00:00
jenkins-bot
0746755fa9 Merge "Split AuthManagerAuthPluginUser into a separate file" 2018-09-01 20:40:23 +00:00
Kunal Mehta
d9deecf432 Split AuthManagerAuthPluginUser into a separate file
Change-Id: I22d2bf9514caf717a5d949bed425de1376670d3e
2018-08-28 15:22:49 -07:00
Timo Tijhof
ebec274f17 Remove support for StartProfiler.php
Bug: T201782
Bug: T189966
Change-Id: I6ef5af969b1d74a04d5d89370e6ac800c20be1ad
2018-08-26 02:09:44 +00:00
Umherirrender
7f68979bec Replace some wfMessage by ContextSource::msg
Change-Id: Ie056af7a002dbbf4e8defc8032bfcc0bdefc6566
2018-08-22 15:42:31 +02:00
jenkins-bot
1504dea112 Merge "maintenance: Move backup.inc to a regular php class file" 2018-08-22 11:15:03 +00:00
Umherirrender
9e7ca073ea Whitelist phpcs Squiz.Scope.MemberVarScope in PHPVersionCheck
The class supports php4 and the visibility private does not work there.

Change-Id: I9cbffe437a1d1f4243f0b70bd881cdc8b8257537
2018-08-07 12:39:46 +02:00
Timo Tijhof
55875bcd2d maintenance: Move backup.inc to a regular php class file
Move the class to maintenance/includes/, following the precedent
set by d788692076.

Bug: T184782
Change-Id: I0ba86e4401e2c97db4cf2ad9f0e78c04b5565ee8
2018-08-02 17:20:30 +01:00
Reedy
a075271157 Update composer/spdx-licenses to 1.4.0 and mediawiki/mediawiki-codesniffer to 21.0.0
https://github.com/composer/spdx-licenses/compare/1.3.0...1.4.0

Change-Id: I39f7a1310455159866bfed5224536e800befec0d
2018-07-26 17:44:28 +00:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
James D. Forrester
4d5b2473a4 build: Updating mediawiki/mediawiki-codesniffer to 20.0.0
Disable MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam and
MediaWiki.Commenting.PhpunitAnnotations.NotClassTrait for now, and
whitelist all failing files MediaWiki.Usage.ForbiddenFunctions.*.

Change-Id: Ib55ba3a70a1f922662c94895ab59eb02830faf3e
2018-06-04 08:43:58 -07:00
Kunal Mehta
2ecb2c944f Use wikimedia/xmp-reader library
Bug: T100922
Depends-On: I9bec4e03c49baafda30fb44cc793fa31b36e400d
Change-Id: Ic9044bf3260d1a474a6c74844949602441ffc865
2018-05-31 19:24:39 -07:00
jenkins-bot
82725d69b1 Merge "Maintenance script to wrap the mysql binary" 2018-05-31 16:16:20 +00:00
Timo Tijhof
a930bf7d7b Remove deprecated global $parserMemc and wfGetParserCacheStorage
Deprecated since 1.30, no longer used in core, bundled components,
and WMF-deployed extensions.

Change-Id: I09715f94750f083712719ef599a2ea4260297681
2018-05-31 14:28:42 +01:00
Tim Starling
25503cf011 Maintenance script to wrap the mysql binary
This is more or less equivalent to the WMF shell script "sql", but it is
reasonably portable and written in a less hackish way.

Change-Id: I240d8d4e65ce46680cac257ee376a9b026c13f92
2018-05-31 15:42:51 +10:00
Krinkle
7759b85acc Merge "Split ApiUsageException and UsageException to class per file" 2018-05-29 23:39:11 +00:00
jenkins-bot
930a808814 Merge "Split ApiMessage to class per file" 2018-05-29 22:18:24 +00:00
Reedy
d741d0d962 Split ApiUsageException and UsageException to class per file
Change-Id: I54c7d5e6616ac1a23082cc72e60ed92cb7eef715
2018-05-27 20:43:55 +00:00
Reedy
5522a7a9b8 Split ApiMessage to class per file
Change-Id: If8f51e6535d0ec6e35336a6702c5e35be35bcf09
2018-05-27 00:31:30 +00:00
jenkins-bot
468690e036 Merge "Rename ApiQueryContributions to ApiQueryUserContribs to match api module name" 2018-05-26 23:57:30 +00:00
Reedy
0be39da9b0 Rename ApiQueryContributions to ApiQueryUserContribs to match api module name
Change-Id: I865628b87eda7be349522fcfaf94f5563142026e
2018-05-26 23:07:15 +00:00
Bartosz Dziewoński
c513ec19ef Restore 'PreferencesForm' as alias for 'PreferencesFormLegacy'
In change 4633f4d46a it was changed
to an interface implemented by both PreferencesFormLegacy and
PreferencesFormOOUI so that existing typehints for some functions
parameter would accept them both. Replace those typehints to use
HTMLForm instead. There was really no guarantee in the past that
they would only be given PreferencesForm or its subclasses, either.

Because the typehint change affects some hooks, note it as a
deprecation in MW 1.31 and a breaking change in MW 1.32.

Also add @since tags and correct some typos in code comments.

Follow-up to 4633f4d46a.

Change-Id: I61749f1d864cf68afe90cd9e15ba2d7a74252501
2018-05-24 21:20:50 +00:00
Kunal Mehta
b8fbc1f3c8 Re-enable MediaWiki.Files.ClassMatchesFilename sniffs
Change-Id: I63f54b0336168a50aef72e38202e153677eafd3c
2018-05-23 19:36:51 -07:00
Kunal Mehta
e0193327bd Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
2018-05-23 16:23:42 -07:00
Kunal Mehta
392ec10686 Re-enable MediaWiki.Usage.AssignmentInReturn.AssignmentInReturn sniff
...except in tests, where there's a pattern of using it in data
providers.

Change-Id: Iea15cd9c6046910b0c91044cd2aeaff1a40f4fc5
2018-05-19 15:07:25 -07:00
Kunal Mehta
06ca92eb8c Re-enable MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals sniff
Disable it in specific files and places where there are legitimate uses
to access $_GET and $_POST directly.

For EditPage, which wants to output $_POST for debugging information,
introduce WebRequest::getPostValues() as a wrapper, matching the
existing ::getQueryValues().

Change-Id: I2cb0a7012fb7ed29dcd720056b42f56508ddc5fa
2018-05-19 15:07:25 -07:00
Kunal Mehta
230958d97c Autofix MediaWiki.Commenting.FunctionComment.SpacingDoc* errors
Change-Id: I63761ebce04c03b9b13237919c27cc10180f198f
2018-05-19 14:07:03 -07:00
Kunal Mehta
2331d9742a Re-enable Generic.Files.OneObjectStructurePerFile sniff
Whitelist existing violations in .phpcs.xml, and enable the sniff to
prevent people from accidentally introducing new violations.

languages/ is blanket exempted since languages that have language
converters tend to have two classes in one file.

tests/ is also blanket exempted since many tests create mock classes,
and we don't care about PSR-4 compliance in tests.

Change-Id: I56be2f23bae3e24c062198b766cb48edab5e395e
2018-05-19 13:31:14 -07:00
Kunal Mehta
f093fb4192 Don't globally disable PHPCS's prohibition of assert()
Whitelist the remaining usages of assert(), and reinstate the PHPCS sniff
that forbids usage of it. Add FIXME comments as well, so any casual readers
of the code will not think that the disabling and usage is intentional.

Change-Id: I7cabe715c0e6aa6a9ef3ffe5657f3de7fd8e662b
2018-05-07 17:15:16 +00:00
Umherirrender
69dbaf3f88 build: Updating mediawiki/mediawiki-codesniffer to 17.0.0
Change-Id: Ib494b47c54fe6354d166055b1e1b31d3583bb992
2018-03-29 21:53:10 +02:00
Max Semenik
8a82749ce9 Don't use deprecated NS_IMAGE*
Change-Id: I3df00c8e55a79baa3f3727daeea6c9441113aebc
2018-03-16 22:58:58 -07:00
Umherirrender
63d96c15fd build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
Change-Id: I59b59f79bbf3ce4feff3b3a20c1c31bc16370531
2018-02-17 13:29:13 +01:00
Umherirrender
255d76f2a1 build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable

For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore

Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
2018-01-01 14:10:16 +01:00
Paladox
d97455ca21 build: Updating mediawiki/mediawiki-codesniffer to 14.1.0
And moved phpcs.xml to .phpcs.xml (T177256).

Change-Id: Idaa1fe006a528c25ce34abd0a857c657c26e8b0f
2017-10-21 03:12:55 +00:00
Renamed from phpcs.xml (Browse further)