diff options
author | Igor Wiedler <igor@wiedler.ch> | 2011-03-20 22:52:31 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2011-03-20 22:52:31 +0100 |
commit | 4c3cc152c81af57ec0a25bfee5da4964309a3aa5 (patch) | |
tree | 3fed7afc1249d6e01d62de3d21e3fdc4f5b91777 /tests/security | |
parent | f8384b7302ca27aec0064f7d927a732e4e4552da (diff) | |
download | forums-4c3cc152c81af57ec0a25bfee5da4964309a3aa5.tar forums-4c3cc152c81af57ec0a25bfee5da4964309a3aa5.tar.gz forums-4c3cc152c81af57ec0a25bfee5da4964309a3aa5.tar.bz2 forums-4c3cc152c81af57ec0a25bfee5da4964309a3aa5.tar.xz forums-4c3cc152c81af57ec0a25bfee5da4964309a3aa5.zip |
[ticket/10101] Add test case for native phpass hashes
PHPBB3-10101
Diffstat (limited to 'tests/security')
-rw-r--r-- | tests/security/hash_test.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php new file mode 100644 index 0000000000..19a3822145 --- /dev/null +++ b/tests/security/hash_test.php @@ -0,0 +1,21 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + +class phpbb_security_hash_test extends phpbb_test_case +{ + public function test_check_hash_with_phpass() + { + $this->assertTrue(phpbb_check_hash('test', '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1')); + $this->assertTrue(phpbb_check_hash('test', '$P$9isfrtKXWqrz8PvztXlL3.daw4U0zI1')); + $this->assertFalse(phpbb_check_hash('foo', '$H$9isfrtKXWqrz8PvztXlL3.daw4U0zI1')); + } +} + |