Merge remote branch 'origin/master' into HEAD
[phpmyadmin/dkf.git] / test / PMA_STR_sub_test.php
blob957f2cb12d1aab53f5795bdc9e786079bb130f54
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * tests for PMA_pow()
6 * @version $Id$
7 * @package phpMyAdmin-test
8 */
10 /**
13 require_once 'PHPUnit/Framework.php';
15 $match = array();
16 preg_match('@^([0-9]{1,2})(?:.([0-9]{1,2})(?:.([0-9]{1,2}))?)?@',
17 phpversion(), $match);
18 if (isset($match) && ! empty($match[1])) {
19 if (! isset($match[2])) {
20 $match[2] = 0;
22 if (! isset($match[3])) {
23 $match[3] = 0;
25 /**
26 * @ignore
28 define('PMA_PHP_INT_VERSION',
29 (int) sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
30 } else {
31 /**
32 * @ignore
34 define('PMA_PHP_INT_VERSION', 0);
37 $GLOBALS['charset'] = 'UTF-8';
39 require_once './libraries/string.lib.php';
41 /**
42 * @package phpMyAdmin-test
44 class PMA_STR_sub_test extends PHPUnit_Framework_TestCase
46 public function testMultiByte()
48 $this->assertEquals('čšě',
49 PMA_substr('čšěčščěš', 0, 3));