Merge remote-tracking branch 'origin/master' into drizzle
[phpmyadmin.git] / test / PMA_STR_sub_test.php
blob640c7771159e2d8325ca4fd9e7a8778130c02251
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * tests for PMA_pow()
6 * @package phpMyAdmin-test
7 */
9 /**
12 require_once 'PHPUnit/Framework.php';
14 $match = array();
15 preg_match('@^([0-9]{1,2})(?:.([0-9]{1,2})(?:.([0-9]{1,2}))?)?@',
16 phpversion(), $match);
17 if (isset($match) && ! empty($match[1])) {
18 if (! isset($match[2])) {
19 $match[2] = 0;
21 if (! isset($match[3])) {
22 $match[3] = 0;
24 /**
25 * @ignore
27 define('PMA_PHP_INT_VERSION',
28 (int) sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
29 } else {
30 /**
31 * @ignore
33 define('PMA_PHP_INT_VERSION', 0);
36 require_once './libraries/string.lib.php';
38 /**
39 * @package phpMyAdmin-test
41 class PMA_STR_sub_test extends PHPUnit_Framework_TestCase
43 public function testMultiByte()
45 $this->assertEquals('čšě',
46 PMA_substr('čšěčščěš', 0, 3));