aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/htmlform/HTMLFormTest.php
Commit message (Collapse)AuthorAgeFilesLines
* tests: Namespace and consolidate existing HTMLForm testsJames D. Forrester2024-03-081-143/+0
| | | | | | | This doesn't alter code coverage, but it puts all the tests in one place so we can improve them consistently. Change-Id: I5e2124704aa8dc4b45be17d61fbc2fbd606661b9
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-161-1/+1
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* Namespace includes/contextJames D. Forrester2024-02-081-0/+1
| | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
* Namespace Config-related classes under \MediaWiki\ConfigJames D. Forrester2023-09-211-0/+1
| | | | | Bug: T166010 Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
* Namespace User under \MediaWiki\UserJames D. Forrester2023-09-191-0/+1
| | | | | Bug: T166010 Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
* Reorg: Move three output related classes to includes/Output/Amir Sarabadani2023-09-051-0/+1
| | | | | | | | | | And namesapce them: - StreamFile - OutputHandler - OutputPage Bug: T321882 Change-Id: Iedf8d88c595e580f2d8f0734c92aa5c45618ba33
* Reorg: Move Status to MediaWiki\Status\Amir Sarabadani2023-08-251-0/+1
| | | | | | | | | | This class is used heavily basically everywhere, moving it to Utils wouldn't make much sense. Also with this change, we can move StatusValue to MediaWiki\Status as well. Bug: T321882 Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3 Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
* tests: Use MainConfigNames consts to refer config namesUmherirrender2023-06-191-1/+2
| | | | | | PasswordSalt was dropped in 2e909bcb Change-Id: I58d2b8d4e2a235afdc8054eafdea4e85b61f03c1
* Replace deprecated MWExceptionDaimona Eaytoy2023-06-091-1/+0
| | | | | Bug: T328220 Change-Id: I66be7a6dd752d6b9c254beb65f4eb5ace3c89776
* tests: Make some PHPUnit data providers staticTim Starling2023-03-241-1/+1
| | | | | | | | | | | | | Just methods where adding "static" to the declaration was enough, I didn't do anything with providers that used $this. Initially by search and replace. There were many mistakes which I found mostly by running the PHPStorm inspection which searches for $this usage in a static method. Later I used the PHPStorm "make static" action which avoids the more obvious mistakes. Bug: T332865 Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+1
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* Reorg: Move RawMessage to under language/Amir Sarabadani2022-12-161-0/+1
| | | | | | | | | | To follow Message. This is approved as part of RFC T166010. Also namespace it but doing it properly with PSR-4 would require namespacing every class under language/ and that will take some time. Bug: T321882 Change-Id: I195cf4c67bd51410556c2dd1e33cc9c1033d5d18
* Reorg: Move some of request related classes to MediaWiki/RequestAmir Sarabadani2022-10-281-0/+2
| | | | | | | | | | | | | | | Redoing I5ea70120d74 but without moving WebRequest that caused issues with phan-taint-plugin. Moving: - DerivativeRequest - FauxRequest - FauxRequestUpload - PathRouter - WebRequestUpload Bug: T321882 Change-Id: I832b133aaf61ee9f6190b0227d2f3de99bd1717b
* Revert "Reorg: Move some of request related classes to MediaWiki/Request"Zabe2022-10-271-2/+0
| | | | | | | | | This reverts commit 2bdc0b2b7209441a42a784157633a8a01b321922. Reason for revert: T166010#8349431 Bug: T166010 Change-Id: Idcd3025647aec99532f5d69b9c1718c531761283
* Reorg: Move some of request related classes to MediaWiki/RequestAmir Sarabadani2022-10-261-0/+2
| | | | | | | | | | | | | Moving: - DerivativeRequest - FauxRequest - FauxRequestUpload - PathRouter - WebRequest - WebRequestUpload Bug: T166010 Change-Id: I5ea70120d745f2876ae31d039f3f8a51e49e9ad8
* tests: Use Title::makeTitle instead of Title::newFromTextUmherirrender2022-07-061-1/+1
| | | | | | Avoid parsing known titles in tests to improve performance Change-Id: Ibfccfe696f0b8bfda0b99abae324e60bbecef7d8
* HTMLForm: Add test for CSRF token checkGergő Tisza2022-02-131-0/+51
| | | | | Bug: T301467 Change-Id: I52edb26f53c79795e3d501f810974aa97665bb77
* Rename HTMLForm::[get|set|add]*Text() methodsGergő Tisza2022-01-021-0/+7
| | | | | | | | | | | | | | | | Rename HTMLForm::[get|set|add][Pre|Post|Header|Footer]Text() to HTMLForm::[get|set|add][Pre|Post|Header|Footer]Html() and deprecate the old methods. Their arguments are rendered as raw HTML so the old name was misleading. Some of these are marked as stable to override and theoretically the renaming could cause problems if callers are updated to the new name while the overriding class is still using the old name, but the only case known to codesearch is OOUIHTMLForm which is also updated here. Bug: T290771 Change-Id: I2c269eb6ab2b320fa2eef4ee8a226e96ad05fbe2
* MediaWikiTestCase to MediaWikiIntegrationTestCaseaddshore2020-06-301-1/+1
| | | | | | | | | | | | | The name change happened some time ago, and I think its about time to start using the name name! (Done with a find and replace) My personal motivation for doing this is that I have started trying out vscode as an IDE for mediawiki development, and right now it doesn't appear to handle php aliases very well or at all. Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
* HTMLForm: Allow status object to have raw parametersFlorian2020-02-091-1/+16
| | | | | | | | | | | | | | | | The status object, which can be returned after validating an HTMLForm, can contain message objects. These message objects can be constructed with the full feature set provided by Message, e.g. raw parameters. The handling of these status objects in HTMLForm basically prevented some features of the Message object in the status, as it parsed the messages through the Parser, which does not recognize these raw parameters as such and escapes them wrongly. This behaviour is fixed with this change. Bug: T240774 Change-Id: I152ec51f317799572bf6791e110cd72c42da82a0
* Stop using assertContains with string haystackDaimona Eaytoy2019-12-151-4/+4
| | | | | | | | This was done automatically by replacing every assertContains with string *needle*. Then verifying the results. Bug: T192167 Change-Id: Id8cbbf3b01e948f80046714183cc299f86be21fd
* phpcs: Enable ↵James D. Forrester2019-10-141-3/+1
| | | | | | MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass Change-Id: I63f97497714a32236268be6965c5e181dade6c58
* Revert "Separate MediaWiki unit and integration tests"Legoktm2019-06-131-0/+63
| | | | | | | | This reverts commit 0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9. Reason for revert: Broke postgres tests. Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
* Separate MediaWiki unit and integration testsMáté Szabó2019-06-131-63/+0
| | | | | | | | | | | | | | | | | | | | | 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
* thiemowmde's legal name changedThiemo Kreuz (WMDE)2018-07-241-1/+0
| | | | | | | | I was a co-author only, and my contribution was not really noteworthy, so I choose to remove the outdated name (in this case only). Change-Id: I9d9592d5b114adae633f6a4bdac2dd60f329bd7a
* Add a method to HTMLForm that allows the preText to be accessed externally.David Barratt2018-07-091-0/+7
| | | | | | | | Currently there is no way to access the preText outside of an HTMLForm. Adding a getPreText method to HTMLForm so the preText is accessible. Bug: T199115 Change-Id: I937028e7025b4a7b5d333e9bf5a25920f6a88316
* Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errorsKunal Mehta2018-05-231-1/+1
| | | | Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
* build: Updating mediawiki/mediawiki-codesniffer to 17.0.0Umherirrender2018-03-291-1/+1
| | | | Change-Id: Ib494b47c54fe6354d166055b1e1b31d3583bb992
* Simplify autocomplete attribute in HTMLFormFomafix2017-12-281-4/+38
| | | | | | Follows-up 7489a3e8 Change-Id: Ifb17c88e39df7031054b3bee83772172c64d0a6b
* Add @covers tags to HTMLForm testKunal Mehta2017-12-271-1/+3
| | | | Change-Id: I41cc4867b071ee9a58a43760fc4a8b301cda558e
* Enforce calling HTMLForm::prepareForm before displayFormGergő Tisza2016-04-271-0/+21
Bug: T133163 Change-Id: Idd5d117cb0dd65c195019dcd321cd4bf9024b426