1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
--TEST--
TokenList: toggle errors
--EXTENSIONS--
dom
--FILE--
<?php
$dom = DOM\XMLDocument::createFromString('<root class="A B C"/>');
$element = $dom->documentElement;
$list = $element->classList;
try {
$list->toggle("\0");
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
try {
$list->toggle("a b");
} catch (DOMException $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Dom\TokenList::toggle(): Argument #1 ($token) must not contain any null bytes
The token must not contain any ASCII whitespace
|