Annotation of embedaddon/php/ext/xsl/tests/xsltprocessor_registerPHPFunctions-funcundef.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Check xsltprocessor::registerPHPFunctions and a undefined php function
3: --DESCRIPTION--
4: The XSL script tries to call a php function that is not defined
5: --SKIPIF--
6: <?php
7: if (!extension_loaded('xsl')) {
8: die("skip\n");
9: }
10: ?>
11: --FILE--
12: <?php
13: include dirname(__FILE__) .'/prepare.inc';
14: $phpfuncxsl = new domDocument();
15: $phpfuncxsl->load(dirname(__FILE__)."/phpfunc-undef.xsl");
16: if(!$phpfuncxsl) {
17: echo "Error while parsing the xsl document\n";
18: exit;
19: }
20: $proc->importStylesheet($phpfuncxsl);
21: var_dump($proc->registerPHPFunctions());
22: var_dump($proc->transformToXml($dom));
23: --EXPECTF--
24: NULL
25:
26: Warning: XSLTProcessor::transformToXml(): Unable to call handler undefinedfunc() in %s on line %d
27:
28: Warning: XSLTProcessor::transformToXml(): xmlXPathCompiledEval: evaluation failed in %s on line %d
29:
30: Warning: XSLTProcessor::transformToXml(): runtime error: file %s line %d element value-of in %s on line %d
31:
32: Warning: XSLTProcessor::transformToXml(): XPath evaluation returned no result. in %s on line %d
33: NULL
34: --CREDITS--
35: Christian Weiske, cweiske@php.net
36: PHP Testfest Berlin 2009-05-09
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>