aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-09-20 17:31:32 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-09-20 17:31:32 +0200
commita00854c406215d787465422d7ea7def8c24180f5 (patch)
tree0e8352afe2bdf9d6cca276668da2302fee89321d /tests/passwords
parent[feature/passwords] Add missing function documentation (diff)
downloadphpbb-a00854c406215d787465422d7ea7def8c24180f5.tar.gz
phpbb-a00854c406215d787465422d7ea7def8c24180f5.tar.bz2
phpbb-a00854c406215d787465422d7ea7def8c24180f5.zip
[feature/passwords] Do not pass phpbb_container to passwords manager
PHPBB3-11610
Diffstat (limited to 'tests/passwords')
-rw-r--r--tests/passwords/manager_test.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php
index a069c9692e..aa05c8d641 100644
--- a/tests/passwords/manager_test.php
+++ b/tests/passwords/manager_test.php
@@ -46,7 +46,7 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
}
// Set up avatar manager
- $this->manager = new phpbb_passwords_manager($config, $this->phpbb_container, $this->passwords_drivers, 'passwords.driver.bcrypt_2y');
+ $this->manager = new phpbb_passwords_manager($config, $this->passwords_drivers, 'passwords.driver.bcrypt_2y');
}
public function hash_password_data()
@@ -58,6 +58,7 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
array('passwords.driver.bcrypt_2y', '2a', 60),
array('passwords.driver.bcrypt', '2a', 60),
array('passwords.driver.salted_md5', 'H', 34),
+ array('passwords.driver.foobar', '', false),
);
}
else
@@ -67,6 +68,7 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
array('passwords.driver.bcrypt_2y', '2y', 60),
array('passwords.driver.bcrypt', '2a', 60),
array('passwords.driver.salted_md5', 'H', 34),
+ array('passwords.driver.foobar', '', false),
);
}
}
@@ -77,6 +79,12 @@ class phpbb_passwords_manager_test extends PHPUnit_Framework_TestCase
public function test_hash_password($type, $prefix, $length)
{
$password = $this->default_pw;
+
+ if (!$length)
+ {
+ $this->assertEquals(false, $hash = $this->manager->hash_password($password, $type));
+ return;
+ }
$time = microtime(true);
// Limit each test to 1 second