aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/password/UserPasswordPolicyTest.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2017-06-06 15:05:22 +1000
committerTim Starling <tstarling@wikimedia.org>2017-06-07 14:28:11 +1000
commita9911b2582a20d9fe0569439d0d22a8c3135c249 (patch)
treec8a40ae9804fa56038d792c14865e0ee8b82e8c6 /tests/phpunit/includes/password/UserPasswordPolicyTest.php
parentb87a4fba8a27fc1c683a01560c6d932acfd07ce6 (diff)
downloadmediawikicore-a9911b2582a20d9fe0569439d0d22a8c3135c249.tar.gz
mediawikicore-a9911b2582a20d9fe0569439d0d22a8c3135c249.zip
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
Diffstat (limited to 'tests/phpunit/includes/password/UserPasswordPolicyTest.php')
-rw-r--r--tests/phpunit/includes/password/UserPasswordPolicyTest.php9
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/phpunit/includes/password/UserPasswordPolicyTest.php b/tests/phpunit/includes/password/UserPasswordPolicyTest.php
index 8a69b5ce1eba..3bd82b4ac8d7 100644
--- a/tests/phpunit/includes/password/UserPasswordPolicyTest.php
+++ b/tests/phpunit/includes/password/UserPasswordPolicyTest.php
@@ -22,6 +22,7 @@
/**
* @group Database
+ * @covers UserPasswordPolicy
*/
class UserPasswordPolicyTest extends MediaWikiTestCase {
@@ -56,9 +57,6 @@ class UserPasswordPolicyTest extends MediaWikiTestCase {
return new UserPasswordPolicy( $this->policies, $this->checks );
}
- /**
- * @covers UserPasswordPolicy::getPoliciesForUser
- */
public function testGetPoliciesForUser() {
$upp = $this->getUserPasswordPolicy();
@@ -79,9 +77,6 @@ class UserPasswordPolicyTest extends MediaWikiTestCase {
);
}
- /**
- * @covers UserPasswordPolicy::getPoliciesForGroups
- */
public function testGetPoliciesForGroups() {
$effective = UserPasswordPolicy::getPoliciesForGroups(
$this->policies,
@@ -103,7 +98,6 @@ class UserPasswordPolicyTest extends MediaWikiTestCase {
/**
* @dataProvider provideCheckUserPassword
- * @covers UserPasswordPolicy::checkUserPassword
*/
public function testCheckUserPassword( $username, $groups, $password, $valid, $ok, $msg ) {
@@ -183,7 +177,6 @@ class UserPasswordPolicyTest extends MediaWikiTestCase {
/**
* @dataProvider provideMaxOfPolicies
- * @covers UserPasswordPolicy::maxOfPolicies
*/
public function testMaxOfPolicies( $p1, $p2, $max, $msg ) {
$this->assertArrayEquals(