aboutsummaryrefslogtreecommitdiffstats
path: root/tests/random/gen_rand_string_test.php
blob: 3317c78ed9ae60671798b0a9d67cf099061cd034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
*
* @package testing
* @copyright (c) 2010 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';

class phpbb_random_gen_rand_string_test extends phpbb_test_case
{
	const TEST_COUNT = 100;
	const MIN_STRING_LENGTH = 1;
	const MAX_STRING_LENGTH = 15;

	public function setUp()
	{
		global $config;

		if (!is_array($config))
		{
			$config = array();
		}

		$config['rand_seed'] = '';
		$config['rand_seed_last_update'] = time() + 600;
	}

	public function test_gen_rand_string()
	{
		for ($tests = 0; $tests <= self::TEST_COUNT; ++$tests)
		{
			for ($num_chars = self::MIN_STRING_LENGTH; $num_chars <= self::MAX_STRING_LENGTH; ++$num_chars)
			{
				$random_string = gen_rand_string($num_chars);
				$random_string_length = strlen($random_string);

				$this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH);
				$this->assertTrue($random_string_length <= $num_chars);
				$this->assertRegExp('#^[A-Z0-9]+$#', $random_string);
			}
		}
	}

	public function test_gen_rand_string_friendly()
	{
		for ($tests = 0; $tests <= self::TEST_COUNT; ++$tests)
		{
			for ($num_chars = self::MIN_STRING_LENGTH; $num_chars <= self::MAX_STRING_LENGTH; ++$num_chars)
			{
				$random_string = gen_rand_string_friendly($num_chars);
				$random_string_length = strlen($random_string);

				$this->assertTrue($random_string_length >= self::MIN_STRING_LENGTH);
				$this->assertTrue($random_string_length <= $num_chars);
				$this->assertRegExp('#^[A-NP-Z1-9]+$#', $random_string);
			}
		}
	}
}
bc5ef228d0a7aaca765958e7b34d3732295c67'>perl-install/share/po/el.po4464
-rw-r--r--perl-install/share/po/eo.po4374
-rw-r--r--perl-install/share/po/es.po4469
-rw-r--r--perl-install/share/po/et.po4460
-rw-r--r--perl-install/share/po/eu.po4463
-rw-r--r--perl-install/share/po/fa.po4465
-rw-r--r--perl-install/share/po/fi.po4466
-rw-r--r--perl-install/share/po/fr.po4471
-rw-r--r--perl-install/share/po/fur.po4255
-rw-r--r--perl-install/share/po/ga.po4313
-rw-r--r--perl-install/share/po/gl.po4428
-rw-r--r--perl-install/share/po/he.po4354
-rw-r--r--perl-install/share/po/hi.po4410
-rw-r--r--perl-install/share/po/hr.po4395
-rw-r--r--perl-install/share/po/hu.po4472
-rw-r--r--perl-install/share/po/id.po4472
-rw-r--r--perl-install/share/po/is.po4698
-rw-r--r--perl-install/share/po/it.po4467
-rw-r--r--perl-install/share/po/ja.po4552
-rw-r--r--perl-install/share/po/ko.po4374
-rw-r--r--perl-install/share/po/ky.po4300
-rw-r--r--perl-install/share/po/lt.po4359
-rw-r--r--perl-install/share/po/ltg.po4383
-rw-r--r--perl-install/share/po/lv.po4391
-rw-r--r--perl-install/share/po/mk.po4440
-rw-r--r--perl-install/share/po/mn.po4369
-rw-r--r--perl-install/share/po/ms.po8270
-rw-r--r--perl-install/share/po/mt.po4465
-rw-r--r--perl-install/share/po/nb.po4705
-rw-r--r--perl-install/share/po/nl.po4464
-rw-r--r--perl-install/share/po/nn.po4341
-rw-r--r--perl-install/share/po/pa_IN.po4419
-rw-r--r--perl-install/share/po/pl.po4468
-rw-r--r--perl-install/share/po/pt.po4758
-rw-r--r--perl-install/share/po/pt_BR.po4465
-rw-r--r--perl-install/share/po/ro.po4362
-rw-r--r--perl-install/share/po/ru.po4473
-rw-r--r--perl-install/share/po/sc.po4799
-rw-r--r--perl-install/share/po/sk.po4468
-rw-r--r--perl-install/share/po/sl.po4463
-rw-r--r--perl-install/share/po/sq.po4464
-rw-r--r--perl-install/share/po/sr.po4455
-rw-r--r--perl-install/share/po/sr@Latn.po4452
-rw-r--r--perl-install/share/po/sv.po4461
-rw-r--r--perl-install/share/po/ta.po4385
-rw-r--r--perl-install/share/po/tg.po4475
-rw-r--r--perl-install/share/po/th.po4352
-rw-r--r--perl-install/share/po/tl.po4479
-rw-r--r--perl-install/share/po/tr.po4413
-rw-r--r--perl-install/share/po/uk.po4469
-rw-r--r--perl-install/share/po/uz.po4361
-rw-r--r--perl-install/share/po/uz@Latn.po4365
-rw-r--r--perl-install/share/po/vi.po4460
-rw-r--r--perl-install/share/po/wa.po4493
-rw-r--r--perl-install/share/po/zh_CN.po4460
-rw-r--r--perl-install/share/po/zh_TW.po4393
61 files changed, 137321 insertions, 138227 deletions
diff --git a/perl-install/share/po/ca.po b/perl-install/share/po/ca.po
index 3e4d95eca..368aefdae 100644
--- a/perl-install/share/po/ca.po
+++ b/perl-install/share/po/ca.po