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