52 lines
968 B
PHP
52 lines
968 B
PHP
<?php
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
/**
|
|
* tests for PMA_pow()
|
|
*
|
|
* @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));
|
|
}
|
|
}
|
|
?>
|