aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wrapper
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-07-16 22:24:07 -0400
committerNils Adermann <naderman@naderman.de>2011-07-16 22:24:07 -0400
commite9ae88338b48d0e6f301be115da11fe0388e43da (patch)
tree664cdde49f43955f161b2ba066c9b58432635c8d /tests/wrapper
parent82fa4eff7ebcc10b808de9dacb7520ad0d2e1df1 (diff)
parente11f9afdce7649cebbe3f40d8af6ef62f8042434 (diff)
downloadforums-e9ae88338b48d0e6f301be115da11fe0388e43da.tar
forums-e9ae88338b48d0e6f301be115da11fe0388e43da.tar.gz
forums-e9ae88338b48d0e6f301be115da11fe0388e43da.tar.bz2
forums-e9ae88338b48d0e6f301be115da11fe0388e43da.tar.xz
forums-e9ae88338b48d0e6f301be115da11fe0388e43da.zip
Merge remote-tracking branch 'github-bantu/ticket/10265' into develop-olympus
* github-bantu/ticket/10265: [ticket/10265] Move mt_rand.php to wrapper folder and add _test suffix.
Diffstat (limited to 'tests/wrapper')
-rw-r--r--tests/wrapper/mt_rand_test.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/wrapper/mt_rand_test.php b/tests/wrapper/mt_rand_test.php
new file mode 100644
index 0000000000..c8bcb3d14c
--- /dev/null
+++ b/tests/wrapper/mt_rand_test.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2011 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_wrapper_mt_rand_test extends phpbb_test_case
+{
+ public function test_max_equals_min()
+ {
+ $result = phpbb_mt_rand(42, 42);
+ $this->assertEquals(42, $result);
+ }
+
+ public function test_max_equals_min_negative()
+ {
+ $result = phpbb_mt_rand(-42, -42);
+ $this->assertEquals(-42, $result);
+ }
+
+ public function test_max_greater_min()
+ {
+ $result = phpbb_mt_rand(3, 4);
+ $this->assertGreaterThanOrEqual(3, $result);
+ $this->assertLessThanOrEqual(4, $result);
+ }
+
+ public function test_min_greater_max()
+ {
+ $result = phpbb_mt_rand(4, 3);
+ $this->assertGreaterThanOrEqual(3, $result);
+ $this->assertLessThanOrEqual(4, $result);
+ }
+
+ public function test_min_greater_max_negative()
+ {
+ $result = phpbb_mt_rand(-3, -4);
+ $this->assertGreaterThanOrEqual(-4, $result);
+ $this->assertLessThanOrEqual(-3, $result);
+ }
+}