Why:
* The ApiQueryUserInfo API returns 'anon' as true when the user
making the request is an IP user.
* This API should return 'temp' if the user making the request is
a temporary account, as described by T358683.
What:
* Return 'temp' with the value true from the ApiQueryUserInfo API
when the user making the API request is a temporary user.
* Test that the temp user flag is added when the user making the
request is a temporary user and that the flag is not added when
the user is logged-out.
Bug: T358683
Change-Id: I5f165576a12a2218d89ab3623d7df45e2c9049fa
Add a new action=query&meta=userinfo&uiprop=cancreateaccount
API property that checks whether the current user is allowed to
create accounts. This replaces the functionality removed from
list=users&usprop=cancreate in Ie94d61640301192b287275311f345,
and makes more sense - list=users is supposed to be about the
username (and re-called every time the username in the
registration form is changed), while meta=userinfo is about the
current user. It's also more accurate: it checks for all things
integrated with the permission system.
Change-Id: I0006500245a7c2bc3be0310ce9860b5771637a29
This ensures that assertions work in a uniform way,
and provides meaningful messages in cause of failure.
Change-Id: Ic01715b9a55444d3df6b5d4097e78cb8ac082b3e
No need to manually reset MWTimestamp fake time,
MediaWikiTestCaseTrait::fakeTimestampTearDown() does
that after all tests anyway.
Change-Id: Ie45e837c693d7f21b6c7e25471cdaad6f60a3de9
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653