3.3
This commit is contained in:
52
test/PMA_STR_sub_test.php
Normal file
52
test/PMA_STR_sub_test.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for PMA_pow()
|
||||
*
|
||||
* @version $Id$
|
||||
* @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));
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user