X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTestUser.php;h=86f4ae789d53960d43ad0aa782a6111647e69635;hp=247b6e4461bcb44aad19cc791bc4a1cf8aa17e5e;hb=08b2cf66387856c623ff99bca4a83db2b7d8c9e6;hpb=0421ab1e9eda6e22ba9a12c73dbb969c337ed9e9 diff --git a/tests/phpunit/includes/TestUser.php b/tests/phpunit/includes/TestUser.php index 247b6e4461..86f4ae789d 100644 --- a/tests/phpunit/includes/TestUser.php +++ b/tests/phpunit/includes/TestUser.php @@ -6,25 +6,19 @@ */ class TestUser { /** - * @deprecated Since 1.25. Use TestUser::getUser()->getName() - * @private * @var string */ - public $username; + private $username; /** - * @deprecated Since 1.25. Use TestUser::getPassword() - * @private * @var string */ - public $password; + private $password; /** - * @deprecated Since 1.25. Use TestUser::getUser() - * @private * @var User */ - public $user; + private $user; private function assertNotReal() { global $wgDBprefix; @@ -78,6 +72,12 @@ class TestUser { $this->user->removeGroup( $group ); } if ( $change ) { + // Disable CAS check before saving. The User object may have been initialized from cached + // information that may be out of whack with the database during testing. If tests were + // perfectly isolated, this would not happen. But if it does happen, let's just ignore the + // inconsistency, and just write the data we want - during testing, we are not worried + // about data loss. + $this->user->mTouched = ''; $this->user->saveSettings(); } }