Bot passwords allow backwards-compatible login (with grants, for API usage only) with "<real username>@<botname>" for username plus a random-generated password. This doesn't work well with some bot frameworks (including Pywikibot, the most popular one) which assume that the text that goes into the username field of the login API is the username that they will be logged in with afterwards (and so the @-postfix causes all kinds of errors). Since the goal of bot passwords is compatibility with old unmaintained API clients, this patch adds an alternative format which does not cause problems with old bots: use the username normally, and use "<botname>@<random-generated password>" as password. Since this is technically a valid normal password, there is some ambiguity, but bot passwords have a distintive format so it's easy to check and it is extremely unlikely that someone would use the exact same format for their normal password; and if the bot password login fails we can simply retry it as a normal password, just in case. Bug: T142304 Change-Id: Ib59a6fbe0e65d80d5e7d19ff37cec5e011c00539 |
||
|---|---|---|
| .. | ||
| data | ||
| docs | ||
| includes | ||
| languages | ||
| maintenance | ||
| mocks | ||
| skins | ||
| specials | ||
| structure | ||
| suites | ||
| tests | ||
| bootstrap.php | ||
| LessFileCompilationTest.php | ||
| Makefile | ||
| MediaWikiLangTestCase.php | ||
| MediaWikiPHPUnitTestListener.php | ||
| MediaWikiTestCase.php | ||
| phpunit.php | ||
| README | ||
| ResourceLoaderTestCase.php | ||
| run-tests.bat | ||
| suite.xml | ||
| TODO | ||
== MediaWiki PHPUnit Tests == The unit tests for MediaWiki are implemented using the PHPUnit testing framework and require PHPUnit to run. === WARNING === Some of the unit tests are DESTRUCTIVE and WILL ALTER YOUR WIKI'S CONTENTS. DO NOT RUN THESE TESTS ON A PRODUCTION SYSTEM OR ON ANY SYSTEM WHERE YOU NEED TO RETAIN YOUR DATA. == Installation == If you used composer to install MediaWiki's dependencies PHPUnit will already be available, unless you explicitly specified the --no-dev flag during the install. In this case just run "composer update". Otherwise follow the installation instructions in the PHPUnit Manual at: https://phpunit.de/manual/current/en/installation.html == Running tests == The tests are run from your operating system's command line. Ensure that you are in the tests/phpunit directory of your MediaWiki installation. On Unix-like operating systems, the tests runs are controlled with a makefile. Run command: make help for a full list of options for running tests. On Windows-family operating systems, run the 'run-tests.bat' batch file. === Writing tests === A guide to writing PHP unit tests for MediaWiki can be found at: https://www.mediawiki.org/wiki/Manual:PHP_unit_testing