1--TEST--
2Dom\HTMLDocument::createCDATASection()
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = Dom\HTMLDocument::createEmpty();
8try {
9    $dom->createCDATASection("foo");
10} catch (DOMException $e) {
11    var_dump($e->getCode());
12    echo $e->getMessage(), "\n";
13}
14try {
15    $dom->createCDATASection("]]>");
16} catch (DOMException $e) {
17    var_dump($e->getCode());
18    echo $e->getMessage(), "\n";
19}
20
21$dom = Dom\XMLDocument::createEmpty();
22try {
23    $dom->createCDATASection("]]>");
24} catch (DOMException $e) {
25    var_dump($e->getCode());
26    echo $e->getMessage(), "\n";
27}
28$dom->createCDATASection("]>");
29?>
30--EXPECT--
31int(9)
32This operation is not supported for HTML documents
33int(9)
34This operation is not supported for HTML documents
35int(5)
36Invalid character sequence "]]>" in CDATA section
37