From: Ilia Alshanetsky Date: Fri, 19 Dec 2003 14:24:04 +0000 (+0000) Subject: Fixed tidy tests. X-Git-Tag: php-5.0.0b3RC2~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f50065edd2d8c457879a8731a55c2494aa982c4;p=php Fixed tidy tests. --- diff --git a/ext/tidy/tests/002.phpt b/ext/tidy/tests/002.phpt index 83456091f7..016664376b 100644 --- a/ext/tidy/tests/002.phpt +++ b/ext/tidy/tests/002.phpt @@ -7,10 +7,13 @@ tidy_parse_string() --INI-- --FILE-- "); - - echo tidy_get_output(); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string(""); + echo tidy_get_output($a); + } else { + tidy_parse_string(""); + echo tidy_get_output(); + } ?> --EXPECT-- diff --git a/ext/tidy/tests/003.phpt b/ext/tidy/tests/003.phpt index b008acecdb..27c023e3f1 100644 --- a/ext/tidy/tests/003.phpt +++ b/ext/tidy/tests/003.phpt @@ -7,12 +7,15 @@ tidy_clean_repair() --INI-- --FILE-- "); - tidy_clean_repair(); - - echo tidy_get_output(); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string(""); + tidy_clean_repair($a); + echo tidy_get_output($a); + } else { + tidy_parse_string(""); + tidy_clean_repair(); + echo tidy_get_output(); + } ?> --EXPECT-- diff --git a/ext/tidy/tests/004.phpt b/ext/tidy/tests/004.phpt index ed60a39b27..e748c2e7b7 100644 --- a/ext/tidy/tests/004.phpt +++ b/ext/tidy/tests/004.phpt @@ -7,10 +7,15 @@ tidy_diagnose() --INI-- --FILE-- "); - tidy_diagnose(); - echo tidy_get_error_buffer(); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string(""); + tidy_diagnose($a); + echo tidy_get_error_buffer($a); + } else { + tidy_parse_string(""); + tidy_diagnose(); + echo tidy_get_error_buffer(); + } ?> --EXPECT-- diff --git a/ext/tidy/tests/005.phpt b/ext/tidy/tests/005.phpt index d69a726c8f..a91b0f2abe 100644 --- a/ext/tidy/tests/005.phpt +++ b/ext/tidy/tests/005.phpt @@ -7,11 +7,13 @@ tidy_parse_file() --INI-- --FILE-- --EXPECT-- diff --git a/ext/tidy/tests/006.phpt b/ext/tidy/tests/006.phpt index 7ea28e79c5..48085ae971 100644 --- a/ext/tidy/tests/006.phpt +++ b/ext/tidy/tests/006.phpt @@ -7,11 +7,13 @@ Verbose tidy_get_error_buffer() --INI-- --FILE-- "); - - echo tidy_get_error_buffer(true); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string(""); + echo tidy_get_error_buffer($a); + } else { + tidy_parse_string(""); + echo tidy_get_error_buffer(true); + } ?> --EXPECT-- line 1 column 1 - Warning: missing declaration diff --git a/ext/tidy/tests/007.phpt b/ext/tidy/tests/007.phpt index 9987677df6..e5015eb3fd 100644 --- a/ext/tidy/tests/007.phpt +++ b/ext/tidy/tests/007.phpt @@ -2,30 +2,47 @@ Verbose tidy_setopt() / tidy_getopt() --SKIPIF-- ---POST-- ---GET-- --INI-- +tidy.default_config= --FILE-- -getopt("tidy-mark")); + $a->setopt("tidy-mark", true); + echo "\nNew Value of 'tidy-mark': "; + var_dump($a->getopt("tidy-mark")); + echo "Current Value of 'error-file': "; + var_dump($a->getopt("error-file")); + $a->setopt("error-file", "foobar"); + echo "\nNew Value of 'error-file': "; + var_dump($a->getopt("error-file")); + echo "Current Value of 'tab-size': "; + var_dump($a->getopt("tab-size")); + $a->setopt("tab-size", 10); + echo "\nNew Value of 'tab-size': "; + var_dump($a->getopt("tab-size")); + } else { + echo "Current Value of 'tidy-mark': "; + var_dump(tidy_getopt("tidy-mark")); + tidy_setopt($tidy, "tidy-mark", true); + echo "\nNew Value of 'tidy-mark': "; + var_dump(tidy_getopt("tidy-mark")); + echo "Current Value of 'error-file': "; + var_dump(tidy_getopt("error-file")); + tidy_setopt($tidy, "error-file", "foobar"); + echo "\nNew Value of 'error-file': "; + var_dump(tidy_getopt("error-file")); + echo "Current Value of 'tab-size': "; + var_dump(tidy_getopt("tab-size")); + tidy_setopt($tidy, "tab-size", 10); + echo "\nNew Value of 'tab-size': "; + var_dump(tidy_getopt("tab-size")); + } ?> --EXPECT-- -Current Value of 'tidy-mark': bool(false) +Current Value of 'tidy-mark': NULL New Value of 'tidy-mark': bool(true) Current Value of 'error-file': string(0) "" @@ -33,4 +50,4 @@ Current Value of 'error-file': string(0) "" New Value of 'error-file': string(6) "foobar" Current Value of 'tab-size': int(8) -New Value of 'tab-size': int(10) \ No newline at end of file +New Value of 'tab-size': int(10)