* Widen `@covers` annotation to at least the subject class.
Ref https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/982945
Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:%2522Widen%2522
* Remove useless test for private properties existing, which
is implementation detail of no interest to whether the class is
working correctly or not.
* Given no assertions exist, combine testCreate()
This commit removes use of deprecated assertObjectHasAttribute, hence
tagging as T342110.
Bug: T342110
Needed-By: Id708a7716505ffce26c8eb438a98d74195682e91
Change-Id: Id7a7593b41afef89fd02af070bdf760baddd2c30
Adds tests for \MediaWiki\CommentFormatter\CommentParserFactory
The test suite includes the following validations:
- Tests constructor for property initialization.
- Tests create method for proper initialization.
Change-Id: I8c66ebaeeccb320c439ef4c879440d7b3e1233dd
Adds tests for \MediaWiki\CommentFormatter\CommentItem
The test suite includes the following validations:
- Constructor initialization with expected parameters and behaviors.
- Checks correct assignment of LinkTarget objects.
- Assesses boolean flag manipulation for the same-page context.
- Examines wikiId setter with diverse input types.
Change-Id: Ibc12cced8da70cdf75bb1764ad16ce5dd872820b
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.
Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.
Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
Expected value is the first parameter to assertSame() or assertEquals().
And turn to use assertCount() for some assertions aginst count of array.
Based on code search `assert(?:Same|Equals)\(.+,.+expected` and I look
through files roughly, so some assertions that don't contains 'expected'
are also fixed. In the meantime, some assertions that I am not clear
about are not touched.
Change-Id: I75798b60d29fd19b33f4fdf34ed3c788db420d01
CommentParser:
* Move comment formatting backend from Linker to a CommentParser service.
Allow link existence and file existence to be batched.
* Rename $local to $samePage since I think that is clearer.
* Rename $title to $selfLinkTarget since it was unclear what the title
was used for.
* Rename the "autocomment" concept to "section link" in public
interfaces, although the old term remains in CSS classes.
* Keep unsafe HTML pass-through in separate "unsafe" methods, for easier
static analysis and code review.
CommentFormatter:
* Add CommentFormatter and RowCommentFormatter services as a usable
frontend for comment batches, and to replace the Linker static methods.
* Provide fluent and parametric interfaces.
Linker:
* Remove Linker::makeCommentLink() without deprecation -- nothing calls
it and it is obviously an internal helper.
* Soft-deprecate Linker methods formatComment(), formatLinksInComment(),
commentBlock() and revComment().
Caller migration:
* CommentFormatter single: Linker, RollbackAction, ApiComparePages,
ApiParse
* CommentFormatter parametric batch: ImageHistoryPseudoPager
* CommentFormatter fluent batch: ApiQueryFilearchive
* RowCommentFormatter sequential: History feed, BlocklistPager,
ProtectedPagesPager, ApiQueryProtectedTitles
* RowCommentFormatter with index: ChangesFeed, ChangesList,
ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges
* RevisionCommentBatch: HistoryPager, ContribsPager
Bug: T285917
Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0