1--TEST--
2DOMNode::before()
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7require_once("dom_test.inc");
8
9$dom = new DOMDocument;
10$dom->loadXML('<test><mark>first</mark><mark>second</mark></test>');
11
12$element = $dom->documentElement->firstElementChild;
13$secondMark = $dom->documentElement->lastElementChild;
14
15$element->before(
16  $dom->createElement('inserted-before', 'content'),
17  'text inserted before'
18);
19
20$secondMark->before('text inserted before second');
21
22print_node_list_compact($dom->documentElement->childNodes);
23?>
24--EXPECT--
25<inserted-before>
26  content
27</inserted-before>
28text inserted before
29<mark>
30  first
31</mark>
32text inserted before second
33<mark>
34  second
35</mark>
36