From 14e8113fcf01be7dbdb080458fcbf4e75668cc1a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 31 Mar 2016 11:06:47 -0700 Subject: [ticket/14576] Move common required files to bootstrap PHPBB3-14576 --- tests/random/gen_rand_string_test.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/random') diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php index 1d12d0622c..a9d1ea20de 100644 --- a/tests/random/gen_rand_string_test.php +++ b/tests/random/gen_rand_string_test.php @@ -11,8 +11,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; - class phpbb_random_gen_rand_string_test extends phpbb_test_case { const TEST_COUNT = 100; -- cgit v1.2.1 From 9e50e52fa5c72ee668c0d4c43b15e441f31ada5c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 17 Jun 2018 11:01:11 +0200 Subject: [ticket/15693] Update tests to reflect changes to gen_rand_string() PHPBB3-15693 --- tests/random/gen_rand_string_test.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests/random') diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php index a9d1ea20de..428db6ac98 100644 --- a/tests/random/gen_rand_string_test.php +++ b/tests/random/gen_rand_string_test.php @@ -40,7 +40,10 @@ class phpbb_random_gen_rand_string_test extends phpbb_test_case $random_string_length = strlen($random_string); $this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH); - $this->assertTrue($random_string_length <= $num_chars); + $this->assertTrue( + $random_string_length == $num_chars, + sprintf('Failed asserting that random string length matches expected length. Expected %1$u, Actual %2$u', $num_chars, $random_string_length) + ); $this->assertRegExp('#^[A-Z0-9]+$#', $random_string); } } @@ -56,7 +59,10 @@ class phpbb_random_gen_rand_string_test extends phpbb_test_case $random_string_length = strlen($random_string); $this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH); - $this->assertTrue($random_string_length <= $num_chars); + $this->assertTrue( + $random_string_length == $num_chars, + sprintf('Failed asserting that random string length matches expected length. Expected %1$u, Actual %2$u', $num_chars, $random_string_length) + ); $this->assertRegExp('#^[A-NP-Z1-9]+$#', $random_string); } } -- cgit v1.2.1