1--TEST--
2TokenList: replace 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->replace("\0", "X");
14} catch (ValueError $e) {
15    echo $e->getMessage(), "\n";
16}
17
18try {
19    $list->replace("X", "\0");
20} catch (ValueError $e) {
21    echo $e->getMessage(), "\n";
22}
23
24try {
25    $list->replace("a b", "X");
26} catch (DOMException $e) {
27    echo $e->getMessage(), "\n";
28}
29
30?>
31--EXPECT--
32Dom\TokenList::replace(): Argument #1 ($token) must not contain any null bytes
33Dom\TokenList::replace(): Argument #2 ($newToken) must not contain any null bytes
34The token must not contain any ASCII whitespace
35