home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / test / PMA_STR_sub_test.php < prev    next >
Encoding:
PHP Script  |  2008-06-23  |  979 b   |  43 lines

  1. <?php
  2. /* vim: expandtab sw=4 ts=4 sts=4: */
  3. /**
  4.  * tests for PMA_pow()
  5.  *
  6.  * @version $Id: PMA_pow_test.php 10140 2007-03-20 08:32:55Z cybot_tm $
  7.  * @package phpMyAdmin-test
  8.  */
  9.  
  10. /**
  11.  *
  12.  */
  13. require_once 'PHPUnit/Framework.php';
  14.  
  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;
  21.     }
  22.     if (! isset($match[3])) {
  23.         $match[3] = 0;
  24.     }
  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);
  29. }
  30.  
  31. $GLOBALS['charset'] = 'UTF-8';
  32.  
  33. require_once './libraries/string.lib.php';
  34.  
  35. class PMA_STR_sub_test extends PHPUnit_Framework_TestCase
  36. {
  37.     public function testMultiByte()
  38.     {
  39.         $this->assertEquals('─ì┼í─¢',
  40.             PMA_substr('─ì┼í─¢─ì┼í─ì─¢┼í', 0, 3));
  41.     }
  42. }
  43. ?>