This adds support to the LinkTarget interface and TitleValue
implementation for having an interwiki component, matching the function
names used in Title.
MediaWikiTitleCodec was updated accordingly.
The motivation behind this change is to be able to fully use LinkTarget
in the Linker rewrite instead of depending upon Title.
Change-Id: I6666b64f0e336aadc7261e7ca87ac2e498c61856
The createFragmentTarget function allows for switching the fragment on a
target in an easier way. TitleValue already had a now-renamed
createFragmentTitle function (no uses outside of tests), and an
implementation was added for Title.
This will also help with reducing the amount of public usage of
Title::setFragment(), which is deprecated.
Change-Id: I1e8ba2f85e748b1b4394fb2f2a1ccce69cf6e3c5
LinkTarget::hasFragment() is a helper function which returns a boolean
of whether the target has a fragment. Title already had such a function,
and one was added to TitleValue.
Co-Authored-By: addshore <addshorewiki@gmail.com>
Change-Id: I49e607ae5a58c3aef96d0246297740e7d88ac816
* Remove redundant @licence/@license from test suite files.
They already have full licence headers. And @licence raises a
warning in Doxygen.
* Fix weird messes of comments inside comments and other things.
Change-Id: I38da8ca76330f72b8dc22b0ecf1ea69d5ea55ede
this was to be temporary, right? we need the tests in.
If there are issues with jenkins, this is not the *best*
way to fix them.
This reverts commit 44a1968531.
Change-Id: I5dd60a9818c28155d96a6642c588781667e682c3
Although the tests themselves pass, their introduction to the codebase pushed
the total number of tests past some threshold at which Jenkins starts
segfaulting. So remove the tests as a temporary workaround, and revert this
patch once the bug with Wikimedia's Jenkins deployment (bug 43972) is resolved.
Change-Id: I5722faf0e4216e1c1f98ecc1f2dba744b240b7d3
TitleValue is intended to be a light weight alternative to the Title
class. Any operations on TitleValue are implemented in separate
service classes, like TitleFormatter and PageLinkRenderer. See
<https://www.mediawiki.org/wiki/Requests_for_comment/TitleValue>
for more information.
This change updates SpecialCategories and SpecialLinkSearch to use
TitleValue instead of Title, to demonstrate how TitleValue would be
used, and how the necessary services can be injected and applied.
The intention is to improve testability and reusability; these
advantages will however only become apparent with further refactoring
of the respective special pages. This will be done in follow-up
changes.
More work will be needed to migrate essential functionality from
Title and Linker classes into the respective service classes,
MediaWikiTitleCodec and MediaWikiPageLinkRenderer.
Change-Id: I8eef5a165de4ffcacfbc4911fdacdb15d502fff4