1--TEST--
2textContent edge cases
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = DOM\XMLDocument::createFromString('<container>text<?pi value?></container>');
9
10echo "document text content: ";
11var_dump($dom->textContent);
12try {
13    $dom->textContent = "foo";
14} catch (Error $e) {
15    echo $e->getMessage(), "\n";
16}
17
18$container = $dom->documentElement;
19
20$text = $container->firstChild;
21$pi = $text->nextSibling;
22
23echo "text node text content: ";
24var_dump($text->textContent);
25echo "pi node text content: ";
26var_dump($pi->textContent);
27
28$text->textContent = NULL;
29$pi->textContent = NULL;
30
31echo "text node text content: ";
32var_dump($text->textContent);
33echo "pi node text content: ";
34var_dump($pi->textContent);
35
36$container->textContent = NULL;
37echo $dom->saveXML(), "\n";
38
39?>
40--EXPECT--
41document text content: NULL
42Cannot modify readonly property DOM\XMLDocument::$textContent
43text node text content: string(4) "text"
44pi node text content: string(5) "value"
45text node text content: string(0) ""
46pi node text content: string(0) ""
47<?xml version="1.0" encoding="UTF-8"?>
48<container></container>
49