aboutsummaryrefslogtreecommitdiffstats
path: root/tests/passwords
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-10-22 14:54:22 -0500
committerMarc Alexander <admin@m-a-styles.de>2014-10-22 14:54:22 -0500
commit2b47ef1266a04ae0bf692a1568687968e8e2b827 (patch)
tree9ed4ba519fe1223ed37ddc1bda6176dcdc46536a /tests/passwords
parente43d1781bf17c9265f075dfc0cc38d807fe3b70e (diff)
downloadforums-2b47ef1266a04ae0bf692a1568687968e8e2b827.tar
forums-2b47ef1266a04ae0bf692a1568687968e8e2b827.tar.gz
forums-2b47ef1266a04ae0bf692a1568687968e8e2b827.tar.bz2
forums-2b47ef1266a04ae0bf692a1568687968e8e2b827.tar.xz
forums-2b47ef1266a04ae0bf692a1568687968e8e2b827.zip
[ticket/13203] Add method for byte by byte comparison to drivers helper
PHPBB3-13203
Diffstat (limited to 'tests/passwords')
-rw-r--r--tests/passwords/manager_test.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php
index e46cf820f2..f9f7f99751 100644
--- a/tests/passwords/manager_test.php
+++ b/tests/passwords/manager_test.php
@@ -326,4 +326,22 @@ class phpbb_passwords_manager_test extends \phpbb_test_case
$this->assertFalse($this->manager->hash(str_repeat('a', 1024 * 1024 * 16)));
$this->assertLessThanOrEqual(5, time() - $start_time);
}
+
+ public function data_test_string_compare()
+ {
+ return array(
+ array('foo', 'bar', false),
+ array(1, '1', false),
+ array('one', 'one', true),
+ array('foobar', 'foobaf', false),
+ );
+ }
+
+ /**
+ * @dataProvider data_test_string_compare
+ */
+ public function test_string_compare($a, $b, $expected)
+ {
+ $this->assertSame($expected, $this->driver_helper->string_compare($a, $b));
+ }
}