3.1.3 release
[phpmyadmin/crack.git] / test / PMA_STR_sub_test.php
blob0ed9de428d02f35ddd77962572beb12a2f8150b0
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 define('PMA_PHP_INT_VERSION',
26 (int) sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
27 } else {
28 define('PMA_PHP_INT_VERSION', 0);
31 $GLOBALS['charset'] = 'UTF-8';
33 require_once './libraries/string.lib.php';
35 class PMA_STR_sub_test extends PHPUnit_Framework_TestCase
37 public function testMultiByte()
39 $this->assertEquals('čšě',
40 PMA_substr('čšěčščěš', 0, 3));