mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Add Intl prefix to BreakIterator/RuleBasedBI
This commit is contained in:
parent
87dd0269ba
commit
cee31091a9
31 changed files with 137 additions and 137 deletions
|
@ -296,7 +296,7 @@ static const zend_function_entry BreakIterator_class_functions[] = {
|
|||
/* {{{ RuleBasedBreakIterator_class_functions
|
||||
*/
|
||||
static const zend_function_entry RuleBasedBreakIterator_class_functions[] = {
|
||||
PHP_ME(RuleBasedBreakIterator, __construct, ainfo_rbbi___construct, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(IntlRuleBasedBreakIterator, __construct, ainfo_rbbi___construct, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getRules, rbbi_get_rules, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getRuleStatus, rbbi_get_rule_status, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
PHP_ME_MAPPING(getRuleStatusVec, rbbi_get_rule_status_vec, ainfo_biter_void, ZEND_ACC_PUBLIC)
|
||||
|
@ -314,12 +314,12 @@ void breakiterator_register_BreakIterator_class(TSRMLS_D)
|
|||
zend_class_entry ce;
|
||||
|
||||
/* Create and register 'BreakIterator' class. */
|
||||
INIT_CLASS_ENTRY(ce, "BreakIterator", BreakIterator_class_functions);
|
||||
INIT_CLASS_ENTRY(ce, "IntlBreakIterator", BreakIterator_class_functions);
|
||||
ce.create_object = BreakIterator_object_create;
|
||||
ce.get_iterator = _breakiterator_get_iterator;
|
||||
BreakIterator_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
|
||||
memcpy( &BreakIterator_handlers, zend_get_std_object_handlers(),
|
||||
memcpy(&BreakIterator_handlers, zend_get_std_object_handlers(),
|
||||
sizeof BreakIterator_handlers);
|
||||
BreakIterator_handlers.compare_objects = BreakIterator_compare_objects;
|
||||
BreakIterator_handlers.clone_obj = BreakIterator_clone_obj;
|
||||
|
@ -361,7 +361,7 @@ void breakiterator_register_BreakIterator_class(TSRMLS_D)
|
|||
|
||||
|
||||
/* Create and register 'RuleBasedBreakIterator' class. */
|
||||
INIT_CLASS_ENTRY(ce, "RuleBasedBreakIterator",
|
||||
INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator",
|
||||
RuleBasedBreakIterator_class_functions);
|
||||
RuleBasedBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
|
||||
BreakIterator_ce_ptr, NULL TSRMLS_CC);
|
||||
|
|
|
@ -84,7 +84,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
|
|||
breakiterator_object_create(return_value, rbbi TSRMLS_CC);
|
||||
}
|
||||
|
||||
U_CFUNC PHP_METHOD(RuleBasedBreakIterator, __construct)
|
||||
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
|
||||
{
|
||||
zval orig_this = *getThis();
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include <php.h>
|
||||
|
||||
PHP_METHOD(RuleBasedBreakIterator, __construct);
|
||||
PHP_METHOD(IntlRuleBasedBreakIterator, __construct);
|
||||
|
||||
PHP_FUNCTION(rbbi_get_rules);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
BreakIterator::__construct() should not be callable
|
||||
IntlBreakIterator::__construct() should not be callable
|
||||
--SKIPIF--
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
|
@ -7,7 +7,7 @@ if (!extension_loaded('intl'))
|
|||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
new BreakIterator();
|
||||
new IntlBreakIterator();
|
||||
--EXPECTF--
|
||||
|
||||
Fatal error: Call to private BreakIterator::__construct() from invalid context in %s on line %d
|
||||
Fatal error: Call to private IntlBreakIterator::__construct() from invalid context in %s on line %d
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
--TEST--
|
||||
RuleBasedBreakIterator::__construct(): arg errors
|
||||
IntlRuleBasedBreakIterator::__construct(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
//missing ; at the end:
|
||||
var_dump(new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+'));
|
||||
var_dump(new RuleBasedBreakiterator());
|
||||
var_dump(new RuleBasedBreakiterator(1,2,3));
|
||||
var_dump(new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+;', array()));
|
||||
var_dump(new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+;', true));
|
||||
var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+'));
|
||||
var_dump(new IntlRuleBasedBreakIterator());
|
||||
var_dump(new IntlRuleBasedBreakIterator(1,2,3));
|
||||
var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', array()));
|
||||
var_dump(new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;', true));
|
||||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct() expects at least 1 parameter, 0 given in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct() expects at least 1 parameter, 0 given in %s on line %d
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct(): rbbi_create_instance: bad arguments in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct() expects at most 2 parameters, 3 given in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct() expects at most 2 parameters, 3 given in %s on line %d
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct(): rbbi_create_instance: bad arguments in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct() expects parameter 2 to be boolean, array given in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct() expects parameter 2 to be boolean, array given in %s on line %d
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct(): rbbi_create_instance: bad arguments in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: RuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to creaete instance from compiled rules in %s on line %d
|
||||
Warning: IntlRuleBasedBreakIterator::__construct(): rbbi_create_instance: unable to creaete instance from compiled rules in %s on line %d
|
||||
NULL
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
--TEST--
|
||||
BreakIterator: clone handler
|
||||
IntlBreakIterator: clone handler
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi_clone = clone $bi;
|
||||
var_dump(get_class($bi), get_class($bi_clone));
|
||||
var_dump($bi == $bi_clone);
|
||||
|
@ -15,9 +15,9 @@ var_dump(get_class($bi), get_class($bi_clone));
|
|||
var_dump($bi == $bi_clone);
|
||||
|
||||
--EXPECT--
|
||||
string(22) "RuleBasedBreakIterator"
|
||||
string(22) "RuleBasedBreakIterator"
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
bool(true)
|
||||
string(22) "RuleBasedBreakIterator"
|
||||
string(22) "RuleBasedBreakIterator"
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
bool(true)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::current(): basic test
|
||||
IntlBreakIterator::current(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
var_dump($bi->current());
|
||||
$bi->setText('foo bar trans zoo bee');
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
BreakIterator factories: basic tests
|
||||
IntlBreakIterator factories: basic tests
|
||||
--SKIPIF--
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
|
@ -16,9 +16,9 @@ $t = 'Frase 1... Frase 2'.
|
|||
$o1 = $o2 = null;
|
||||
foreach ($m as $method) {
|
||||
echo "===== $method =====\n";
|
||||
$o1 = call_user_func(array('Breakiterator', $method), 'ja');
|
||||
$o1 = call_user_func(array('IntlBreakIterator', $method), 'ja');
|
||||
var_dump($o1 == $o2);
|
||||
$o2 = call_user_func(array('Breakiterator', $method), NULL);
|
||||
$o2 = call_user_func(array('IntlBreakIterator', $method), NULL);
|
||||
var_dump($o1 == $o2);
|
||||
echo "\n";
|
||||
}
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
--TEST--
|
||||
BreakIterator factory methods: argument errors
|
||||
IntlBreakIterator factory methods: argument errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
var_dump(BreakIterator::createWordInstance(array()));
|
||||
var_dump(BreakIterator::createSentenceInstance(NULL, 2));
|
||||
var_dump(BreakIterator::createCharacterInstance(NULL, 2));
|
||||
var_dump(BreakIterator::createTitleInstance(NULL, 2));
|
||||
var_dump(BreakIterator::createLineInstance(NULL, 2));
|
||||
var_dump(IntlBreakIterator::createWordInstance(array()));
|
||||
var_dump(IntlBreakIterator::createSentenceInstance(NULL, 2));
|
||||
var_dump(IntlBreakIterator::createCharacterInstance(NULL, 2));
|
||||
var_dump(IntlBreakIterator::createTitleInstance(NULL, 2));
|
||||
var_dump(IntlBreakIterator::createLineInstance(NULL, 2));
|
||||
|
||||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::createWordInstance() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: IntlBreakIterator::createWordInstance() expects parameter 1 to be string, array given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::createWordInstance(): breakiter_create_word_instance: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::createWordInstance(): breakiter_create_word_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: BreakIterator::createSentenceInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createSentenceInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::createSentenceInstance(): breakiter_create_sentence_instance: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::createSentenceInstance(): breakiter_create_sentence_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: BreakIterator::createCharacterInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createCharacterInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::createCharacterInstance(): breakiter_create_character_instance: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::createCharacterInstance(): breakiter_create_character_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: BreakIterator::createTitleInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createTitleInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::createTitleInstance(): breakiter_create_title_instance: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::createTitleInstance(): breakiter_create_title_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: BreakIterator::createLineInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::createLineInstance() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::createLineInstance(): breakiter_create_line_instance: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::createLineInstance(): breakiter_create_line_instance: bad arguments in %s on line %d
|
||||
NULL
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
BreakIterator::first(): basic test
|
||||
IntlBreakIterator::first(): basic test
|
||||
--SKIPIF--
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
|
@ -7,7 +7,7 @@ if (!extension_loaded('intl'))
|
|||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans');
|
||||
|
||||
var_dump($bi->current());
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
--TEST--
|
||||
BreakIterator::first()/last()/previous()/current(): arg errors
|
||||
IntlBreakIterator::first()/last()/previous()/current(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi->setText("\x80sdfé\x90d888 dfsa9");
|
||||
|
||||
var_dump($bi->first(1));
|
||||
|
@ -14,22 +14,22 @@ var_dump($bi->current(1));
|
|||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::first() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
Warning: IntlBreakIterator::first() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::first(): breakiter_first: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::first(): breakiter_first: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::last() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
Warning: IntlBreakIterator::last() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::last(): breakiter_last: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::last(): breakiter_last: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::previous() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
Warning: IntlBreakIterator::previous() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::previous(): breakiter_previous: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::previous(): breakiter_previous: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::current() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
Warning: IntlBreakIterator::current() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::current(): breakiter_current: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::current(): breakiter_current: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::following(): basic test
|
||||
IntlBreakIterator::following(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans zoo bee');
|
||||
|
||||
var_dump($bi->following(5));
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
--TEST--
|
||||
BreakIterator::following()/preceding()/isBoundary(): arg errors
|
||||
IntlBreakIterator::following()/preceding()/isBoundary(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi->setText("\x80sdfé\x90d888 dfsa9");
|
||||
|
||||
var_dump($bi->following(1, 2));
|
||||
|
@ -16,32 +16,32 @@ var_dump($bi->isBoundary(array()));
|
|||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::following() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::following() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::following(): breakiter_following: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::following(): breakiter_following: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::following() expects parameter 1 to be long, array given in %s on line %d
|
||||
Warning: IntlBreakIterator::following() expects parameter 1 to be long, array given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::following(): breakiter_following: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::following(): breakiter_following: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::preceding() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::preceding() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::preceding(): breakiter_preceding: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::preceding(): breakiter_preceding: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::preceding() expects parameter 1 to be long, array given in %s on line %d
|
||||
Warning: IntlBreakIterator::preceding() expects parameter 1 to be long, array given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::preceding(): breakiter_preceding: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::preceding(): breakiter_preceding: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::isBoundary() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::isBoundary() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::isBoundary(): breakiter_is_boundary: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::isBoundary(): breakiter_is_boundary: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::isBoundary() expects parameter 1 to be long, array given in %s on line %d
|
||||
Warning: IntlBreakIterator::isBoundary() expects parameter 1 to be long, array given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::isBoundary(): breakiter_is_boundary: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::isBoundary(): breakiter_is_boundary: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::getLocale(): basic test
|
||||
IntlBreakIterator::getLocale(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createSentenceInstance('pt');
|
||||
$bi = IntlBreakIterator::createSentenceInstance('pt');
|
||||
|
||||
var_dump($bi->getLocale(0));
|
||||
var_dump($bi->getLocale(1));
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
--TEST--
|
||||
BreakIterator::getLocale(): arg errors
|
||||
IntlBreakIterator::getLocale(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi->setText("\x80sdfé\x90d888 dfsa9");
|
||||
|
||||
var_dump($bi->getLocale(1, 2));
|
||||
|
@ -13,17 +13,17 @@ var_dump($bi->getLocale());
|
|||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::getLocale() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::getLocale() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::getLocale() expects parameter 1 to be long, array given in %s on line %d
|
||||
Warning: IntlBreakIterator::getLocale() expects parameter 1 to be long, array given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::getLocale() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
Warning: IntlBreakIterator::getLocale() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::getLocale(): breakiter_get_locale: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::getPartsIterator(): basic test
|
||||
IntlBreakIterator::getPartsIterator(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$pi = $bi->getPartsIterator();
|
||||
var_dump(get_class($pi));
|
||||
print_r(iterator_to_array($pi));
|
||||
|
@ -22,7 +22,7 @@ string(17) "IntlPartsIterator"
|
|||
Array
|
||||
(
|
||||
)
|
||||
string(22) "RuleBasedBreakIterator"
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
Array
|
||||
(
|
||||
[0] => foo
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
BreakIterator::getText(): basic test
|
||||
IntlBreakIterator::getText(): basic test
|
||||
--SKIPIF--
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
|
@ -7,7 +7,7 @@ if (!extension_loaded('intl'))
|
|||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
var_dump($bi->getText());
|
||||
$bi->setText('foo bar');
|
||||
var_dump($bi->getText());
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
--TEST--
|
||||
BreakIterator::getText(): arg errors
|
||||
IntlBreakIterator::getText(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = new RuleBasedBreakiterator('[\p{Letter}]+;');
|
||||
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}]+;');
|
||||
var_dump($bi->getText(array()));
|
||||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::getText() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
Warning: IntlBreakIterator::getText() expects exactly 0 parameters, 1 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::getText(): breakiter_get_text: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::getText(): breakiter_get_text: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::isBoundary(): basic test
|
||||
IntlBreakIterator::isBoundary(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans zoo bee');
|
||||
|
||||
var_dump($bi->isBoundary(0));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
BreakIterator::last(): basic test
|
||||
IntlBreakIterator::last(): basic test
|
||||
--SKIPIF--
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
|
@ -7,7 +7,7 @@ if (!extension_loaded('intl'))
|
|||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans');
|
||||
|
||||
var_dump($bi->current());
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::next(): basic test
|
||||
IntlBreakIterator::next(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans zoo bee');
|
||||
|
||||
var_dump($bi->first());
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
--TEST--
|
||||
BreakIterator::next(): arg errors
|
||||
IntlBreakIterator::next(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = new RuleBasedBreakiterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+;');
|
||||
$bi->setText("\x80sdfé\x90d888 dfsa9");
|
||||
|
||||
var_dump($bi->next(1, 2));
|
||||
|
@ -12,12 +12,12 @@ var_dump($bi->next(array()));
|
|||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::next() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::next() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::next(): breakiter_next: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::next(): breakiter_next: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::next() expects parameter 1 to be long, array given in %s on line %d
|
||||
Warning: IntlBreakIterator::next() expects parameter 1 to be long, array given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::next(): breakiter_next: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::next(): breakiter_next: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::preceding(): basic test
|
||||
IntlBreakIterator::preceding(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans zoo bee');
|
||||
|
||||
var_dump($bi->preceding(5));
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
--TEST--
|
||||
BreakIterator::previous(): basic test
|
||||
IntlBreakIterator::previous(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
$bi->setText('foo bar trans');
|
||||
|
||||
var_dump($bi->last());
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
BreakIterator::setText(): basic test
|
||||
IntlBreakIterator::setText(): basic test
|
||||
--SKIPIF--
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
|
@ -11,7 +11,7 @@ class A {
|
|||
function __tostring() { return 'aaa'; }
|
||||
}
|
||||
|
||||
$bi = BreakIterator::createWordInstance('pt');
|
||||
$bi = IntlBreakIterator::createWordInstance('pt');
|
||||
var_dump($bi->setText('foo bar'));
|
||||
var_dump($bi->getText());
|
||||
var_dump($bi->setText(1));
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
--TEST--
|
||||
BreakIterator::setText(): arg errors
|
||||
IntlBreakIterator::setText(): arg errors
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$bi = new RuleBasedBreakiterator('[\p{Letter}]+;');
|
||||
$bi = new IntlRuleBasedBreakIterator('[\p{Letter}]+;');
|
||||
var_dump($bi->setText());
|
||||
var_dump($bi->setText(array()));
|
||||
var_dump($bi->setText(1,2));
|
||||
|
@ -22,19 +22,19 @@ var_dump($e->getMessage());
|
|||
|
||||
--EXPECTF--
|
||||
|
||||
Warning: BreakIterator::setText() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::setText() expects parameter 1 to be string, array given in %s on line %d
|
||||
Warning: IntlBreakIterator::setText() expects parameter 1 to be string, array given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
|
||||
Warning: BreakIterator::setText() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
Warning: IntlBreakIterator::setText() expects exactly 1 parameter, 2 given in %s on line %d
|
||||
|
||||
Warning: BreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
|
||||
Warning: IntlBreakIterator::setText(): breakiter_set_text: bad arguments in %s on line %d
|
||||
bool(false)
|
||||
string(10) "destructed"
|
||||
string(1) "e"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
RuleBasedBreakIterator::__construct: basic test
|
||||
IntlRuleBasedBreakIterator::__construct: basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
@ -18,10 +18,10 @@ $rules = <<<RULES
|
|||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new RuleBasedBreakIterator($rules);
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump(get_class($rbbi));
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
string(22) "RuleBasedBreakIterator"
|
||||
string(26) "IntlRuleBasedBreakIterator"
|
||||
==DONE==
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
RuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
@ -18,12 +18,12 @@ $rules = <<<RULES
|
|||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new RuleBasedBreakIterator($rules);
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');;
|
||||
|
||||
$br = $rbbi->getBinaryRules();
|
||||
|
||||
$rbbi2 = new RuleBasedBreakIterator($br, true);
|
||||
$rbbi2 = new IntlRuleBasedBreakIterator($br, true);
|
||||
|
||||
var_dump($rbbi->getRules(), $rbbi2->getRules());
|
||||
var_dump($rbbi->getRules() == $rbbi2->getRules());
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
RuleBasedBreakIterator::getRuleStatusVec(): basic test
|
||||
IntlRuleBasedBreakIterator::getRuleStatusVec(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
@ -20,12 +20,12 @@ $rules = <<<RULES
|
|||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new RuleBasedBreakIterator($rules);
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');;
|
||||
|
||||
do {
|
||||
var_dump($rbbi->current(), $rbbi->getRuleStatusVec());
|
||||
} while ($rbbi->next() != BreakIterator::DONE);
|
||||
} while ($rbbi->next() != IntlBreakIterator::DONE);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
RuleBasedBreakIterator::getRuleStatus(): basic test
|
||||
IntlRuleBasedBreakIterator::getRuleStatus(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
@ -18,13 +18,13 @@ $rules = <<<RULES
|
|||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new RuleBasedBreakIterator($rules);
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
$rbbi->setText('sdfkjsdf88á.... ,;');
|
||||
|
||||
do {
|
||||
echo "pos : {$rbbi->current()}\n",
|
||||
"rule status: {$rbbi->getRuleStatus()}\n";
|
||||
} while ($rbbi->next() != BreakIterator::DONE);
|
||||
} while ($rbbi->next() != IntlBreakIterator::DONE);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--TEST--
|
||||
RuleBasedBreakIterator::getRules(): basic test
|
||||
IntlRuleBasedBreakIterator::getRules(): basic test
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
@ -18,7 +18,7 @@ $rules = <<<RULES
|
|||
!!safe_forward;
|
||||
!!safe_reverse;
|
||||
RULES;
|
||||
$rbbi = new RuleBasedBreakIterator($rules);
|
||||
$rbbi = new IntlRuleBasedBreakIterator($rules);
|
||||
var_dump($rbbi->getRules());
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue