$alias = new FluidXml(); $alias->insertSiblingBefore('sibling1', true)->insertSiblingBefore(['sibling2', 'sibling3'], ['class' => 'sibling']); $actual = $xml->xml(); $expected = $alias->xml(); \assert($actual === $expected, __($actual, $expected)); }); }); describe('.append', function () { it('should be fluid', function () { assert_is_fluid('append', 'a'); }); it('should behave like .appendSibling', function () { $xml = new FluidXml(); $xml->appendSibling('sibling1', true)->appendSibling(['sibling2', 'sibling3'], ['class' => 'sibling']); $alias = new FluidXml(); $alias->append('sibling1', true)->append(['sibling2', 'sibling3'], ['class' => 'sibling']); $actual = $xml->xml(); $expected = $alias->xml(); \assert($actual === $expected, __($actual, $expected)); }); }); describe('.insertSiblingAfter', function () { it('should be fluid', function () { assert_is_fluid('insertSiblingAfter', 'a'); }); it('should behave like .appendSibling', function () { $xml = new FluidXml(); $xml->appendSibling('sibling1', true)->appendSibling(['sibling2', 'sibling3'], ['class' => 'sibling']); $alias = new FluidXml(); $alias->insertSiblingAfter('sibling1', true)->insertSiblingAfter(['sibling2', 'sibling3'], ['class' => 'sibling']); $actual = $xml->xml();