diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-11-11 00:33:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 00:33:43 +0300 |
commit | b984ce602987468004cf75579055c7dcb350a1a0 (patch) | |
tree | 926244041a1c4a8a394d138affe2865a04a730b1 /tests | |
parent | fece6d36114894005dba83b9d9880b5693038a2a (diff) |
Add hash equals method (#16696)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Unit/CommonTest.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/PHPUnit/Unit/CommonTest.php b/tests/PHPUnit/Unit/CommonTest.php index 5dbdd4112f..d01315778e 100644 --- a/tests/PHPUnit/Unit/CommonTest.php +++ b/tests/PHPUnit/Unit/CommonTest.php @@ -32,6 +32,18 @@ class CommonTest extends TestCase $this->assertEquals(getmypid(), Common::getProcessId()); } + public function test_hashEquals() + { + $this->assertFalse(Common::hashEquals('foo', 'bar')); + $this->assertFalse(Common::hashEquals('foo', 'fo')); + $this->assertFalse(Common::hashEquals('foo', 'fooo')); + $this->assertFalse(Common::hashEquals('foo', 'foa')); + $this->assertFalse(Common::hashEquals('foo', 'eoo')); + $this->assertFalse(Common::hashEquals('foo', '')); + $this->assertFalse(Common::hashEquals('', 'bar')); + $this->assertTrue(Common::hashEquals('foo', 'foo')); + } + /** * Dataprovider for testSanitizeInputValues */ |