aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-03-22 21:25:14 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-03-22 21:25:14 -0400
commit352ed5acf89331548e6cb1a5a32353364942f47c (patch)
tree16734259ffbfde983201559df2ec535780ee0194 /tests
parent5cc861712849392b8083577e3246803dbc95da4a (diff)
parent200c7e3c446aaa95397ac379f6eb2aa3b620ccd6 (diff)
downloadforums-352ed5acf89331548e6cb1a5a32353364942f47c.tar
forums-352ed5acf89331548e6cb1a5a32353364942f47c.tar.gz
forums-352ed5acf89331548e6cb1a5a32353364942f47c.tar.bz2
forums-352ed5acf89331548e6cb1a5a32353364942f47c.tar.xz
forums-352ed5acf89331548e6cb1a5a32353364942f47c.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/10101] Add test case for native phpass hashes [ticket/10101] Add support for native phpass hashes
Diffstat (limited to 'tests')
-rw-r--r--tests/security/hash_test.php21
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'));
+ }
+}
+