mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
add test
This commit is contained in:
parent
b1f52e79aa
commit
a91a72f800
1 changed files with 25 additions and 0 deletions
25
ext/dom/tests/bug37277.phpt
Normal file
25
ext/dom/tests/bug37277.phpt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
--TEST--
|
||||||
|
Bug # 37277 (cloning Dom Documents or Nodes does not work)
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require_once('skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$dom1 = new DomDocument('1.0', 'UTF-8');
|
||||||
|
|
||||||
|
$xml = '<foo />';
|
||||||
|
$dom1->loadXml($xml);
|
||||||
|
|
||||||
|
$node = clone $dom1->documentElement;
|
||||||
|
|
||||||
|
$dom2 = new DomDocument('1.0', 'UTF-8');
|
||||||
|
$dom2->appendChild($dom2->importNode($node->cloneNode(true), TRUE));
|
||||||
|
|
||||||
|
print $dom2->saveXML();
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<foo/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue