1--TEST--
2XSLTProcessor::transformToDoc class exceptions
3--EXTENSIONS--
4xsl
5simplexml
6dom
7--FILE--
8<?php
9
10$sxe = simplexml_load_file(__DIR__ . '/53965/collection.xml');
11
12$processor = new XSLTProcessor;
13$dom = new DOMDocument;
14$dom->load(__DIR__ . '/53965/collection.xsl');
15$processor->importStylesheet($dom);
16
17try {
18    $processor->transformToDoc($sxe, NonExistent::class);
19} catch (TypeError $e) {
20    echo $e->getMessage(), "\n";
21}
22
23try {
24    $processor->transformToDoc($sxe, DOMDocument::class);
25} catch (TypeError $e) {
26    echo $e->getMessage(), "\n";
27}
28
29?>
30--EXPECT--
31XSLTProcessor::transformToDoc(): Argument #2 ($returnClass) must be a valid class name or null, NonExistent given
32XSLTProcessor::transformToDoc(): Argument #2 ($returnClass) must be a class name compatible with SimpleXMLElement, DOMDocument given
33