1--TEST--
2Dom\HTMLDocument::documentURI
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$dom = Dom\HTMLDocument::createFromFile(__DIR__ . "/test foo.html", LIBXML_NOERROR);
9var_dump($dom->documentURI);
10
11$memory = fopen("php://memory", "w+");
12fwrite($memory, "foobar");
13rewind($memory);
14$dom = Dom\HTMLDocument::createFromFile("php://memory");
15var_dump($dom->documentURI);
16fclose($memory);
17
18class DummyWrapper {
19    public $context;
20
21    public function stream_open($path, $mode, $options, &$opened_path) {
22        return true;
23    }
24
25    public function stream_read($count) {
26        return "";
27    }
28
29    public function stream_eof() {
30        return true;
31    }
32
33    public function stream_close() {
34        return true;
35    }
36}
37
38stream_wrapper_register("dummy", DummyWrapper::class);
39
40$dom = Dom\HTMLDocument::createFromFile("dummy://foo/ bar");
41var_dump($dom->documentURI);
42
43?>
44--EXPECTF--
45string(%d) "file://%stest%sfoo.html"
46string(12) "php://memory"
47string(16) "dummy://foo/ bar"
48