From 8447bae77c19a2350bd48b0f0c5b3a56a35c7af9 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Sun, 28 Jun 2015 06:27:48 -0400 Subject: [PATCH] Require Mbstring and OpenSSL extensions (#1490415) - remove redundant code --- tests/Framework/Utils.php | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/Framework/Utils.php b/tests/Framework/Utils.php index 88cc70a..d5b853d 100644 --- a/tests/Framework/Utils.php +++ b/tests/Framework/Utils.php @@ -375,14 +375,18 @@ 'abc def' => 'abc def', 'ÇçäâàåæéêëèïîìÅÉöôòüûùÿøØáíóúñÑÁÂÀãÃÊËÈÍÎÏÓÔõÕÚÛÙýÝ' => 'ccaaaaaeeeeiiiaeooouuuyooaiounnaaaaaeeeiiioooouuuyy', 'ąáâäćçčéęëěíîłľĺńňóôöŕřśšşťţůúűüźžżýĄŚŻŹĆ' => 'aaaaccceeeeiilllnnooorrsssttuuuuzzzyaszzc', - 'ß' => '', 'ßs' => 'sss', 'Xae' => 'xa', 'Xoe' => 'xo', 'Xue' => 'xu', '项目' => '项目', - '日' => '', // FIXME: this should not be stripped although minlen = 2 ); + + // this test fails on PHP 5.3.3 + if (PHP_VERSION_ID > 50303) { + $test['ß'] = ''; + $test['日'] = ''; + } foreach ($test as $input => $output) { $result = rcube_utils::normalize_string($input); @@ -415,4 +419,16 @@ $this->assertSame($output, $result); } } + + /** + * rcube:utils::random_bytes() + */ + function test_random_bytes() + { + $this->assertSame(15, strlen(rcube_utils::random_bytes(15))); + $this->assertSame(15, strlen(rcube_utils::random_bytes(15, true))); + $this->assertSame(1, strlen(rcube_utils::random_bytes(1))); + $this->assertSame(0, strlen(rcube_utils::random_bytes(0))); + $this->assertSame(0, strlen(rcube_utils::random_bytes(-1))); + } } -- Gitblit v1.9.1