ApiTestCase resets global session data in setup, invalidating any existing cookies.
ApiQueryInfo caches all tokens, these need to be cleared out so tokens are re-generated
to match the fresh session.
Until now, individual tests have been doing that, but there's no not to do this per
default.
Change-Id: Icefa362190c2e7d87d09bda30079255741824f55
Make sure the global session data in $wgRequest is used for doApiRequest
per default, and return it's content among with the request's results.
Previously, an empty session was used per default, and the local context's
session data would get out of sync with $wgRequest.
This change allows for the following assumptions to hold in test cases:
* within the same function, changes to the session made by one api call
will be visible to subsequent api calls.
* the session data returned by doApiRequest is the actual status of the
session as manipulated by the api call. This session data can be passed
to subsequent api calls.
Note that the session data is still reset for every call to a test
function.
Change-Id: Ia20cf0ccfcdca736dd5da3444b14fbdd1c5def46
* Use the API module's own context to check edit tokens.
* Use the global session if none is provided to doApiRequest.
* Fix ApiFlockTest to not pass an empty session, so the tokens from
the global request can be used.
Change-Id: I2bff2390f43beb984b1b451bcf4e41271b2f054f
* Make tests work again
* Added ApiTestCase::doApiRequest() and related to pass it to the context and removed override of $wgUser where possible
* Fix ApiLogin to get the correct User object (i.e. the logged in one)
* Fix ApiBase to feed a RequestContext to setContext() so that ApiLogin can call setUser()