diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-12-19 14:24:04 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-12-19 14:24:04 +0000 |
commit | 9f50065edd2d8c457879a8731a55c2494aa982c4 (patch) | |
tree | b0e826a1a8dc2af3777fe7cdcf1a731b6facbe73 | |
parent | 02a93167319aaf034e1eb2c0590098123cfa9f30 (diff) | |
download | php-git-9f50065edd2d8c457879a8731a55c2494aa982c4.tar.gz |
Fixed tidy tests.
-rw-r--r-- | ext/tidy/tests/002.phpt | 11 | ||||
-rw-r--r-- | ext/tidy/tests/003.phpt | 15 | ||||
-rw-r--r-- | ext/tidy/tests/004.phpt | 13 | ||||
-rw-r--r-- | ext/tidy/tests/005.phpt | 12 | ||||
-rw-r--r-- | ext/tidy/tests/006.phpt | 12 | ||||
-rw-r--r-- | ext/tidy/tests/007.phpt | 59 |
6 files changed, 77 insertions, 45 deletions
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-- <?php - tidy_parse_string("<HTML></HTML>"); - - echo tidy_get_output(); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string("<HTML></HTML>"); + echo tidy_get_output($a); + } else { + tidy_parse_string("<HTML></HTML>"); + echo tidy_get_output(); + } ?> --EXPECT-- <html> 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-- <?php - - tidy_parse_string("<HTML></HTML>"); - tidy_clean_repair(); - - echo tidy_get_output(); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string("<HTML></HTML>"); + tidy_clean_repair($a); + echo tidy_get_output($a); + } else { + tidy_parse_string("<HTML></HTML>"); + tidy_clean_repair(); + echo tidy_get_output(); + } ?> --EXPECT-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> 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-- <?php - tidy_parse_string("<HTML></HTML>"); - tidy_diagnose(); - echo tidy_get_error_buffer(); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string("<HTML></HTML>"); + tidy_diagnose($a); + echo tidy_get_error_buffer($a); + } else { + tidy_parse_string("<HTML></HTML>"); + 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-- <?php - - tidy_parse_file("ext/tidy/tests/005.html"); - - echo tidy_get_output(); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_file("ext/tidy/tests/005.html"); + echo tidy_get_output($a); + } else { + tidy_parse_file("ext/tidy/tests/005.html"); + echo tidy_get_output(); + } ?> --EXPECT-- <html> 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-- <?php - - tidy_parse_string("<HTML><asd asdf></HTML>"); - - echo tidy_get_error_buffer(true); - + if (class_exists("tidy_doc")) { + $a = tidy_parse_string("<HTML><asd asdf></HTML>"); + echo tidy_get_error_buffer($a); + } else { + tidy_parse_string("<HTML><asd asdf></HTML>"); + echo tidy_get_error_buffer(true); + } ?> --EXPECT-- line 1 column 1 - Warning: missing <!DOCTYPE> 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-- <?php if (!extension_loaded("tidy")) print "skip"; ?> ---POST-- ---GET-- --INI-- +tidy.default_config= --FILE-- -<?php - - 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")); +<?php + if (class_exists("tidy_doc")) { + $a = new tidy_doc(); + echo "Current Value of 'tidy-mark': "; + var_dump($a->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) |