xref: /PHP-8.2/ext/dom/tests/bug41257.phpt (revision bd9f4fa6)
1--TEST--
2Bug #41257 (lookupNamespaceURI does not work as expected)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$doc = new DOMDocument();
9$doc->load(__DIR__."/nsdoc.xml");
10
11$root = $doc->documentElement;
12
13$duri = $doc->lookupNamespaceURI("ns2")."\n";
14$euri = $root->lookupNamespaceURI("ns2")."\n";
15
16var_dump($duri == $euri);
17
18$dpref = $doc->lookupPrefix("http://ns2")."\n";
19$epref = $root->lookupPrefix("http://ns2")."\n";
20
21var_dump($dpref == $epref);
22
23$disdef = $doc->isDefaultNamespace("http://ns")."\n";
24$eisdef = $root->isDefaultNamespace("http://ns")."\n";
25
26var_dump($dpref === $epref);
27?>
28--EXPECT--
29bool(true)
30bool(true)
31bool(true)
32