| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* The CheckUser extension wants to use the MockTitleTrait
to make a mock title for a unit test.
* The code being tested calls Title::isSpecialPage, but this
method is not defined in the mock Title returned by
MockTitleTrait::makeMockTitle.
* Therefore, MockTitleTrait should mock the return value of
the ::isSpecialPage method which only needs to check if
the namespace is NS_SPECIAL.
What:
* Define Title::isSpecialPage in the Title class mock returned
by MockTitleTrait::makeMockTitle
Bug: T370083
Change-Id: If5a5b98299674264c33c6a87f5e0877ae0e1b241
|
|
|
|
|
|
|
| |
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I4ff4d0c10820dc2a3b8419b4115fadf81a76f7a2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change implements two things that can be combined to allow
the usage of services like the TitleFactory in subclasses of
MediaWikiUnitTestCase:
1) This adds getServiceContainer() to the MediaWikiUnitTestCase base
class, to mirror the method of the same name on
MediaWikiIntegrationtest case, along with a a setService() method
for defining service objects for use in tests.
2) This adds makeMockTitleFactory() to the MockTitleTrait, to allow
tests to esaily define the TitleFactory service.
Making services available through a service container primarily
benefits code that relies on ObjectFactory, like REST handlers.
Needed-By: Iac113a9e766e38b2d19ae99b7e448548a515469e
Change-Id: Ida6c37c7133b9e3887268025daf6e5b7c1340e52
|
|
|
|
|
|
|
| |
I worked around this with a custom mock for the moment, but would
like to use the upstream trait in the future.
Change-Id: Idf28d905f9fd01c24f29ad6a60419bfb4896704c
|
|
|
|
| |
Change-Id: I3577633670d0c2a771c690e3d6601300e1867222
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This is much better then mocking Titles manually
in extensions.
Change-Id: I40c0d118de94e85568bcb33ab1a6d1e1f9eb3eb4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Title::areCascadeProtectionSourcesLoaded()
- Title::areRestrictionsCascading()
- Title::areRestrictionsLoaded()
- Title::getAllRestrictions()
- Title::getCascadeProtectionSources()
- Title::getFilteredRestrictionTypes()
- Title::getRestrictionExpiry()
- Title::getRestrictionTypes()
- Title::getRestrictions()
- Title::isCascadeProtected()
- Title::isProtected()
- Title::isSemiProtected()
- Title::loadRestrictionsFromRows()
Bug: T306131
Change-Id: Id6c3a648453db51c464faeef2ecac4ffaa0676c1
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If we are creating a Mock title, the ID should be set to 0
for any Titles that are in "virtual" namespaces (e.g.
any with a namespace ID < 0, which is Special: or
Media:)
Change-Id: I6aae00ae8f68ad3a93d9edd1194e828735e2a878
|
|/
|
|
|
| |
Needed-By: Ibcfe05f2c15f6148cb81463dbcdbdacb142dc58e
Change-Id: I571619b8b538f496f4d1db82ee443a21ab7af42e
|
|
|
|
|
|
|
|
|
|
|
| |
SearchResultPageIdentity and SearchResultPageIdentityValue were
introduced as placeholders for PageIdentity and PageIdentityValues.
They can now become aliases.
Bug: T282091
Depends-On: I9b1ab02e0acf12ace107361ea2c443aa543c4880
Depends-On: Ie405ea9539cd18e15b0abb6db6df64ec0135825d
Change-Id: I6eb55c78a0a72be66814f8bc854ba663e7c6f62b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move MockTitleTrait::makeMockTitleCodec to DummyServicesTrait, and
replace the two existing uses, which are in core. Add some new
uses instead of mocking each time.
Unfortunately, we cannot use an actual MediaWikiTitleCodec
for the tests in BadFileLookup, because those tests are unit tests
and a MalformedTitleException cannot be created in the context
of a unit test. BadFileLookupTest gets around this by using
a mock that throws a mock exception - add a comment inline
explaining why we cannot use a real MediaWikiTitleCodec.
Paired with adding of NamespaceInfo to make mocking the language
methods related to namespaces easier by matching the real
logic in the Language class to the extend possible. Update a few
tests to use the DummyServicesTrait for their NamespaceInfo services.
Change-Id: Ibd691ccf0e632e1bf0bc1f7e9ddc0c660d5cad32
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Don't mock Title::getContentModel() twice:
The first time, its either $props['contentModel'] or falling
back to CONTENT_MODEL_WIKITEXT, and the second was
just always CONTENT_MODEL_WIKITEXT - keep the first.
Update the documentation with latest supported options.
Add a todo about ::getPageLanguage() returning 'qqx' by default,
it should be returning a Language object
Change-Id: I715e46ecc56288be5f8cbd8672ffe051b2c3f8d9
|
|/
|
|
|
|
|
|
| |
Add support for full interwiki handling, and then use this
service in UserNameUtilsTest as a step towards making
that test a full unit test
Change-Id: I3b54909e33e69fea8bb5ec55c99848c196859185
|
|
|
|
|
| |
Bug: T278459
Change-Id: If455682540faf8d42fd8a14e0ef09bac24f72db4
|
|
|
|
| |
Change-Id: Iddcd109b7f78efdbcb0e4016e81fd2c8d4666b46
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The signatures of these methods will change in PHPUnit 9, and in
general, having these methods means additional code to maintain. Since
this is test code, any attempt to use these traits from a class which
doesn't have the required methods will fail hard, and as such, there's
no reason to have these methods at all.
Also, MockServiceDependenciesTrait was redeclaring fail() as a
non-static method, but it is actually static in the parent class, which
makes tests fail on PHP 8.
Bug: T243600
Change-Id: I78bf1bdd2eb2e09aed27d1b6bff2302e28600703
|
|/
|
|
|
|
|
|
|
|
|
| |
PageStore is unused so far, usage will be demonstrated in follow-up
patches.
For now, this only implements the lookup (read) functionality of
PageStore.
Bug: T195069
Change-Id: I25cb9945795ecaf2d0b816a5abc7362424d11ba4
|
|
|
|
| |
Change-Id: I7d4503711ab1b739ca88b5fd0aa9e336cbac06aa
|
|
|
|
|
| |
Bug: T275531
Change-Id: If641a5a901210ba1a1ea6a41fa6a18c08f4183db
|
|
|
|
|
| |
Bug: T271977
Change-Id: I12a2f71f52a1ba7e94bf325621e62ed0e255601b
|
|
|
|
|
|
|
| |
Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208
Bug: T274036
Change-Id: I695873737167a75f0d94901fa40383a33984ca55
|
|
|
|
| |
Change-Id: Icc94fbd7090ee5f73fc1fba353ff7c936436f76f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we convert the RevisionRecord to using Authority,
we no longer need Title instances, so we can convert
that to PageIdentity.
Ideally, we'd part away from using Title at all, but:
1. For foreign wikis PageIdentity has stronger validation,
so calling PageIdentity getId() on Title will break things.
There's still a lot of code depending on lax Title guarantees,
so we keep it.
2. A lot of code still depends on Title, so we try to pass it
through even if we don't nesessarily need to, to save cost
on recreating it later on.
Bug: T271458
Depends-On: I287400b967b467ea18bebbb579e881a785a19158
Change-Id: I63d9807264d7e2295afef51fc9d982447f92fcbd
|
|
The functionality of creating title mocks is generally useful
and this will also allow to make HandlerTestTrait more narrow.
Bug: T264058
Change-Id: I76eca48dfcff65a6203fccde5366912a2d66c495
|