UTPage is a badly named page that should not be used directly. In fact,
soon it will no longer be guaranteed to exist (T342428). Tests should
create the fixtures they need, using titles/summaries that are actually
meaningful and that make it easy to identify what test is responsible
for creating a given page.
In ApiSetNotificationTimestampIntegrationTest, make separate assertions
because the order of the two pages in the result set is not stable
(ApiPageSet::initFromTitles has no ORDER BY).
Change-Id: Iecfb75e16deaa2f682afd916f58d8c548ee1cbac
* Fix tests depending on $wgUsePigLatinVariant=true, which is in
DevelopmentSettings.php but not TestSetup::applyInitialConfig().
* Fix test depending on DNS resolution details.
Change-Id: I877dc3323bf4024caab7666a8820103de0b48d23
This property shouldn't be needed in modern code, where most things can
use Authority. So much so because TestUser adds a dependency on the
database, but many tests that use TestUser don't even need the database.
ApiTestCase, in particular, sets this property in setUp, thus adding a
database dependency to all API tests, including those that don't need
users or the database at all.
Deprecate the property and replace existing usages in core. The one in
ApiTestCase is much harder to migrate, but this patch replaces the array
with an anonymous ArrayAccess class to allow lazy initialization and
remove DB dependencies.
Bug: T155147
Change-Id: I59c4ed1f6a7572d3a92387b15b8e56625bc376a2
Pig-Latin only has one-way conversion to it implemented for now, so
the last two test cases was reversed.
Change-Id: I56e29f25bb7600b36f76b5a541328ad0fec2514e
The redirect targets another variant, but the target does not exist.
It causes infinite loop when querying the page with the redirect
and converttitles flags are both set.
Check the mConvertTitles to stop re-resolving the same title.
Bug: T333050
Change-Id: I64c5886dbd0a9148eeff033ba56306bcb7f2eb8c
* Unnecessary regex modifier. I agree with this inspection which flags
/s modifiers on regexes that don't use a dot.
* Property declared dynamically.
* Unused local variable. But it's acceptable for an unused local
variable to take the return value of a method under test, when it is
being tested for its side-effects. And it's acceptable for an unused
local variable to document unused list expansion elements, or the
nature of array keys in a foreach.
Change-Id: I067b5b45dd1138c00e7269b66d3d1385f202fe7f
PageUpdateStatus provides clean access the the newly created
RevisionRecord.
Depends-On: Ia08c586198082ea47e8313d0d41835f9830fb29e
Change-Id: Id6963842321c4eaa3d7d029ad0b769f73433c103
Redirects can form a loop but it was unaccounted for in this process.
Track seen pages to detect when a loop has formed. In the case of a
redirect loop the ApiPageSet will include the source page and ignore
the found redirects.
Bug: T264534
Change-Id: Ia5f4eeb9a4d90f02aceec3ed83bd4fc4a8a23ca4
assertSame() is guaranteed to not do any type conversion. This can be
critical when acciden tially comparing, for example, 0 to 0.0.
Change-Id: Iffcc9bda69573623ba14af655dcd697d0fcce525
Title::getPrefixedText was called before the GenderCache was set up,
which lazy loads the cache for each title,
resulting in one query per user title
Splitted the foreach to fill the cache at a better location
Added a test for ApiPageSet to test that the gender cache is filled
Bug: T200238
Change-Id: I7972dd1bf3731a92328caab20e70d7b9b82c1f7c
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168
Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||
Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
For example Special:MyPage, Special:MyTalk, and Special:MyLanguage.
Don't follow other redirect special pages like Special:MyContributions,
though, because the following only really makes sense when the redirect
is to an article.
Bug: T145541
Change-Id: I8c8065552ed128017887e48285e359def8bd3cd3
If a client submits data that is not NFC-normalized Unicode or that
contains C0 controls other than HT, LF, and CR, it gets normalized before
the API ever sees it. Which can lead to difficult-to-handle bugs when,
for example, a title is subject to normalization so the client can't
find the specific title it submitted anywhere in the response (T139130).
This patch does two things:
* Detects when normalization was applied to an input value (at the
MediaWiki level, anyway; if PHP or earlier does it we're just out of
luck) and add a warning to that effect.
* For ApiPageSet's 'titles' parameter, split into the individual titles
and add them to the 'normalized' list in the response. This requires
encoding the pre-normalized strings to avoid ApiResult's own
normalization.
Bug: T29849
Bug: T144071
Change-Id: I215fd3edd7a5e1b45292e60768bf6dd5ad7f34de
This allows generator implementations to define how generator data
about a redirect gets merged into the redirect destination. This
does not change any defaults, only modules that explicitly set a
merge policy will have a change in their results.
This functionality is initially used for the search api modules to
retain search positions within the final result set.
Bug: T92796
Change-Id: If2f49e0fc3176288c95e870240754ee320a6bf91