mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/13203] Add method for byte by byte comparison to drivers helper
PHPBB3-13203
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user