Skip to content

Commit 9ee4a06

Browse files
committed
add forbidden option test
1 parent a1c899a commit 9ee4a06

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ext/tidy/tests/tidy_error1.phpt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ try {
2020
$config = ['neither'];
2121
try {
2222
$tidy->parseString($buffer, $config);
23-
} catch (\Error $e) {
23+
} catch (\TypeError $e) {
24+
echo $e->getMessage(), PHP_EOL;
25+
}
26+
27+
$config = ['doctype-mode' => 'customtag'];
28+
29+
try {
30+
var_dump($tidy->parseString($buffer, $config));
31+
} catch (\ValueError $e) {
2432
echo $e->getMessage(), PHP_EOL;
2533
}
2634

2735
?>
28-
--EXPECTF--
36+
--EXPECT--
2937
tidy::parseString(): Argument #2 ($config) Unknown Tidy configuration option "bogus"
3038
tidy::parseString(): Argument #2 ($config) must be of type array with keys as string
39+
tidy::parseString(): Argument #2 ($config) Attempting to set read-only option "doctype-mode"

0 commit comments

Comments
 (0)