aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2018-06-17 15:44:28 +0200
committerMarc Alexander <admin@m-a-styles.de>2018-06-17 15:44:28 +0200
commit02cbb864a5b6df62e978a69c368c8ec5ca35d8a3 (patch)
treee604967ada13a1ec9c3a1674bdd5a6f85fce7d9d /tests
parent7245bc9977235d7165d35a5671ccb5b22fc042e2 (diff)
parent9e50e52fa5c72ee668c0d4c43b15e441f31ada5c (diff)
downloadforums-02cbb864a5b6df62e978a69c368c8ec5ca35d8a3.tar
forums-02cbb864a5b6df62e978a69c368c8ec5ca35d8a3.tar.gz
forums-02cbb864a5b6df62e978a69c368c8ec5ca35d8a3.tar.bz2
forums-02cbb864a5b6df62e978a69c368c8ec5ca35d8a3.tar.xz
forums-02cbb864a5b6df62e978a69c368c8ec5ca35d8a3.zip
Merge pull request #5245 from rubencm/ticket/15693
[ticket/15693] Fix get_rand_string()
Diffstat (limited to 'tests')
-rw-r--r--tests/random/gen_rand_string_test.php10
1 files changed, 8 insertions, 2 deletions
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);
}
}