1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 21:41:22 +02:00
Files
archived-php-src/ext/dom/tests/DOM4_ParentNode_Fragment.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

42 lines
989 B
PHP

--TEST--
DOMParentNode: Child Element Handling
--EXTENSIONS--
dom
--FILE--
<?php
require_once("dom_test.inc");
$dom = new DOMDocument;
$dom->loadXML('<test></test>');
$fragment = $dom->createDocumentFragment();
$fragment->appendChild($dom->createTextNode('foo'));
$fragment->appendChild($dom->createElement('bar', 'FirstElement'));
$fragment->appendChild($dom->createElement('bar', 'LastElement'));
$fragment->appendChild($dom->createTextNode('bar'));
var_dump($fragment instanceof DOMParentNode);
print_node($fragment->firstElementChild);
print_node($fragment->lastElementChild);
var_dump($fragment->childElementCount);
var_dump($fragment->lastElementChild->firstElementChild);
var_dump($fragment->lastElementChild->lastElementChild);
var_dump($fragment->lastElementChild->childElementCount);
?>
--EXPECT--
bool(true)
Node Name: bar
Node Type: 1
Num Children: 1
Node Content: FirstElement
Node Name: bar
Node Type: 1
Num Children: 1
Node Content: LastElement
int(2)
NULL
NULL
int(0)