formatOutput = true;
$root = $dom->createElement('d:root');
$dom->appendChild($root);
$root->setAttribute('xmlns:d', 'DAV:');
$lockInfo = new DAV\Locks\LockInfo();
$lockInfo->uri = '/foo';
$locked = new Locked($lockInfo);
$locked->serialize(new DAV\Server(), $root);
$output = $dom->saveXML();
$expected = '
/foo
';
$this->assertEquals($expected, $output);
}
function testSerializeAmpersand() {
$dom = new DOMDocument('1.0');
$dom->formatOutput = true;
$root = $dom->createElement('d:root');
$dom->appendChild($root);
$root->setAttribute('xmlns:d', 'DAV:');
$lockInfo = new DAV\Locks\LockInfo();
$lockInfo->uri = '/foo&bar';
$locked = new Locked($lockInfo);
$locked->serialize(new DAV\Server(), $root);
$output = $dom->saveXML();
$expected = '
/foo&bar
';
$this->assertEquals($expected, $output);
}
}