xref: /PHP-8.3/ext/tidy/tests/019.phpt (revision f592f75e)
1--TEST--
2tidy_repair_*() and invalid parameters
3--EXTENSIONS--
4tidy
5--FILE--
6<?php
7
8$l = 1;
9$s = "";
10
11tidy_repair_string($s, $l, $l);
12tidy_repair_string($s, $s, $s);
13tidy_repair_string($l, $l, $l);
14
15try {
16    tidy_repair_file($s, $l, $l, $l);
17} catch (\ValueError $e) {
18    echo $e->getMessage() . \PHP_EOL;
19}
20try {
21    tidy_repair_file($s, $s, $s, $s);
22} catch (\ValueError $e) {
23    echo $e->getMessage() . \PHP_EOL;
24}
25
26tidy_repair_file($l, $l, $l ,$l); // This doesn't emit any warning, TODO look into
27
28echo "Done\n";
29?>
30--EXPECTF--
31Warning: tidy_repair_string(): Could not load the Tidy configuration file "1" in %s on line %d
32
33Warning: tidy_repair_string(): Could not set encoding "1" in %s on line %d
34
35Warning: tidy_repair_string(): Could not load the Tidy configuration file "" in %s on line %d
36
37Warning: tidy_repair_string(): Could not load the Tidy configuration file "1" in %s on line %d
38
39Warning: tidy_repair_string(): Could not set encoding "1" in %s on line %d
40Path cannot be empty
41Path cannot be empty
42Done
43