Improve test coverage in includes/password
authorTim Starling <tstarling@wikimedia.org>
Tue, 6 Jun 2017 05:05:22 +0000 (15:05 +1000)
committerTim Starling <tstarling@wikimedia.org>
Wed, 7 Jun 2017 04:28:11 +0000 (14:28 +1000)
commita9911b2582a20d9fe0569439d0d22a8c3135c249
treec8a40ae9804fa56038d792c14865e0ee8b82e8c6
parentb87a4fba8a27fc1c683a01560c6d932acfd07ce6
Improve test coverage in includes/password

From 21% to 82%.

* Added missing @covers, broadened @covers where appropriate.
* Added tests for some code that lacked them.
* Added a parameter to control the use of hash_pbkdf2() so that the pure
  PHP fallback could be tested. In the non-fallback test, force the use
  of the extension, and mark it skipped if it is not installed.

Bug: T167003
Change-Id: I987e1a89ec343907f4ead7f6192b2d4deb58ac16
13 files changed:
includes/password/Pbkdf2Password.php
tests/phpunit/includes/password/BcryptPasswordTest.php
tests/phpunit/includes/password/EncryptedPasswordTest.php [new file with mode: 0644]
tests/phpunit/includes/password/LayeredParameterizedPasswordTest.php
tests/phpunit/includes/password/MWOldPasswordTest.php [new file with mode: 0644]
tests/phpunit/includes/password/MWSaltedPasswordTest.php [new file with mode: 0644]
tests/phpunit/includes/password/PasswordFactoryTest.php [new file with mode: 0644]
tests/phpunit/includes/password/PasswordPolicyChecksTest.php
tests/phpunit/includes/password/PasswordTest.php
tests/phpunit/includes/password/PasswordTestCase.php
tests/phpunit/includes/password/Pbkdf2PasswordFallbackTest.php [new file with mode: 0644]
tests/phpunit/includes/password/Pbkdf2PasswordTest.php
tests/phpunit/includes/password/UserPasswordPolicyTest.php