php-src/ext/pcre/tests/locales.phpt
Felipe Pena 3ed829f10e - Added some UEXPECTs
- Fixed some tests
2008-03-22 14:58:29 +00:00

37 lines
1.0 KiB
PHP

--TEST--
Localized match
--SKIPIF--
<?php if (!function_exists('setlocale')) die('skip: setlocale() not available'); ?>
<?php if (!@setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese')) die('skip pt locale not available');
--FILE--
<?php
declare(encoding='latin1');
// this tests if the cache is working correctly, as the char tables
// must be rebuilt after the locale change
setlocale(LC_ALL, 'C', 'POSIX');
var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
setlocale(LC_ALL, 'pt_PT', 'pt', 'pt_PT.ISO8859-1', 'portuguese');
var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
setlocale(LC_ALL, 'C', 'POSIX');
var_dump(preg_match('/^\w{6}$/', 'aàáçéè'));
?>
--EXPECT--
int(0)
int(1)
int(0)
--UEXPECTF--
Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d
int(0)
Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d
int(1)
Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d
int(0)