1--TEST--
2DOMCharacterData::appendData basic functionality test
3--CREDITS--
4Mike Sullivan <mike@regexia.com>
5#TestFest 2008 (London)
6--SKIPIF--
7<?php require_once('skipif.inc'); ?>
8--FILE--
9<?php
10
11$document = new DOMDocument;
12$root = $document->createElement('root');
13$document->appendChild($root);
14
15$cdata = $document->createElement('cdata');
16$root->appendChild($cdata);
17
18$cdatanode = $document->createCDATASection('');
19$cdata->appendChild($cdatanode);
20$cdatanode->appendData('data');
21echo "CDATA Length (one append): " . $cdatanode->length . "\n";
22
23$cdatanode->appendData('><&"');
24echo "CDATA Length (two appends): " . $cdatanode->length . "\n";
25
26echo "CDATA Content: " . $cdatanode->data . "\n";
27
28echo "\n" . $document->saveXML();
29
30?>
31--EXPECT--
32CDATA Length (one append): 4
33CDATA Length (two appends): 8
34CDATA Content: data><&"
35
36<?xml version="1.0"?>
37<root><cdata><![CDATA[data><&"]]></cdata></root>
38