/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/dom/tests/DOMChildNode_methods_without_parent.phpt
44 строки
751 B
Niels Dossche
Align DOMChildNode parent checks with spec
09 авг 2023, 22:24
09 авг 2023, 22:24
23ba4cd
Код
Авторство
О чём код?
--TEST-- DOMChildNode methods without a parent --EXTENSIONS-- dom --FILE-- <?php $doc = new DOMDocument; $doc->loadXML(<<<XML <?xml version="1.0"?> <container> <child/> </container> XML); $container = $doc->documentElement; $child = $container->firstElementChild; $test = $doc->createElement('foo'); foreach (['before', 'after', 'replaceWith'] as $method) { echo "--- $method ---\n"; $test->$method($child); echo $doc->saveXML(); echo $doc->saveXML($test), "\n"; } ?> --EXPECT-- --- before --- <?xml version="1.0"?> <container> <child/> </container> <foo/> --- after --- <?xml version="1.0"?> <container> <child/> </container> <foo/> --- replaceWith --- <?xml version="1.0"?> <container> <child/> </container> <foo/>