From 378ee417b0bb8c513115f4b63c96b4757a0a51dd Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 18 Jan 2021 22:15:56 +0000 Subject: [PATCH] improve tests --- tests/PacryptTest.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/PacryptTest.php b/tests/PacryptTest.php index ccf89579..973f9197 100644 --- a/tests/PacryptTest.php +++ b/tests/PacryptTest.php @@ -25,11 +25,9 @@ public function testMySQLEncrypt() { $this->markTestSkipped('Not using MySQL'); } - $hash = _pacrypt_mysql_encrypt('test'); + $hash = _pacrypt_mysql_encrypt('test1'); - sleep(1); - - $hash2 = _pacrypt_mysql_encrypt('test'); + $hash2 = _pacrypt_mysql_encrypt('test2'); $this->assertNotEquals($hash, $hash2); @@ -37,11 +35,7 @@ public function testMySQLEncrypt() { $this->assertNotEquals('test', $hash); $this->assertNotEquals('test', $hash2); - $this->assertEquals( - $hash, - _pacrypt_mysql_encrypt('test', $hash), - "test should encrypt to : $hash ..." - ); + $this->assertTrue( hash_equals($hash, _pacrypt_mysql_encrypt('test1', $hash) ), "hashes should equal...."); } public function testAuthlib() {