aboutsummaryrefslogtreecommitdiffstats
path: root/.phpcs.xml
Commit message (Collapse)AuthorAgeFilesLines
* Make most special pages class names match filenameReedy2019-09-101-35/+0
| | | | Change-Id: I3a9f932acb7d9cf44a984b5d97f9fbc6b8670f7d
* Load GlobalFunctions.php to tests/phpunit/bootstrap.phpAmir Sarabadani2019-07-141-0/+1
| | | | | | | That mostly enables testing global functions Bug: T87781 Change-Id: Ib42c56a67926ebcdba53f4c6c54a5bff98cb77a3
* Assert that LocalSettings file existsKosta Harlan2019-07-021-0/+1
| | | | | | | | | 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
* Define unit and integration test suitesKosta Harlan2019-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Separate MediaWiki unit and integration tests"Legoktm2019-06-131-1/+0
| | | | | | | | This reverts commit 0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9. Reason for revert: Broke postgres tests. Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
* Separate MediaWiki unit and integration testsMáté Szabó2019-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Exempt structure tests from @covers checksGergő Tisza2019-06-111-0/+3
| | | | | | | | | | | | | | | @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
* move 7zip.inc to a regular php fileAriel T. Glenn2019-05-131-2/+1
| | | | | Bug: T182814 Change-Id: I53746333fe3c1cdc357bf46d71a351231a845e2f
* move most of dumpTextPass to an include file so it can be subclassedAriel T. Glenn2019-05-131-2/+1
| | | | | Bug: T164262 Change-Id: I9b3c54503dd9ad193af7765459613a7e73ffbb45
* Remove "Squiz.WhiteSpace.FunctionSpacing" from phpcs exclusionsReedy2019-05-111-1/+0
| | | | Change-Id: I78b3315f26ab91b6b443f5b028a635552f82f5a3
* Update some composer dependanciesReedy2019-05-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Split parser related files to have one class in one fileZoranzoki212019-04-271-3/+0
| | | | Change-Id: I36b26609ccb3f135a22961b32a46cdc06603b3e4
* Split ApiErrorFormatter.php to have one class in one fileZoranzoki212019-04-211-1/+0
| | | | Change-Id: I5c6904e32f9bc7fe3aac511c56b03757bfde15a9
* Remove all $wgParser use from coreAryeh Gregor2019-04-171-1/+0
| | | | | | Bug: T160811 Change-Id: I0556c04d33386d0339e02e2bf7a1ee74d97c2abd
* Split DairikiDiff to class per fileReedy2019-04-141-2/+0
| | | | Change-Id: Ica426312ec69707b9a99dfe2a7deee945c38ba35
* Merge "Split filebackend files to class per file"jenkins-bot2019-04-141-3/+0
|\
| * Split filebackend files to class per fileReedy2019-04-141-3/+0
| | | | | | | | Change-Id: Idf9f4177fb9a523ce41227bda2af923bf418396b
* | Rename PhpBugTests -> PhpXMLBugTesterReedy2019-04-141-1/+0
|/ | | | | | Only contains one class (probably should be removed when we bump to PHP 7 fully) Change-Id: Iab2bb837e2ed5d5556bd49f4236030b43aba29f1
* Merge "Split HTMLFormElement.php into class per file"jenkins-bot2019-04-141-1/+0
|\
| * Split HTMLFormElement.php into class per fileReedy2019-04-141-1/+0
| | | | | | | | Change-Id: Ia8a35056fa6df5b81cda3e5bfcaac91d0b898d51
* | Merge "Move ClassCollector to its own file"jenkins-bot2019-04-141-1/+0
|\ \
| * | Move ClassCollector to its own fileReedy2019-04-141-1/+0
| | | | | | | | | | | | Change-Id: I881f1ccc4aaf8babc40ad534a2a91f1ccf3baad4
* | | Merge "Move SectionProfileCallback to its own file"jenkins-bot2019-04-141-1/+0
|\| |
| * | Move SectionProfileCallback to its own fileReedy2019-04-141-1/+0
| | | | | | | | | | | | Change-Id: Iccb2048eed6631caa4f20639f55866e76f9fabf0
* | | Merge "Remove XMPReader back compat"jenkins-bot2019-04-141-2/+0
|\ \ \
| * | | Remove XMPReader back compatReedy2019-04-141-2/+0
| | |/ | |/| | | | | | | Change-Id: I4e3ecbf6c13a7e7cfed88253eb6820e78e49e9c3
* | | Merge "Fix casing of Special Pages to match class name"jenkins-bot2019-04-141-11/+0
|\ \ \ | |_|/ |/| |
| * | Fix casing of Special Pages to match class nameReedy2019-04-141-11/+0
| | | | | | | | | | | | Change-Id: Ifc9e827202493e8f055a21875c54ff827a38d1f7
* | | Split StubObject.php to have one class in one fileZoranzoki212019-04-141-1/+1
| |/ |/| | | | | Change-Id: If00625b700962a1c6d6412c6de30c28fa3df9f81
* | Split LocalFile.php to have one class in one fileUmherirrender2019-04-141-1/+0
|/ | | | Change-Id: Ic8e5220f2a1832dfc39f00720001235429ed2cab
* Move UploadStashFile to its own fileReedy2019-04-141-1/+0
| | | | Change-Id: I557bcd8369014bf2ea43c5eb8336562cb6295890
* Merge "Split logging classes to individual files"jenkins-bot2019-04-141-2/+0
|\
| * Split logging classes to individual filesReedy2019-04-141-2/+0
| | | | | | | | Change-Id: I3eaaf23612fe1aed65e49c06a9e5e565399af9ce
* | Remove PreferencesFormLegacy.phpReedy2019-04-141-1/+0
|/ | | | | | Now unused, deprecated in 1.32 Change-Id: I4fc4bdf36b3832786c0266786cff57d512140d8e
* Merge "Remove LoginSignupSpecialPage.php from ↵jenkins-bot2019-04-141-1/+0
|\ | | | | | | OneObjectStructurePerFile.MultipleFound"
| * Remove LoginSignupSpecialPage.php from OneObjectStructurePerFile.MultipleFoundReedy2019-04-141-1/+0
| | | | | | | | Change-Id: I145759b29d9e845d175cc7ac43ad72248b258df0
* | Split SVGReader to its own fileReedy2019-04-141-1/+0
|/ | | | Change-Id: I9fc442225a37c14d0606508aed5ef496a5ad82ba
* Merge "Split ApiImport.php to have one class in one file"jenkins-bot2019-04-141-1/+0
|\
| * Split ApiImport.php to have one class in one fileZoranzoki212019-04-141-1/+0
| | | | | | | | Change-Id: I3fbf5d271585722e95b7966ba62dd5e16fa3623f
* | Merge "Remove PathRouter.php from ↵jenkins-bot2019-04-141-1/+0
|\ \ | |/ |/| | | Generic.Files.OneObjectStructurePerFile.MultipleFound"
| * Remove PathRouter.php from Generic.Files.OneObjectStructurePerFile.MultipleFoundReedy2019-04-141-1/+0
| | | | | | | | Change-Id: I9aa1eb7903dca3f63675c3be5a597829dc6d9ab3
* | Remove ApiMessage from Generic.Files.OneObjectStructurePerFile.MultipleFoundReedy2019-04-141-1/+0
|/ | | | Change-Id: Ib1a08c53f509bdae96ff8d3a5dadc9a55eb6b6af
* Merge "Fix a couple of Generic.Files.OneObjectStructurePerFile.MultipleFound ↵jenkins-bot2019-04-131-2/+0
|\ | | | | | | in api"
| * Fix a couple of Generic.Files.OneObjectStructurePerFile.MultipleFound in apiReedy2019-04-131-2/+0
| | | | | | | | Change-Id: Ibb6b324b286f62153ce5d08a66454e0b05a0ef78
* | changes: Split Feed.php into a class per fileTimo Tijhof2019-04-131-2/+0
|/ | | | Change-Id: I1f11a52871dcb249b3ba790e484dd10fe8bb049f
* Move PackedHoverImageGallery from PackedOverlayImageGallery.phpZoranzoki212019-04-061-1/+0
| | | | Change-Id: I7a764fa89637dc7c3865dbbbbe0d90d5bc268ed2
* Move MediaTransformOutput classes to own filesUmherirrender2019-03-301-1/+0
| | | | Change-Id: I1c676f18101250ffc28ea412213d568c5a4f527d
* Move class SearchEngineDummy to own fileUmherirrender2019-03-291-1/+0
| | | | | | Each class should have its own file, even it is a no-op Change-Id: I90124ed35e354c546fcd69d52dc1febb71b2c71f
* Merge "Move PrefixSearch classes to own files"jenkins-bot2019-03-281-1/+0
|\
| * Move PrefixSearch classes to own filesUmherirrender2019-03-271-1/+0
| | | | | | | | | | | | Move all into search subfolder Change-Id: I4097b9745d22545afe6761da1fa67cf98af5b811