From a1fb3de7d2ffd8fc1d258cba3d8e20ca7db4d676 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 24 Sep 2012 15:07:36 +0200 Subject: [PATCH] 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 --- tests/phpunit/includes/api/ApiTestCase.php | 2 ++ 1 file changed, 2 insertions(+) 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', -- 2.20.1