1--TEST--
2TokenList: entities interaction
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = DOM\XMLDocument::createFromString(<<<XML
9<?xml version="1.0" encoding="UTF-8" ?>
10<!DOCTYPE root [
11    <!ENTITY ent "foo">
12]>
13<root class="x&ent;x"/>
14XML);
15$element = $dom->documentElement;
16$list = $element->classList;
17
18var_dump($list);
19
20var_dump($list->contains("xfoox"));
21var_dump($list->contains("xx"));
22var_dump($list->contains("foo"));
23
24$list->add("test");
25
26echo $dom->saveXML();
27
28?>
29--EXPECT--
30object(Dom\TokenList)#3 (2) {
31  ["length"]=>
32  int(1)
33  ["value"]=>
34  string(5) "xfoox"
35}
36bool(true)
37bool(false)
38bool(false)
39<?xml version="1.0" encoding="UTF-8"?>
40<!DOCTYPE root [
41<!ENTITY ent "foo">
42]>
43<root class="xfoox test"/>
44