13        $href = 
new Href(
'path');
 
   14        $this->assertEquals(
'path', $href->getHref());
 
   20        $href = 
new Href(
'path');
 
   21        $this->assertEquals(
'path', $href->getHref());
 
   23        $this->contextUri = 
'/bla/';
 
   25        $xml = $this->
write([
'{DAV:}anything' => $href]);
 
   27        $this->assertXmlStringEqualsXmlString(
 
   29<d:anything xmlns:d="DAV:"><d:href>/bla/path</d:href></d:anything> 
   36        $xml = 
'<?xml version="1.0"?> 
   37<d:anything xmlns:d="DAV:"><d:href>/bla/path</d:href></d:anything> 
   40        $result = $this->
parse(
$xml, [
'{DAV:}anything' => 
'Sabre\\DAV\\Xml\\Property\\Href']);
 
   44        $this->assertInstanceOf(
'Sabre\\DAV\\Xml\\Property\\Href', $href);
 
   46        $this->assertEquals(
'/bla/path', $href->getHref());
 
   52        $xml = 
'<?xml version="1.0"?> 
   53<d:anything xmlns:d="DAV:"><d:href2>/bla/path</d:href2></d:anything> 
   55        $result = $this->
parse(
$xml, [
'{DAV:}anything' => 
'Sabre\\DAV\\Xml\\Property\\Href']);
 
   57        $this->assertNull($href);
 
   62        $xml = 
'<?xml version="1.0"?> 
   63<d:anything xmlns:d="DAV:"></d:anything> 
   65        $result = $this->
parse(
$xml, [
'{DAV:}anything' => 
'Sabre\\DAV\\Xml\\Property\\Href']);
 
   67        $this->assertNull($href);
 
   76        $href = 
new Href(
'http://example.org/?a&b', 
false);
 
   77        $this->assertEquals(
'http://example.org/?a&b', $href->getHref());
 
   79        $xml = $this->
write([
'{DAV:}anything' => $href]);
 
   81        $this->assertXmlStringEqualsXmlString(
 
   83<d:anything xmlns:d="DAV:"><d:href>http://example.org/?a&b</d:href></d:anything> 
   93            'http://example.org/bar' 
  102            '<a href="/foo/bar">/foo/bar</a><br />' .
 
  103            '<a href="/base/foo/bar">/base/foo/bar</a><br />' .
 
  104            '<a href="http://example.org/bar">http://example.org/bar</a>';
 
  105        $this->assertEquals($expected, $href->toHtml(
$html));
 
An exception for terminatinating execution or to throw for unit testing.
This class provides a few utility functions for easily generating HTML for the browser plugin.
testSerializeEntity()
This method tests if hrefs containing & are correctly encoded.
testUnserializeIncompatible()
parse($xml, array $elementMap=[])