Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PMA_STR_sub_test.php « test - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 957f2cb12d1aab53f5795bdc9e786079bb130f54 (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
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * tests for PMA_pow()
 *
 * @version $Id$
 * @package phpMyAdmin-test
 */

/**
 *
 */
require_once 'PHPUnit/Framework.php';

$match = array();
preg_match('@^([0-9]{1,2})(?:.([0-9]{1,2})(?:.([0-9]{1,2}))?)?@',
        phpversion(), $match);
if (isset($match) && ! empty($match[1])) {
    if (! isset($match[2])) {
        $match[2] = 0;
    }
    if (! isset($match[3])) {
        $match[3] = 0;
    }
    /**
     * @ignore
     */
    define('PMA_PHP_INT_VERSION',
        (int) sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
} else {
    /**
     * @ignore
     */
    define('PMA_PHP_INT_VERSION', 0);
}

$GLOBALS['charset'] = 'UTF-8';

require_once './libraries/string.lib.php';

/**
 * @package phpMyAdmin-test
 */
class PMA_STR_sub_test extends PHPUnit_Framework_TestCase
{
    public function testMultiByte()
    {
        $this->assertEquals('čšě',
            PMA_substr('čšěčščěš', 0, 3));
    }
}
?>