cvs: pecl /tidy/tests 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt
| From: | Ilia Alshanetsky | Date: | Fri, 19 Dec 2003 14:24:04 +0000 |
| Subject: | cvs: pecl /tidy/tests 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-596@lists.php.net to get a copy of this message | ||
iliaa Fri Dec 19 09:24:04 2003 EDT
Modified files:
/pecl/tidy/tests 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt
007.phpt
Log:
Fixed tidy tests.
Index: pecl/tidy/tests/002.phpt
diff -u pecl/tidy/tests/002.phpt:1.3 pecl/tidy/tests/002.phpt:1.4
--- pecl/tidy/tests/002.phpt:1.3 Mon Sep 22 14:40:38 2003
+++ pecl/tidy/tests/002.phpt Fri Dec 19 09:24:04 2003
@@ -7,10 +7,13 @@
--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>
Index: pecl/tidy/tests/003.phpt
diff -u pecl/tidy/tests/003.phpt:1.3 pecl/tidy/tests/003.phpt:1.4
--- pecl/tidy/tests/003.phpt:1.3 Mon Sep 22 14:40:38 2003
+++ pecl/tidy/tests/003.phpt Fri Dec 19 09:24:04 2003
@@ -7,12 +7,15 @@
--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">
Index: pecl/tidy/tests/004.phpt
diff -u pecl/tidy/tests/004.phpt:1.3 pecl/tidy/tests/004.phpt:1.4
--- pecl/tidy/tests/004.phpt:1.3 Mon Sep 22 14:40:38 2003
+++ pecl/tidy/tests/004.phpt Fri Dec 19 09:24:04 2003
@@ -7,10 +7,15 @@
--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--
Index: pecl/tidy/tests/005.phpt
diff -u pecl/tidy/tests/005.phpt:1.3 pecl/tidy/tests/005.phpt:1.4
--- pecl/tidy/tests/005.phpt:1.3 Mon Sep 22 14:40:38 2003
+++ pecl/tidy/tests/005.phpt Fri Dec 19 09:24:04 2003
@@ -7,11 +7,13 @@
--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>
Index: pecl/tidy/tests/006.phpt
diff -u pecl/tidy/tests/006.phpt:1.3 pecl/tidy/tests/006.phpt:1.4
--- pecl/tidy/tests/006.phpt:1.3 Mon Sep 22 14:40:38 2003
+++ pecl/tidy/tests/006.phpt Fri Dec 19 09:24:04 2003
@@ -7,11 +7,13 @@
--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
Index: pecl/tidy/tests/007.phpt
diff -u pecl/tidy/tests/007.phpt:1.3 pecl/tidy/tests/007.phpt:1.4
--- pecl/tidy/tests/007.phpt:1.3 Mon Sep 22 14:40:38 2003
+++ pecl/tidy/tests/007.phpt Fri Dec 19 09:24:04 2003
@@ -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 @@
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)