From 9aae1b7fc399b5d2cecb8f0d0df6a2ae4e749786 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 26 Jun 2015 03:20:43 -0400
Subject: [PATCH] Fix so microseconds macro (u) in log_date_format works (#1490446)

---
 tests/Framework/Utils.php |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tests/Framework/Utils.php b/tests/Framework/Utils.php
index 88cc70a..b9b99ff 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,15 @@
             $this->assertSame($output, $result);
         }
     }
+
+    /**
+     * rcube:utils::random_bytes()
+     */
+    function test_random_bytes()
+    {
+        $this->assertSame(15, strlen(rcube_utils::random_bytes(15)));
+        $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