Speed up password-handling in the unit tests
authorOri Livneh <ori@wikimedia.org>
Thu, 12 May 2016 10:40:41 +0000 (03:40 -0700)
committerOri Livneh <ori@wikimedia.org>
Fri, 13 May 2016 23:13:12 +0000 (16:13 -0700)
commit61096dd7ac0122e83703910352c912feb6e78688
tree93540c45130276a10f48f5c6b30dbbebe2b50d7d
parent0583d261bbc5d9d2fb569e0f9c87043e9ca5a717
Speed up password-handling in the unit tests

* Speed up password generation and verification by setting MWOldPassword as the
  default password type. Do this once, in MediaWikiTestCase::makeTestConfig(),
  rather than in five different places.
* Rename '$pwhash' to '$passwordHash', for consistency. It's ugly to have both
  '$passwordFactory' and '$pwhash' in the same scope.
* Make TestUser::setPasswordForUser() check first whether the desired password
  is already set. This is actually the common case, since the password is reset
  in the setup code for every test, but only a few tests actually change the
  password.

Change-Id: I423f09ff7472b6cbde21cb709ea7c7ef9e298f18
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/TestUser.php
tests/phpunit/includes/api/ApiLoginTest.php
tests/phpunit/includes/session/BotPasswordSessionProviderTest.php
tests/phpunit/includes/user/BotPasswordTest.php