From 3191c2adc45d5b412d0c7f99139e082197267894 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 23 Oct 2018 10:43:54 -0700 Subject: [PATCH] Reload the test user instance before checking the edit count These are updated in deferred updates and should not rely on the same User instance being used in those updates. This also avoids convoluted logic in User to set the new edit count for various cases. Change-Id: I6d239a5ea286afb10d9e317b2ee1436de60f7e4f --- tests/phpunit/AbuseFilterTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/AbuseFilterTest.php b/tests/phpunit/AbuseFilterTest.php index 35755107d..0325c9b9b 100644 --- a/tests/phpunit/AbuseFilterTest.php +++ b/tests/phpunit/AbuseFilterTest.php @@ -34,7 +34,14 @@ * @covers AFComputedVariable */ class AbuseFilterTest extends MediaWikiTestCase { - protected static $mUser, $mTitle, $mPage, $mVariables; + /** @var User */ + protected static $mUser; + /** @var Title */ + protected static $mTitle; + /** @var WikiPage */ + protected static $mPage; + /** @var AbuseFilterVariableHolder */ + protected static $mVariables; /** * @var array These tables will be deleted in parent::tearDown. @@ -148,6 +155,8 @@ class AbuseFilterTest extends MediaWikiTestCase { self::$mUser ); } + // Reload to reflect deferred update + self::$mUser->clearInstanceCache(); $result = 7; break; case 'user_name':