Files
php-src/ext/intl/tests/rbbiter___construct_basic.phpt
NickSdot 7334dcf5cc Applied fixers to improve test robustness (ext/intl, ext/phar) (#22985)
This commit hardens tests in the phar and intl extension. By:
- Testing exception type in error tests, and formating them consistently.
- Removing useless blank lines
2026-08-01 19:05:24 +08:00

36 lines
710 B
PHP

--TEST--
IntlRuleBasedBreakIterator::__construct: basic test
--EXTENSIONS--
intl
--INI--
intl.default_locale=pt_PT
--FILE--
<?php
$rules = <<<RULES
\$LN = [[:letter:] [:number:]];
\$S = [.;,:];
!!forward;
\$LN+ {1};
\$S+ {42};
!!reverse;
\$LN+ {1};
\$S+ {42};
!!safe_forward;
!!safe_reverse;
RULES;
$rbbi = new IntlRuleBasedBreakIterator($rules);
var_dump(get_class($rbbi));
try {
$obj = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+', 'aoeu');
} catch (IntlException $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
string(26) "IntlRuleBasedBreakIterator"
IntlException: IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules