diff --git a/tests/Unit/Math/BigInteger/TestCase.php b/tests/Unit/Math/BigInteger/TestCase.php index 5b86645e..87addfd4 100644 --- a/tests/Unit/Math/BigInteger/TestCase.php +++ b/tests/Unit/Math/BigInteger/TestCase.php @@ -266,7 +266,7 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase $this->assertSame('18446744073709551616', (string) $y); } - public function testRandom() + public function testRandomTwoArgument() { $min = $this->getInstance(0); $max = $this->getInstance('18446744073709551616'); @@ -276,11 +276,21 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase // chosen it's just not that likely $this->assertTrue($rand1->compare($min) > 0); $this->assertTrue($rand1->compare($max) < 0); + } - $rand2 = $min->random($max); + public function testRandomOneArgument() + { + $min = $this->getInstance(0); + $max = $this->getInstance('18446744073709551616'); + + $rand1 = $min->random($max); $this->assertTrue($rand1->compare($min) > 0); $this->assertTrue($rand1->compare($max) < 0); + $rand2 = $max->random($min); + $this->assertTrue($rand2->compare($min) > 0); + $this->assertTrue($rand2->compare($max) < 0); + $this->assertFalse($rand1->equals($rand2)); }