Annotation of embedaddon/php/ext/dom/tests/DOMDocument_standalone_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Tests DOMDocument::standalone get, set, and functionality
! 3: --CREDITS--
! 4: Chris Snyder <chsnyder@gmail.com>
! 5: # TestFest 2009 NYPHP
! 6: --SKIPIF--
! 7: <?php require_once('skipif.inc'); ?>
! 8: --FILE--
! 9: <?php
! 10: // create dom document
! 11: $dom = new DOMDocument;
! 12: $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
! 13: <!DOCTYPE s1 PUBLIC "http://www.ibm.com/example.dtd" "example.dtd">
! 14: <s1>foo</s1>';
! 15: $dom->loadXML($xml);
! 16: if(!$dom) {
! 17: echo "Error while parsing the document\n";
! 18: exit;
! 19: }
! 20: echo "Standalone DOMDocument created\n";
! 21:
! 22: $test = $dom->standalone;
! 23: echo "Read initial standalone:\n";
! 24: var_dump( $test );
! 25:
! 26: $dom->standalone = FALSE;
! 27: $test = $dom->standalone;
! 28: echo "Set standalone to FALSE, reading again:\n";
! 29: var_dump( $test );
! 30:
! 31: $test = $dom->saveXML();
! 32: echo "Document is no longer standalone\n";
! 33: var_dump( $test );
! 34:
! 35: echo "Done";
! 36: ?>
! 37: --EXPECT--
! 38: Standalone DOMDocument created
! 39: Read initial standalone:
! 40: bool(true)
! 41: Set standalone to FALSE, reading again:
! 42: bool(false)
! 43: Document is no longer standalone
! 44: string(136) "<?xml version="1.0" encoding="UTF-8" standalone="no"?>
! 45: <!DOCTYPE s1 PUBLIC "http://www.ibm.com/example.dtd" "example.dtd">
! 46: <s1>foo</s1>
! 47: "
! 48: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>