summaryrefslogtreecommitdiff
path: root/ext/tidy/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tidy/tests')
-rw-r--r--ext/tidy/tests/003.phpt4
-rw-r--r--ext/tidy/tests/004.phpt6
-rw-r--r--ext/tidy/tests/005-mb.phpt18
-rw-r--r--ext/tidy/tests/005私はガラスを食べられます.html1
-rw-r--r--ext/tidy/tests/010.phpt8
-rw-r--r--ext/tidy/tests/012.phpt12
-rw-r--r--ext/tidy/tests/016.phpt21
-rw-r--r--ext/tidy/tests/017.phpt4
-rw-r--r--ext/tidy/tests/020.phpt5
-rw-r--r--ext/tidy/tests/024.phpt13
-rw-r--r--ext/tidy/tests/026.phpt4
11 files changed, 51 insertions, 45 deletions
diff --git a/ext/tidy/tests/003.phpt b/ext/tidy/tests/003.phpt
index 7201d6a5a2..1a63d44dfd 100644
--- a/ext/tidy/tests/003.phpt
+++ b/ext/tidy/tests/003.phpt
@@ -10,8 +10,8 @@ tidy_clean_repair()
echo tidy_get_output($a);
?>
---EXPECT--
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+--EXPECTF--
+<!DOCTYPE html%S>
<html>
<head>
<title></title>
diff --git a/ext/tidy/tests/004.phpt b/ext/tidy/tests/004.phpt
index d13c37dcd8..9d3cd2ef5a 100644
--- a/ext/tidy/tests/004.phpt
+++ b/ext/tidy/tests/004.phpt
@@ -19,13 +19,13 @@ $a = tidy_parse_string($html);
var_dump(tidy_diagnose($a));
echo tidy_get_error_buffer($a);
?>
---EXPECT--
+--EXPECTF--
bool(true)
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 1 column 7 - Warning: discarding unexpected </html>
line 1 column 14 - Warning: inserting missing 'title' element
-Info: Document content looks like HTML 3.2
-3 warnings, 0 errors were found!
+Info: Document content looks like HTML%w%d%S
+%S3 warnings%S0 errors%S
bool(true)
Info: Document content looks like HTML 3.2
No warnings or errors were found.
diff --git a/ext/tidy/tests/005-mb.phpt b/ext/tidy/tests/005-mb.phpt
new file mode 100644
index 0000000000..b63ec09635
--- /dev/null
+++ b/ext/tidy/tests/005-mb.phpt
@@ -0,0 +1,18 @@
+--TEST--
+tidy_parse_file()
+--SKIPIF--
+<?php if (!extension_loaded("tidy")) print "skip"; ?>
+--FILE--
+<?php
+ $a = tidy_parse_file(dirname(__FILE__)."/005私はガラスを食べられます.html");
+ echo tidy_get_output($a);
+
+?>
+--EXPECT--
+<html>
+<head>
+<title></title>
+</head>
+<body>
+</body>
+</html> \ No newline at end of file
diff --git a/ext/tidy/tests/005私はガラスを食べられます.html b/ext/tidy/tests/005私はガラスを食べられます.html
new file mode 100644
index 0000000000..8c17451f91
--- /dev/null
+++ b/ext/tidy/tests/005私はガラスを食べられます.html
@@ -0,0 +1 @@
+<HTML></HTML>
diff --git a/ext/tidy/tests/010.phpt b/ext/tidy/tests/010.phpt
index 85d9df5190..695e1c9ce5 100644
--- a/ext/tidy/tests/010.phpt
+++ b/ext/tidy/tests/010.phpt
@@ -11,7 +11,7 @@ var_dump($a->html());
var_dump($a->head());
?>
---EXPECT--
+--EXPECTF--
object(tidyNode)#2 (8) {
["value"]=>
string(94) "<html>
@@ -100,7 +100,7 @@ object(tidyNode)#2 (8) {
["proprietary"]=>
bool(false)
["id"]=>
- int(111)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
@@ -231,7 +231,7 @@ object(tidyNode)#2 (9) {
["proprietary"]=>
bool(false)
["id"]=>
- int(111)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
@@ -307,7 +307,7 @@ object(tidyNode)#2 (9) {
["proprietary"]=>
bool(false)
["id"]=>
- int(111)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
diff --git a/ext/tidy/tests/012.phpt b/ext/tidy/tests/012.phpt
index 39ce22bec1..e86aa6c45c 100644
--- a/ext/tidy/tests/012.phpt
+++ b/ext/tidy/tests/012.phpt
@@ -30,7 +30,7 @@ Accessing children nodes
dump_nodes($html);
?>
---EXPECT--
+--EXPECTF--
bool(true)
object(tidyNode)#3 (9) {
["value"]=>
@@ -70,7 +70,7 @@ object(tidyNode)#3 (9) {
["proprietary"]=>
bool(false)
["id"]=>
- int(111)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
@@ -94,7 +94,7 @@ object(tidyNode)#4 (9) {
["proprietary"]=>
bool(false)
["id"]=>
- int(111)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
@@ -222,7 +222,7 @@ object(tidyNode)#5 (9) {
["proprietary"]=>
bool(false)
["id"]=>
- int(114)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
@@ -365,7 +365,7 @@ object(tidyNode)#8 (9) {
["proprietary"]=>
bool(false)
["id"]=>
- int(114)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
@@ -426,7 +426,7 @@ object(tidyNode)#10 (9) {
["proprietary"]=>
bool(false)
["id"]=>
- int(114)
+ int(%i)
["attribute"]=>
NULL
["child"]=>
diff --git a/ext/tidy/tests/016.phpt b/ext/tidy/tests/016.phpt
index 001371aa3e..05b7cc18f9 100644
--- a/ext/tidy/tests/016.phpt
+++ b/ext/tidy/tests/016.phpt
@@ -4,21 +4,10 @@ Passing configuration file through tidy_parse_file() (may fail with buggy libtid
<?php if (!extension_loaded("tidy")) print "skip"; ?>
--FILE--
<?php
- $tidy = tidy_parse_file(dirname(__FILE__)."/016.html", dirname(__FILE__)."/016.tcfg");
- tidy_clean_repair($tidy);
- echo tidy_get_output($tidy);
+ $tidy = tidy_parse_file(dirname(__FILE__)."/016.html",
+ dirname(__FILE__)."/016.tcfg");
+ $cfg = $tidy->getConfig();
+ echo $cfg["clean"];
?>
--EXPECT--
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<html>
-<head>
-<title></title>
-
-<style type="text/css">
- p.c1 {font-weight: bold}
-</style>
-</head>
-<body>
-<p class="c1">testing</p>
-</body>
-</html>
+1
diff --git a/ext/tidy/tests/017.phpt b/ext/tidy/tests/017.phpt
index ba620a32ec..24597e1a4a 100644
--- a/ext/tidy/tests/017.phpt
+++ b/ext/tidy/tests/017.phpt
@@ -5,8 +5,8 @@ The Tidy Output Buffer Filter
--FILE--
<?php ob_start("ob_tidyhandler"); ?>
<B>testing</I>
---EXPECT--
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+--EXPECTF--
+<!DOCTYPE html%S>
<html>
<head>
<title></title>
diff --git a/ext/tidy/tests/020.phpt b/ext/tidy/tests/020.phpt
index dbfda96375..8ff1efbb68 100644
--- a/ext/tidy/tests/020.phpt
+++ b/ext/tidy/tests/020.phpt
@@ -19,12 +19,11 @@ var_dump(strlen($tidy->errorBuffer) > 50);
echo $tidy;
?>
---EXPECT--
+--EXPECTF--
bool(true)
bool(true)
<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!DOCTYPE html%A>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
diff --git a/ext/tidy/tests/024.phpt b/ext/tidy/tests/024.phpt
index b09f5b4643..6a258b30aa 100644
--- a/ext/tidy/tests/024.phpt
+++ b/ext/tidy/tests/024.phpt
@@ -13,28 +13,27 @@ if (strtotime(tidy_get_release()) < strtotime('20 january 2007')) die ('skip old
$contents = '
<wps:block>
<wps:var>
-<wps:value/>
+<wps:value></wps:value>
</wps:var>
</wps:block>';
$config = array(
+'doctype' => 'omit',
'new-blocklevel-tags' => 'wps:block,wps:var,wps:value',
'newline' => 'LF'
);
$tidy = tidy_parse_string($contents, $config, 'utf8');
$tidy->cleanRepair();
-
-var_dump($tidy->value);
+echo $tidy;
?>
--EXPECTF--
-string(11%d) "<html>
+<html>
<head>
<title></title>
</head>
<body>
-<wps:block>%w<wps:var>
-<wps:value></wps:var>%w</wps:block>
+<wps:block>%w<wps:var>%w<wps:value></wps:value>%w</wps:var>%w</wps:block>
</body>
-</html>"
+</html>
diff --git a/ext/tidy/tests/026.phpt b/ext/tidy/tests/026.phpt
index 24a1e6f4a7..b46cd5464b 100644
--- a/ext/tidy/tests/026.phpt
+++ b/ext/tidy/tests/026.phpt
@@ -12,8 +12,8 @@ echo '<p>xpto</p>';
?>
</html>
---EXPECT--
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+--EXPECTF--
+<!DOCTYPE html%S>
<html>
<head>
<title></title>