Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2020-11-11 00:33:43 +0300
committerGitHub <noreply@github.com>2020-11-11 00:33:43 +0300
commitb984ce602987468004cf75579055c7dcb350a1a0 (patch)
tree926244041a1c4a8a394d138affe2865a04a730b1 /tests
parentfece6d36114894005dba83b9d9880b5693038a2a (diff)
Add hash equals method (#16696)
Diffstat (limited to 'tests')
-rw-r--r--tests/PHPUnit/Unit/CommonTest.php12
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
*/