Commit graph

6 commits

Author SHA1 Message Date
Derick Alangi
f749e04fb6
Title: Hard deprecate Title::newFromTitleValue()
I've updated callers to the deprecated code to use the new
method and we can completely remove the deprecated code in
mw 1.40

The deprecated method delegated to `::newFromLinkTarget()`
which is it's direct replacement, so that should be used
instead.

Depends-On: If799d6a1e722ca80f50b0f12c9b1c9f31a40a860
Depends-On: I276845ccf39ac7a65fca8ba268abbe1e02607a4b
Depends-On: I5d7213e9bcd84f5b674136d2d8b13577cbeead83
Depends-On: Idd222cc5ea94ee1215ab6d4c9e06d79c0a95d6aa
Change-Id: Ibc723aa30a2282222248669c3c195ecb7dfb2423
2022-05-09 21:14:13 +01:00
Derick Alangi
c296685f4f tests: Avoid trying to access the DB in data providers
NOTE: some test cases where removed as they're exactly doing the
same thing as the ones above.

Bug: T291268
Change-Id: I8fa8bafc892dbc84f2aab2549d453d6f39835d33
2021-09-20 10:32:45 +01:00
Derick Alangi
7d12da5595 tests: Extract pure unit tests from TitleTest integration test
-> Fixed TODOs such as adding test cases for namespaces that are
   not in `$wgNamespacesWithSubpages` in `testGetSubpageText()`.

-> Re-arranged provider methods to come before the test case as
   already in the files for consistency.

Change-Id: Ice2b3a07ea2ddd20417cbe87da93065e1812619e
2021-09-08 17:59:59 +01:00
Derick A
7ebf05256a tests: Cover more methods in the Title::class (increase code coverage)
The methods that have been covered in this patch are listed below:
~ Title::hasFragment()
~ Title::getFragment()
~ Title::setFragment()
~ Title::isMainPage()
~ Title::equals()
~ Title::getPrefixedURL()
~ Title::prefix()
~ Title::__toString()
~ Title::getFullText()

Bug: T241406
Change-Id: I51ffadb52e7eef822e9e619e5132513dc1501f9b
2021-09-07 13:58:38 +00:00
DannyS712
7b556a5761 Move some Title tests to unit tests
Tests for the following methods don't need integration:
- legalChars()
- convertByteClassToUnicodeClass()
- newFromTitleValue()
- newFromLinkTarget()
- castFromLinkTarget()

Change-Id: I2ec6505088c74a90da9d0b8305ce94d81cc0562a
2021-07-09 23:18:57 +00:00
DannyS712
bf2ed4cb22 Add Unit tests for Title class
Expand test coverage for some simple uncovered methods

Bug: T241406
Change-Id: I678aebac50bec908f90f861c3e59a89f63e7f917
2021-01-21 03:51:20 +00:00