From a59d046c9df7c8e6e2f4acc14f6878b026a07edf Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 21 Oct 2017 12:25:13 -0500 Subject: [PATCH] Tests/BigInteger: add unit test for randomPrime --- tests/Unit/Math/BigInteger/TestCase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Unit/Math/BigInteger/TestCase.php b/tests/Unit/Math/BigInteger/TestCase.php index c0ac5464..174b008a 100644 --- a/tests/Unit/Math/BigInteger/TestCase.php +++ b/tests/Unit/Math/BigInteger/TestCase.php @@ -400,4 +400,11 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase $this->assertSame((string) $min, (string) $class::min($min, $max)); $this->assertSame((string) $min, (string) $class::min($max, $min)); } + + public function testRandomPrime() + { + $class = static::getStaticClass(); + $prime = $class::randomPrime(128); + $this->assertSame(128, $prime->getLength()); + } }