Make session persist between calls to doApiRequest
authordaniel <daniel.kinzler@wikimedia.de>
Fri, 22 Jun 2012 20:42:42 +0000 (22:42 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Fri, 22 Jun 2012 21:22:34 +0000 (23:22 +0200)
commit62ac6f372241cef4e8671d0beb33b476ced9a750
treeb97929bcfa5b290ee9be2f98f349393b1fefd6ec
parent7d3d38748abaaeeee19de82453ee6026438508ad
Make session persist between calls to doApiRequest

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
tests/phpunit/includes/api/ApiTestCase.php
tests/phpunit/includes/upload/UploadFromUrlTest.php