019.phpt 994 B

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