Translated using Weblate.
[phpmyadmin.git] / test / libraries / PMA_STR_sub_test.php
blob1febef995ae56db99a03004474d8734344c7150a
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * tests for PMA_pow()
6 * @package PhpMyAdmin-test
7 */
9 $match = array();
10 preg_match('@^([0-9]{1,2})(?:.([0-9]{1,2})(?:.([0-9]{1,2}))?)?@',
11 phpversion(), $match);
12 if (isset($match) && ! empty($match[1])) {
13 if (! isset($match[2])) {
14 $match[2] = 0;
16 if (! isset($match[3])) {
17 $match[3] = 0;
19 /**
20 * @ignore
22 define('PMA_PHP_INT_VERSION',
23 (int) sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
24 } else {
25 /**
26 * @ignore
28 define('PMA_PHP_INT_VERSION', 0);
31 require_once 'libraries/string.lib.php';
33 class PMA_STR_sub_test extends PHPUnit_Framework_TestCase
35 public function testMultiByte()
37 $this->assertEquals('čšě',
38 PMA_substr('čšěčščěš', 0, 3));