init() method was added to AuthenticationProvider. It helps to inject
dependecies. Overridable postInitSetup() method was added to
AbstractAuthenticationProvider. A provider can override this to do
any necessary setup.
AbstractAuthenticationProvider ::setLogger(), ::setManager(), ::setConfig(),
::setHookContainer() were soft deprecated. Now developers must use
AbstractAuthenticationProvider::init().
Bug: T275030
Change-Id: I6ca63eddac1b177eeadbdcce992e71c44a480160
Most of the code in WatchlistManager does not depend
on integration logic, with the exception of
- ::clearTitleUserNotifications adding a DeferredUpdate
- ::addWatch and ::removeWatch using
User::newFatalPermissionDeniedStatus, which uses
MediaWikiServices
Move the majority of the rest to the unit tests, except
for an integration test of the overall basic functionality
that we leave to make sure that the integration with the
actual services works properly.
Also take this opportunity to document why the integration
tests left behind need to be integration test, and fix
the name of some tests to addWach/removeWatch instead of
the old doWatch/doUnwatch.
Explicitely add 'watchlist' to the tables used by the
integration test.
Change-Id: I899ef1618c59c179ed2591149b93969fd935276d
Should call the same ::countWatchersMutiple on the
actual store, not ::countVisitingWatchersMultiple
Has been broken since NoWriteWatchedItemStore was
first introduced, see 1ff58fc746
Change-Id: I20ab9a130f5bfe8b888ad08ea5852f13a03184f8
This is the default anyway when using ->with(). The test code
becomes so much more readable without this, I would like to
argue. Let it just say "with these values".
Because of the way I split my changes into multiple patches
there are a few other changes in this patch I could not split,
e.g. removing unnecessary ->any(). This is the default anyway
and doesn't make the test more specific.
Change-Id: I34990799fa9258ba8dc64c7e78ec43f7903b7681
It is not entirely meaningless. It might be an indicator that
the number of calls to a method is intentionally unlimited.
This is similar to e.g. an @inheritDoc PHPDoc comment that
marks a method as being "intentionally undocumented".
However, what's the meaning of being "intentionally
unconstrained"? Let's just not have any constraint then.
I feel all these ->expects( $this->any() ) bloat the test
code so much that it's never worth it.
Change-Id: I9925e7706bd03e1666f6eb0b284cb42b0dd3be23
Combine single use private methods, simplify mocks,
use a mock ActorMigration to allow making a unit test
Change-Id: I50e18b7727ca78a0ce0504d2b6c978e14d142b6a
It's the same and makes the test code much more readable, I
would like to argue.
Because of the was I split all the changes I made into smaller
patches this patch contains some other changes in the same
lines where I could not split them off. E.g. removal of
->any(), which is the default anyway and doesn't do anything.
Change-Id: Ib297b989d4aec33b31a4e33fe9d5032865b39be0
Ended up using
grep -Prl '\->setMethods\(' . | xargs sed -r -i 's/setMethods\(/onlyMethods\(/g'
special-casing setMethods( null ) -> onlyMethods( [] )
and then manual fix of failing test (from PS2 onwards).
Bug: T278010
Change-Id: I012dca7ae774bb430c1c44d50991ba0b633353f1
We still rely on Title internally, until the logic for mapping Titles to
URLs has been factored out.
Bug: T279796
Change-Id: I6abf30b8359fbe306c569ea290a64ed0d4105d71
When hook handler return false and use $status->fatal() to put up a error,
we should set $status->value to self::AS_HOOK_ERROR_EXPECTED to show edit form
and display error message.
Bug: T273354
Change-Id: I02d643c5cb1978da8ab749856493d75137b6cb02
The tests in this file make no sense now that MovePageFactory no longer
exists. Obviously you do not pass all constructor arguments to
PageCommandFactory through to MovePage.
To make it pass against the following commit, I could update the
getExtraClassArgCount(), but that would be necessary pretty much every
time the constructor argument list of either class is changed. There's
no reason to think a difference in argument count is an error anymore.
Change-Id: Id4f4b43d47217ebb0111800d7ccb9855d56f7abb
No integration needed, except for maybe in
the tests for the UploadedFile* classes, which
are left where they are for now - those tests
deal with the file system.
Change-Id: I4f38557d524b2d36dea36a926d0f31e1afed5c7a
- take PageIdentity in addition to LinkTarget where appropriate and
deprecate taking LinkTarget
- take Authority in addition to UserIdentity where appropriate and
deprecate taking UserIdentity
Change-Id: I410a4c26b25e086e1e6abb293789d718de4aa20a
Discovered in another patch that while integration
tests automatically reset fake timestamps afterwards,
unit tests don't. Add a shared method to MediaWikiTestCaseTrait
to reset for both integration tests and unit tests
Do the same for TypeDefTestCase
Change-Id: I677aec4e60894053fc554f2e13b069fb599858f2