Aleksander Machniak
2015-06-17 3f4521bcf4b538b6ac54817cfad22b51e347546d
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)));
    }
}