Returns the prefixed title for the associated page,
if it could exist (i.e. does not do anything for special pages)
Bug: T257014
Change-Id: I49cdc138c6182b323c4933e90dc96c5e06b6ccba
Replaces calls directly to PermissionManager with calls to
the Authority object available from Context or the
GroupPermissionLookup service.
This patch does not address use of PermissionManager for
blocks.
Deprecations:
- ApiBase::checkUserRightsAny deprecated passing optional
User parameter
- ApiBase::checkTitleUserPermissions deprecated passing
LinkTarget as first parameter, takes PageIdentity instead
Bug: T271462
Bug: T271854
Change-Id: I5d7cac1c28a37e074750c46cda03283980a07fca
The timestamp in the year 3030 was presumably chosen so as to
always be in the future (since expiry in the past would be ignored).
However, while seemingly clever, this backfires because it gets
shrunk by the default wgWatchlistExpiryMaxDuration value to some
time in August 2021, around the "current" time of day.
And "current" generally is thought of as moving forward at a rate
of 1s/s, bending of spacetime notwithstanding. Thus the test would
sometimes fail in ways such as:
> 1) ApiQueryInfoTest::testExecute
> Failed asserting that two strings are identical.
> --- Expected
> +++ Actual
> @@ @@
> -'2021-08-13T01:23:19Z'
> +'2021-08-13T01:23:18Z'
Fix this by using a mock current time, paired with a suitable
max duration and expiry value.
Also fix some of the other asserted values to not be reflections
of the source code but actually explicit assertions (at least the
details that we know to be constant, given the environment ensured
by ApiTestCase and MediaWikiLangTestCase). This reduces the chances
of false positives from looking at itself too much, and also speeds
up the test a little.
Change-Id: If361aa98bef789b1f841741a7c83bcb2ac9edf05
The code didn't properly handle requests for info about non-existing
pages.
Bug: T271804
Bug: T271815
Change-Id: If4e56ff5ecb4a048767833c89847bb58269cad43
The expiry is returned as a separate key, 'watchlistexpiry', to match
other APIs, and because some clients might expect 'watched' to be a
boolean (or blank string depending on the formatversion).
Bug: T268834
Change-Id: I227d6ed42e70ba1ddec0139e8198f536dfba0b46
Several important extensions (Disambiguator, ProofreadPage, and
SoftRedirector) use the GetLinkColours hook to add additional CSS
classes to links on article pages. Parsoid previously relied on
backdoor knowledge of the way Disambiguator used the page property
table to support these, but they should be exported properly from the
API.
Bug: T237538
Change-Id: I945940aa872541d7e01f1e543ca854231c857fe2
Consistency aside, this is useful for grouping more tests
into separate threads when using directory based suites.
Bug: T50217
Change-Id: Ife9acd5990c4ae4a5fc18371559e93d7d86fb57d
2020-10-30 03:31:12 +00:00
Renamed from tests/phpunit/includes/api/ApiQueryInfoTest.php (Browse further)