From 1fc48289b3759191c4f912d532b3691bf42a1eb4 Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Mon, 7 Dec 2020 07:42:21 -0500 Subject: [PATCH] Don't run these tests without ext/sodium --- test/unit/HaliteTest.php | 3 +++ test/unit/UtilTest.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/unit/HaliteTest.php b/test/unit/HaliteTest.php index 6539e7e..4ed80dd 100644 --- a/test/unit/HaliteTest.php +++ b/test/unit/HaliteTest.php @@ -16,6 +16,9 @@ final class HaliteTest extends TestCase { public function testLibsodiumDetection() { + if (!\extension_loaded('sodium')) { + $this->markTestSkipped('Libsodium not installed'); + } $this->assertTrue( Halite::isLibsodiumSetupCorrectly() ); diff --git a/test/unit/UtilTest.php b/test/unit/UtilTest.php index efe9408..685fe4f 100644 --- a/test/unit/UtilTest.php +++ b/test/unit/UtilTest.php @@ -161,6 +161,9 @@ public function testBlake2bKDF() */ public function testSafeStrcpy() { + if (!\extension_loaded('sodium')) { + $this->markTestSkipped('Libsodium not installed'); + } $unique = random_bytes(128); $clone = Util::safeStrcpy($unique); $this->assertSame($unique, $clone);