aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/installer
Commit message (Collapse)AuthorAgeFilesLines
* Add MessagesNo with $fallback = 'nb, nn'Fomafix2024-10-281-1/+3
| | | | | | | | | | | | | | | | With this change the on the HTTP header field Accept-Language: no,nl;q=0.5 the language code 'no' gets selected. On $ curl -s -H 'Accept-Language: no,nl;q=0.5' 'http://localhost/mediawiki/mw-config/' | head -2 <!DOCTYPE html> <html dir="ltr" lang="nb"> the language code is 'nb' because the macro language 'no' falls back to 'nb'. This fixes T187866. Bug: T187866 Change-Id: I4b30dd4be66c0bb8d763a86c59aa270301d17b5b
* [DatabaseUpdater] Don't interact with updatelog on virtual domainsDreamy Jazz2024-10-173-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | Why: * When performing schema changes on virtual database domains, the updatelog table may not exist on the DB connection being used to perform the updates * This is because the updatelog table will only exist on the database used for the local wiki, and not a central wiki. * As such, skip reading and writing to updatelog if the table does not exist on the current DB. ** This will cause some updates to be repeated, but there is no place to store that the update has completed and using a local wikis' updatelog table would not prevent the update from being performed again if update.php is run for a different wiki in the same cluster when the table is shared. What: * Update DatabaseUpdater::updateRowExists and ::insertUpdateRow to skip interacting with the updatelog table if it does not exist on the DB connection being used to perform schema updates. * Add tests for the currently completed untested DatabaseUpdater class to verify these changes. Bug: T377450 Change-Id: I60bf6028f17b0768588a09363ec28281954eb960
* Add tests for WebInstaller::getAcceptLanguageFomafix2024-07-021-0/+28
| | | | | | This is a preparation for T189193. Change-Id: I6b6e2c150950ac99df2d95dbb608ae82e912cd48
* Namespace WebInstaller classesReedy2024-01-111-1/+4
| | | | Change-Id: Iac081a08681048c56b20c7789c5efb50a756d167
* Redesign the installer with CodexAmir Sarabadani2023-12-131-1/+1
| | | | | | | | | It is not perfect, but it's a major improvement compared the existing one. We need to clean up a lot more once it has landed but it's a good start. Bug: T337435 Change-Id: I1f85110e754546c797d3325b8dd6878093790266
* Replace trivial usa of mock builder with createMock() shortcutThiemo Kreuz2022-07-151-3/+1
| | | | | | | | | | | createMock() does the same, but is much easier to read. A small difference is that some of the replacements made in this patch didn't use disableOriginalConstructor() before. In case this was relevant we should see the respective test fail. If not we can save some CPU cycles and skip these constructors. Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
* Installer: Do not use `mediawiki.skinning.interface` modulejdlrobson2021-04-151-0/+20
| | | | | | | | | | | | | | | | | | | | The `mediawiki.skinning.interface` module includes the `toc` feature which is enabled by default, which requires a working localization environment which requires DBLoadBalancer which is disabled at this entry point. Instead use ResourceLoaderSkinModule directly with an opt-in policy where toc feature is not disbled. This means the definition in Resources.php is no longer necessary so it is marked for deprecation. The installer now works. A unit test is added to make sure the installer stylesheet doesn't break again. Bug: T270027 Change-Id: I851fcd0e50e3a70158d5bfa1fdcae3cd278694d6
* Move trivially compatible tests to the unit tests suiteMáté Szabó2019-06-302-132/+0
| | | | | | | | | | | | | | | | | | | | | This changeset resumes work on T89432 and related tickets by porting an initial set of tests to the new unit test suite separated out in I69b92db3e70093570e05cc0a64c7780a278b321a. The tests were only ported if they worked immediately without requiring any changes other than changing the test case class to MediaWikiUnitTestCase and moving the test to the new suite. If a test failed for any reason (even trivial misconfiguration), it was NOT ported. With this change, the unit tests suite now consits of a total of 455 tests. As before, you can run these tests via the following command: $ composer phpunit:unit Bug: T84948 Bug: T89432 Bug: T87781 Change-Id: Ibb8175981092d7f41864e641cc3c118af70a5c76
* Revert "Separate MediaWiki unit and integration tests"Legoktm2019-06-132-0/+132
| | | | | | | | This reverts commit 0a2b996278e57a8b8c5377cd3a3eaa54f993d4a9. Reason for revert: Broke postgres tests. Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
* Separate MediaWiki unit and integration testsMáté Szabó2019-06-132-132/+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
* Remove comments literally documenting unit tests being unit testsThiemo Kreuz2019-02-191-2/+0
| | | | | | | | The name of the test class and method as well as the @covers tags already explain well enough which code a test is testing. Repeating this does not provide additional information. Change-Id: Ieec4ec131e5925d11704a11e1df46bc00c9fad9b
* Move @group and @covers tags in tests close to classUmherirrender2018-01-281-1/+0
| | | | | | | For @group and @covers tags there should be no newline between the comment and the class Change-Id: I7277df13a332cf4d74ffdd8748e3fbdc259610dc
* InstallDocFormatter: Add missing @covers scopeTimo Tijhof2017-11-221-5/+1
| | | | | | | | The format() method is a one-line wrapper around execute(), which is the real method being tested here. Given the class doesn't contain any other methods, increase the scope to the whole class. Change-Id: I8b2c7736c6708c0915a9ce15fef0dc85c63621ea
* DatabaseUpdater: Stop inserting junk into 'updatelog' every time the updater ↵Bartosz Dziewoński2016-11-301-286/+0
| | | | | | | | | | | | | | | | | | runs Nothing ever looks at these rows, and if you have update.php in a Cron job or a Git hook or something, they can accumulate in huge numbers. Also remove a test which verified that the rows get inserted. If you reached this place while trying to find out what the weird "updatelist-1.28.0-14628929450" rows in your database are, rest assured they are useless. If they're causing disk space problems, you can delete them: DELETE FROM updatelog WHERE ul_key LIKE 'updatelist-%'; Change-Id: If94f243810e82ea3724cbd47b301bb96ba9a49d9
* Update weblinks in comments from HTTP to HTTPSFomafix2016-11-071-7/+7
| | | | | | | | Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link. Also update some defect links. Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
* Replace DatabaseBase:: with Database:: and update type hintsAaron Schulz2016-09-271-3/+3
| | | | Change-Id: I3919b04eb2de4fa0bf8a02239fb5bbf17d347511
* Set more fields in fake DB subclasses to avoid errorsAaron Schulz2016-09-211-0/+6
| | | | Change-Id: I6b24422e830a8f82ba24383b3425808cb2a28b15
* Set the DatabaseDomain in some tests classes for sanityAaron Schulz2016-09-211-0/+1
| | | | Change-Id: I6531dc6cf89fbe7e5656354bcd4a27369f573752
* Add LBFactory::beginMasterChanges() for doing DBO_TRX roundsAaron Schulz2016-08-231-2/+2
| | | | | | | | | | This is in intended to replace the DataUpdate transaction round logic. It could also be useful for doing transaction rounds in maintenance scripts. Also renamed $db => $conn in a few LB methods for consistency. Change-Id: If21c2ba5e8bac48c250b96137279e7edaa8289f7
* Use more short array syntax in comments (/tests/)umherirrender2016-07-101-1/+1
| | | | Change-Id: I86c73cb9447ac562a73348b4030e24ebf49a90dc
* Convert all array() syntax to []Kunal Mehta2016-02-173-54/+54
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* InstallDocFormatter: Hyperlink Phabricator task numbersKevin Israel2014-11-211-0/+15
| | | | | | | | Also removed the callback functions for the existing regexes. Nothing has to be or is encoded or escaped at this time, so preg_replace() can be used instead of preg_replace_callback(). Change-Id: I8cdddd602dcf7b67b8f2b06149b6a0859c70342c
* Fix strict warning in FakeDatabasUpdater::setAppliedUpdatesphysikerwelt (Moritz Schubotz)2014-10-131-1/+1
| | | | | | | | | Follows-up ccd051bc44. To be consistent with DatabaseUpdater::setAppliedUpdates the second arg $updates is now optional. Change-Id: Ida2adfe30099ea4c65f0c16fafc4eae6603fc93a
* Add counter to DatabaseUpdater::setAppliedUpdatesphysikerwelt (Moritz Schubotz)2014-10-091-0/+279
| | | | | | | | | The key was constructed depending on the current time only. This method fails, if multiple updates are performed within one second. Bug: 71087 Change-Id: Id7e30298729b3abb1501a34fcc1ba4e45d2172f0
* Pass phpcs-strict on some test files (7/11)Siebrand Mazeland2014-04-242-5/+16
| | | | Change-Id: Ia0ceea60e7ef43959f868378f3fcd463a3adf782
* Changing URLs of mediawiki.org in scripts to the SSL-based websiteLadsgroup2014-03-121-3/+3
| | | | | | | | http://www.mediawiki.org --> https://www.mediawiki.org Part 2 Change-Id: I3be61fe3dfb502cc20180486eb1a8016eac151df
* Fix scope on all /phpunit test methodsaddshore2013-10-242-2/+2
| | | | Change-Id: I3ce92463d485a0fb23e464e9a8059330f32d79af
* Add @covers tags for more testsaddshore2013-10-211-0/+1
| | | | Change-Id: Iff3af78e9b41c445b7f066b6c0d0f4a87d2d6c4e
* Web installer: correctly show note for I4ecd0659Kevin Israel2013-09-151-0/+1
| | | | | | | | InstallDocFormatter didn't escape the double underscores in __TOC__. I also noticed that wfEscapeWikiText had a similar bug, which I reported as bug 53658 (fixed separately). Change-Id: Ib5346b9c234f1c5ef361cc4357352b09def5dc25
* Fix spacing and break some linesumherirrender2013-08-241-1/+1
| | | | Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
* Fixed EZConnect string regex in OracleInstaller class.freakolowsky2013-05-311-0/+47
| | | | | | | | | | | | | The Oracle connect string was valid only if it contained alphanumerics, underscore and dot. Some new schmemes makes uses of slashes and EZConnect has the concept of server types (pooled, dedicated, shared) which we now validate. The long regex is now in OracleInstaller::checkConnectStringFormat() (flagged with @since 1.22). The patch provides a bunch of very basic tests to test out the regex. Change-Id: Ie3a0af9801bfdbc9129298be07e1676145a1607a
* Tests: Make phpunit providers "public static".Timo Tijhof2013-03-221-1/+1
| | | | | | | Follows-up I9d2b148e57 (including phpunit/languages this time). Bug: 46434 Change-Id: I30e5efcd88c516121c454676bd7a18f9b7c8fca6
* Update formattingSiebrand Mazeland2013-02-151-6/+6
| | | | | | 5 of n. Change-Id: I811ca957b6588085d67606ebc0cd4033a1e53839
* Basic first round of testing for the InstallDocFormatterChad Horohoe2011-06-291-0/+64
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91040
* Fixes for r90105, r90193:Tim Starling2011-06-161-106/+0
| | | | | | | | | | * Actually removed $wgProto. * Per Aryeh's suggestions on the future of $wgServer: made $wgServer detection in DefaultSettings.php more permanent by merging it with the new code from r90105. This means that bug 14977 is properly fixed now. * Require entry points to set up the autoloader before including DefaultSettings.php. Comments on bug 14977 indicate that at some point in the past, this may have broken something. Anything that breaks now should just be fixed, we need the autoloader. Tested the most common entry points. * Since the detection code has moved from Installer to WebRequest, I also moved the relevant test file and updated the test. The function under test is now public static, so r90154 is superseded. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90194
* Followup r90105, ReflectionMethod::setAccessible() requires PHP 5.3.2. Mark ↵Chad Horohoe2011-06-151-4/+8
| | | | | | | incomplete otherwise Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90154
* * (bug 28798) Set $wgServer in the default LocalSettings.phpTim Starling2011-06-151-0/+102
* (bug 14977) When detecting $wgServer, treat IPv6 addresses in $_SERVER['SERVER_NAME'] etc. in a sensible way. * Tests for the new functions in IP.php and Installer.php Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90105