This class is not used very often:
https://codesearch.wmcloud.org/search/?q=RandomImageGenerator
But in these tests it's a serious bottleneck. For no good reason. We
don't really care how an image looks like during a test. Nobody will
ever see it. Not even when a test fails.
Bug: T225730
Change-Id: I7f3d586144ecdf480c773dc5e8b10f1ad4df8861
Why:
* The "Tools" menu contains a link to Special:UserRights.
* In 4da1989b63 this was updated to
not display the "Change user groups" link for a temporary user
* However, we should also hide the link for a temporary account.
What:
* Update Skin::buildNavUrls to not add the link to
Special:UserRights if the user is a temporary account.
Bug: T373988
Change-Id: Ib7d94c6cd5fb213c2bac7b55b8e77c4930e8f5d3
This was intially disabled in I6c54466e9517d98. Now we use HashBagOStuff during test which doesn't use any database interaction.
So it's okay to enable them now.
Bug: T343492
Change-Id: I0413fc9e302085f27ea9e00eafee23858126426b
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I07ce1f37d1bfb18d6e73dd008a712b3ca60a80e9
Why:
* SpecialUserRights::userCanChangeRights is used by
Skin::buildNavUrls to determine whether to display a link to
Special:UserRights for a user
* Special:UserRights does not allow temporary accounts, so the
aformentioned method should return false if the name is a
temporary account to not add the navigational link.
What:
* Return false from SpecialUserRights::userCanChangeRights if the
provided target user is a temporary account.
* Add some tests for SpecialUserRights::userCanChangeRights to
verify this behaviour.
Bug: T373988
Change-Id: Ib960c0ae0a04650acfb17d273389f151a04672a2
Why:
* On wiki farm installs, it is possible that temporary accounts
are enabled on wiki but not another wiki
* Special:UserRights can assign groups to users on other wikis
* This currently allows temporary accounts to be assigned groups
from a wiki where the feature is disabled and not known.
* The Special:UserRights page should disallow this by preventing
cross-wiki assignment of rights when the target username is
reserved by the temporary accounts system.
** This works because the reserved pattern is accessible even when
the feature is not known
** Furthermore, the reserved pattern is expected to be set for all
wikis in the farm if one wiki has temporary accounts enabled,
so that the temporary account cannot be created on wikis which
have the feature disabled.
What:
* Update SpecialUserRights::saveUserGroups and ::fetchUser to
reject usernames when:
** The wiki ID for the username is not local
** Temporary accounts are not enabled on the wiki
** TempUserConfig::isReservedName returns true for the username
* Add a test to verify that temporary accounts cannot be given
user groups by the special page.
* Testing the changes made in this commit will be difficult as it
requires having a second wiki set up, and this is not done in
CI (which makes the test non-blocking for CI).
Bug: T372046
Change-Id: I2d60c5b3322caa4629b4e73c0b0b525fd1028946
Why:
* The LoggedUpdateMaintenance class is not tested and testing it
will help avoid regressions/bugs.
What:
* Create LoggedUpdateMaintenanceTest
Bug: T371167
Change-Id: I84f5399bf67cc98d7c731d75ee668481ce0817b2
Avoid own teardown as MediaWikiIntegrationTestCase tracks the file and
delete the file on teardown
Remove unused tempnam (added unused in 3db119428a)
Change-Id: Ic53398c89c885f1c263dfcdbc59f6129f605f5a7
Why:
- TemporaryPasswordPrimaryAuthenticationProviderTest currently combines
multiple test cases within a single test method, leading to
duplication and making the tests harder to grok.
What:
- Split the test cases within the test class to use either data
providers or separate methods where the inputs cannot be provided via
a data provider.
- Make getProvider() stateless and initialize the $manager and $validity
fields unconditionally via a setup hook to avoid confusing null errors
if attempting to manipulate these fields prior to obtaining a provider
instance.
Bug: T328718
Change-Id: I3e53d06ec5bde6a8f842f5caed5cdbad883f7afd
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
What:
* Create ChangePasswordTest
Bug: T371167
Change-Id: Ia61283e4121f1130607ba103202e2e1a500f1cb2
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
What:
* Create MakeTestEditsTest which fully tests the script
Bug: T371167
Change-Id: If71c09eea96c4b0fbf522162de3a5ed09a5770f6
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
* Some files are mostly covered, and expanding their associated
tests should fully cover them or at least further improve
coverage.
What:
* Expand ProtectTest
Bug: T371167
Change-Id: Iff86988967d8a69d71353fea4ba72705062aa95f
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
What:
* Create ValidateRegistrationFileTest
Bug: T371167
Change-Id: Icba4650a0d3f6af3d597628753af292f522e5456
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
What:
* Create CLIParserTest which does not yet test parsoid parsing
using the script.
Bug: T371167
Change-Id: I8852d9c9889e7bfef814ce28ef7d6efe375095e2
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
What:
* Create RunJobsTest
Bug: T371167
Change-Id: I478c23440e4b0b373e9be41dee37de6460e7962e
Why:
* Maintenance scripts in core have low test coverage
* Improving this will reduce the chances of regressions and bugs
What:
* Create GetReplicaServerTest
Bug: T371167
Change-Id: I24fdda83c8a9c2ea0ad1dbbd1f9c90bb61a81439
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Improve a mixed type to string
Change-Id: Id994553eaeac181775ac782423ff53928ad45466
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: Ifbc2ce0c68865c5d32689e56c6215a5099f7478b
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: Ib6081f5519d2294bb14f81bf399f9c45315f2b69
Avoid assigment in conditions
foreach starts at begin of iterator, the while loop can process the next
from within the result, but all the iterator in search are rewinded
before iterator starts
Change-Id: I38b2729418e8389c681c6cd84858f5e5ed25bd3e