1--TEST-- 2Tests DOMDocument::resoleExternals get and set 3--CREDITS-- 4Chris Snyder <chsnyder@gmail.com> 5# TestFest 2009 NYPHP 6--EXTENSIONS-- 7dom 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 HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 14 "http://www.w3.org/TR/html4/strict.dtd"> 15<h1>"Foo"</h1>'; 16$dom->loadXML($xml); 17if(!$dom) { 18 echo "Error while parsing the document\n"; 19 exit; 20} 21echo "DOMDocument with external entities created\n"; 22 23$test = $dom->resolveExternals; 24echo "Read initial resolveExternals:\n"; 25var_dump( $test ); 26 27$dom->resolveExternals = TRUE; 28$test = $dom->resolveExternals; 29echo "Set resolveExternals to TRUE, reading again:\n"; 30var_dump( $test ); 31 32/** 33 * Don't bother testing the resolveExternals functionality here, it throws warnings on html dtd 34 * 35echo "Reloading xml with resolveExternals turned on\n"; 36$dom->loadXML($xml); 37$test = $dom->saveXML(); 38var_dump( $test ); 39 */ 40 41echo "Done"; 42?> 43--EXPECT-- 44DOMDocument with external entities created 45Read initial resolveExternals: 46bool(false) 47Set resolveExternals to TRUE, reading again: 48bool(true) 49Done 50