]> granicus.if.org Git - php/commitdiff
sync tests with php 5.2
authorNuno Lopes <nlopess@php.net>
Sun, 11 Feb 2007 16:12:00 +0000 (16:12 +0000)
committerNuno Lopes <nlopess@php.net>
Sun, 11 Feb 2007 16:12:00 +0000 (16:12 +0000)
ext/tidy/tests/019.phpt
ext/tidy/tests/028.phpt [new file with mode: 0644]

index 2b2496081a1013d1bb2b7795bf3bf21e79e30e11..5f6bab4f986ed19b56275486a590d364f8953c35 100644 (file)
@@ -1,16 +1,55 @@
 --TEST--
-Test getParent()
+tidy_repair_*() and invalid parameters
 --SKIPIF--
 <?php if (!extension_loaded("tidy")) print "skip"; ?>
 --FILE--
 <?php
-$x = tidy_parse_string("<body><div>Content</div></body>");
-var_dump($x->body()->child[0]->name);
-var_dump($x->body()->child[0]->getParent()->name);
+
+$l = 1;
+$s = "";
+$a = array();
+
+tidy_repair_string($s, $l, $l, $l);
+tidy_repair_string($s, $s, $s, $s);
+tidy_repair_string($l, $l, $l ,$l);
+tidy_repair_string($a, $a, $a, $a);
+
+tidy_repair_file($s, $l, $l, $l);
+tidy_repair_file($s, $s, $s, $s);
+tidy_repair_file($l, $l, $l ,$l);
+tidy_repair_file($a, $a, $a, $a);
+
+echo "Done\n";
 ?>
---EXPECT--
-string(3) "div"
-string(4) "body"
---UEXPECT--
-unicode(3) "div"
-unicode(4) "body"
+--EXPECTF--
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '' in %s on line %d
+
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
+
+Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d
+
+Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d
+Done
+--UEXPECTF--
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s019.php on line 7
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s019.php on line 7
+
+Warning: tidy_repair_string() expects parameter 4 to be boolean, Unicode string given in %s019.php on line 8
+
+Warning: tidy_repair_string(): Could not load configuration file '1' in %s019.php on line 9
+
+Warning: tidy_repair_string(): Could not set encoding '1' in %s019.php on line 9
+
+Warning: tidy_repair_string() expects parameter 1 to be binary string, array given in %s019.php on line 10
+
+Warning: tidy_repair_file() expects parameter 4 to be boolean, Unicode string given in %s019.php on line 13
+
+Warning: tidy_repair_file() expects parameter 1 to be binary string, array given in %s019.php on line 15
+Done
diff --git a/ext/tidy/tests/028.phpt b/ext/tidy/tests/028.phpt
new file mode 100644 (file)
index 0000000..0c3928c
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+tidyNode::getParent()
+--SKIPIF--
+<?php if (!extension_loaded("tidy")) print "skip"; ?>
+--FILE--
+<?php
+$x = tidy_parse_string("<body><div>Content</div></body>");
+var_dump($x->body()->child[0]->name);
+var_dump($x->body()->child[0]->getParent()->name);
+var_dump($x->root()->getParent());
+?>
+--EXPECT--
+string(3) "div"
+string(4) "body"
+NULL
+--UEXPECT--
+unicode(3) "div"
+unicode(4) "body"
+NULL