From e11f9afdce7649cebbe3f40d8af6ef62f8042434 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 13 Jul 2011 00:49:48 +0200 Subject: [ticket/10265] Move mt_rand.php to wrapper folder and add _test suffix. PHPBB3-10265 --- tests/random/mt_rand.php | 46 ------------------------------------------ tests/wrapper/mt_rand_test.php | 46 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 tests/random/mt_rand.php create mode 100644 tests/wrapper/mt_rand_test.php diff --git a/tests/random/mt_rand.php b/tests/random/mt_rand.php deleted file mode 100644 index d6502c4e80..0000000000 --- a/tests/random/mt_rand.php +++ /dev/null @@ -1,46 +0,0 @@ -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); - } -} 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 @@ +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); + } +} -- cgit v1.2.1