mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
convert a few more functions to unicode and adapt the tests as well
This commit is contained in:
parent
fc91929f94
commit
eb5343ee47
3 changed files with 33 additions and 6 deletions
|
@ -19,3 +19,7 @@ tidy.default_config=
|
||||||
Current Value of 'tidy-mark': bool(false)
|
Current Value of 'tidy-mark': bool(false)
|
||||||
Current Value of 'error-file': string(0) ""
|
Current Value of 'error-file': string(0) ""
|
||||||
Current Value of 'tab-size': int(8)
|
Current Value of 'tab-size': int(8)
|
||||||
|
--UEXPECT--
|
||||||
|
Current Value of 'tidy-mark': bool(false)
|
||||||
|
Current Value of 'error-file': unicode(0) ""
|
||||||
|
Current Value of 'tab-size': int(8)
|
||||||
|
|
23
ext/tidy/tests/021.phpt
Normal file
23
ext/tidy/tests/021.phpt
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
--TEST--
|
||||||
|
tidy_get_opt_doc()
|
||||||
|
--SKIPIF--
|
||||||
|
<?php if (!extension_loaded("tidy") || !function_exists('tidy_get_opt_doc')) print "skip"; ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
var_dump(tidy_get_opt_doc(new tidy, 'some_bogus_cfg'));
|
||||||
|
|
||||||
|
$t = new tidy;
|
||||||
|
var_dump($t->getOptDoc('ncr'));
|
||||||
|
var_dump(strlen(tidy_get_opt_doc($t, 'wrap')) > 99);
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
Warning: tidy_get_opt_doc(): Unknown Tidy Configuration Option 'some_bogus_cfg' in /cvs/php-src/ext/tidy/tests/021.php on line 3
|
||||||
|
bool(false)
|
||||||
|
string(73) "This option specifies if Tidy should allow numeric character references. "
|
||||||
|
bool(true)
|
||||||
|
--UEXPECT--
|
||||||
|
Warning: tidy_get_opt_doc(): Unknown Tidy Configuration Option 'some_bogus_cfg' in /cvs/php-src/ext/tidy/tests/021.php on line 3
|
||||||
|
bool(false)
|
||||||
|
unicode(73) "This option specifies if Tidy should allow numeric character references. "
|
||||||
|
bool(true)
|
|
@ -1220,7 +1220,7 @@ PHP_FUNCTION(tidy_get_release)
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_TIDYOPTGETDOC
|
#if HAVE_TIDYOPTGETDOC
|
||||||
/* {{{ proto string tidy_get_opt_doc(tidy resource, string optname)
|
/* {{{ proto string tidy_get_opt_doc(tidy resource, string optname) U
|
||||||
Returns the documentation for the given option name */
|
Returns the documentation for the given option name */
|
||||||
PHP_FUNCTION(tidy_get_opt_doc)
|
PHP_FUNCTION(tidy_get_opt_doc)
|
||||||
{
|
{
|
||||||
|
@ -1251,7 +1251,7 @@ PHP_FUNCTION(tidy_get_opt_doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (optval = (char *) tidyOptGetDoc(obj->ptdoc->doc, opt)) ) {
|
if ( (optval = (char *) tidyOptGetDoc(obj->ptdoc->doc, opt)) ) {
|
||||||
RETURN_STRING(optval, 1);
|
RETURN_ASCII_STRING(optval, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
|
@ -1260,8 +1260,8 @@ PHP_FUNCTION(tidy_get_opt_doc)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* {{{ proto array tidy_get_config()
|
/* {{{ proto array tidy_get_config() U
|
||||||
Get current Tidy configuarion */
|
Get current Tidy configuration */
|
||||||
PHP_FUNCTION(tidy_get_config)
|
PHP_FUNCTION(tidy_get_config)
|
||||||
{
|
{
|
||||||
TidyIterator itOpt;
|
TidyIterator itOpt;
|
||||||
|
@ -1282,7 +1282,7 @@ PHP_FUNCTION(tidy_get_config)
|
||||||
opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
|
opt_value = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
|
||||||
switch (optt) {
|
switch (optt) {
|
||||||
case TidyString:
|
case TidyString:
|
||||||
add_assoc_string(return_value, opt_name, (char*)opt_value, 0);
|
add_assoc_ascii_string(return_value, opt_name, (char*)opt_value, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TidyInteger:
|
case TidyInteger:
|
||||||
|
@ -1414,7 +1414,7 @@ PHP_FUNCTION(tidy_getopt)
|
||||||
optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
|
optval = php_tidy_get_opt_val(obj->ptdoc, opt, &optt TSRMLS_CC);
|
||||||
switch (optt) {
|
switch (optt) {
|
||||||
case TidyString:
|
case TidyString:
|
||||||
RETURN_STRING((char *)optval, 0);
|
RETURN_ASCII_STRING((char *)optval, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TidyInteger:
|
case TidyInteger:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue