php-src/ext/dom/tests/DOM4_ParentNode_append_with_attributes.phpt
Max Semenik bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
For rationale, see https://github.com/php/php-src/pull/6787

Make extension checks lowercase, add a special case for opcache
that has internal name not matching .so filename.

Extensions migrated in part 2:
* dom
* exif
* fileinfo
* ffi
2021-04-01 12:08:24 +01:00

31 lines
586 B
PHP

--TEST--
DOMParentNode::append() with attributes
--EXTENSIONS--
dom
--FILE--
<?php
require_once("dom_test.inc");
$dom = new DOMDocument;
$dom->loadXML('<test attr-one="21"/>');
$replacement = $dom->createAttribute('attr-one');
$replacement->value ='42';
$addition = $dom->createAttribute('attr-two');
$addition->value = '23';
$element = $dom->documentElement;
try {
$element->append($replacement, $addition);
} catch (DOMException $e) {
echo $e->getMessage() . "\n";
}
echo $dom->saveXML();
?>
--EXPECT--
Hierarchy Request Error
<?xml version="1.0"?>
<test attr-one="21"/>