]> granicus.if.org Git - php/commitdiff
Fixed tidy tests.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 19 Dec 2003 14:24:04 +0000 (14:24 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 19 Dec 2003 14:24:04 +0000 (14:24 +0000)
ext/tidy/tests/002.phpt
ext/tidy/tests/003.phpt
ext/tidy/tests/004.phpt
ext/tidy/tests/005.phpt
ext/tidy/tests/006.phpt
ext/tidy/tests/007.phpt

index 83456091f70ccef0e98c59e204a391e54a08958b..016664376b130d2a89eda7aa7c4141c0f2afe492 100644 (file)
@@ -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>
index b008acecdb3e06f31c958e20636dc35477251ab6..27c023e3f1931179f38677b85fb2603e93a3ae6d 100644 (file)
@@ -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">
index ed60a39b272995f1eb4e9752fe49e04ed3085537..e748c2e7b7446d374663ae3fd7671d403d8b9dab 100644 (file)
@@ -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--
 
index d69a726c8f272eeecb753b6387b51e44c2bc505c..a91b0f2abe542a94621fccfabdfcb734ed20ae24 100644 (file)
@@ -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>
index 7ea28e79c51776011af22953e8a7054ea7a56efe..48085ae9712d66ce3c50d11160dd6f96d1f37a7d 100644 (file)
@@ -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
index 9987677df6a4006c59879cecb3d1fe859ba5710d..e5015eb3fd19a12349d7d0364f2e7a860a000a52 100644 (file)
@@ -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)