summaryrefslogtreecommitdiffstats
path: root/tests/unit/RandomIntTest.php
diff options
context:
space:
mode:
authorScott <scott@paragonie.com>2015-07-09 17:48:43 -0400
committerScott <scott@paragonie.com>2015-07-09 17:52:10 -0400
commit3a0c0c47bcd8fa9ffad2bd0c66aef48c70e6c1e8 (patch)
tree260a4c9821cbf16b424fe1abb7cf6e6e6ebdcbf8 /tests/unit/RandomIntTest.php
parent636247a8105c4fafaa3914526b458eb9d0d8bf74 (diff)
downloadrandom_compat-3a0c0c47bcd8fa9ffad2bd0c66aef48c70e6c1e8.zip
random_compat-3a0c0c47bcd8fa9ffad2bd0c66aef48c70e6c1e8.tar.gz
random_compat-3a0c0c47bcd8fa9ffad2bd0c66aef48c70e6c1e8.tar.bz2
Add unit tests for updated random_int()
Diffstat (limited to 'tests/unit/RandomIntTest.php')
-rw-r--r--tests/unit/RandomIntTest.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unit/RandomIntTest.php b/tests/unit/RandomIntTest.php
index c8e7719..5cb8ef1 100644
--- a/tests/unit/RandomIntTest.php
+++ b/tests/unit/RandomIntTest.php
@@ -12,13 +12,16 @@ class RandomIntTest extends PHPUnit_Framework_TestCase
random_int(0, 1000),
random_int(1001,2000),
random_int(-100, -10),
- random_int(-1000, 1000)
+ random_int(-1000, 1000),
+ random_int(-PHP_INT_MAX + 1, PHP_INT_MAX)
);
$this->assertFalse($integers[0] === $integers[1]);
$this->assertTrue($integers[0] >= 0 && $integers[0] <= 1000);
$this->assertTrue($integers[1] >= 1001 && $integers[1] <= 2000);
$this->assertTrue($integers[2] >= -100 && $integers[2] <= -10);
- $this->assertTrue($integers[2] >= -1000 && $integers[2] <= 1000);
+ $this->assertTrue($integers[3] >= -1000 && $integers[3] <= 1000);
+ $this->assertTrue($integers[3] >= -1000 && $integers[3] <= 1000);
+ $this->assertTrue($integers[4] >= -PHP_INT_MAX + 1 && $integers[4] <= PHP_INT_MAX);
}
}