ApiLogin and ApiCreateAccount calling wfSetupSession, which leaks a
session over the test.
The test RequestContextText needs a clear session to work, so the api
tests should avoid leaking the session.
Doing this in the ApiTestCase because some tests calling ApiLogin over
FauxRequest and that also starts a session.
Change-Id: Icf5cb4d4a2c24c96698cac5bf32147c0c9149ef3
$this->apiContext = new ApiTestContext();
}
+ protected function tearDown() {
+ // Avoid leaking session over tests
+ if ( session_id() != '' ) {
+ global $wgUser;
+ $wgUser->logout();
+ session_destroy();
+ }
+
+ parent::tearDown();
+ }
+
/**
* Edits or creates a page/revision
* @param string $pageName Page title