diff --git a/ext/xsl/tests/special_operations_with_properties.phpt b/ext/xsl/tests/special_operations_with_properties.phpt new file mode 100644 index 0000000000000..b7904fad8d866 --- /dev/null +++ b/ext/xsl/tests/special_operations_with_properties.phpt @@ -0,0 +1,68 @@ +--TEST-- +Special operations with XSLTProcessor properties +--EXTENSIONS-- +xsl +dom +--FILE-- +loadXML('hello'); + +function test() { + echo "Called test\n"; +} + +$xsl = new DOMDocument; +$xsl->loadXML(<< + + + + + + +XML); + +echo "--- Unset cloneDocument ---\n"; + +$xslt = new XSLTProcessor; +$xslt->registerPHPFunctions(); +unset($xslt->cloneDocument); +try { + $xslt->importStylesheet($xsl); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +echo "--- Unset doXInclude ---\n"; + +$xslt = new XSLTProcessor; +$xslt->registerPHPFunctions(); +unset($xslt->doXInclude); +$xslt->importStylesheet($xsl); +try { + echo $xslt->transformToXml($xml); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +echo "--- Make properties references ---\n"; + +$xslt = new XSLTProcessor; +$xslt->registerPHPFunctions(); +$clone =& $xslt->cloneDocument; +$xinclude =& $xslt->doXInclude; +$xslt->importStylesheet($xsl); +echo $xslt->transformToXml($xml); + +?> +--EXPECT-- +--- Unset cloneDocument --- +Typed property XSLTProcessor::$cloneDocument must not be accessed before initialization +--- Unset doXInclude --- +Typed property XSLTProcessor::$doXInclude must not be accessed before initialization +--- Make properties references --- +Called test + +hello