From: daniel Date: Mon, 24 Sep 2012 13:07:36 +0000 (+0200) Subject: Clear token cache when resetting session. X-Git-Tag: 1.31.0-rc.0~22294^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=a1fb3de7d2ffd8fc1d258cba3d8e20ca7db4d676;p=lhc%2Fweb%2Fwiklou.git Clear token cache when resetting session. 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 --- diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index b84292e3cd..3cec99af90 100644 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ b/tests/phpunit/includes/api/ApiTestCase.php @@ -18,6 +18,8 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { $wgAuth = new StubObject( 'wgAuth', 'AuthPlugin' ); $wgRequest = new FauxRequest( array() ); + ApiQueryInfo::resetTokenCache(); // tokens are invalid because we cleared the session + self::$users = array( 'sysop' => new TestUser( 'Apitestsysop',