Exemplo n.º 1
0
    public function testWriter()
    {
        $writer = new Writer();
        $writer->addService('http://www.myopenid.com/server', array('http://specs.openid.net/auth/2.0/signon'));
        $writer->addService('http://www.myopenid.com/server', array('http://specs.openid.net/auth/2.0/signon'), 20);
        $actual = $writer->toString();
        $expected = <<<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns="xri://$xrd*($v*2.0)" xmlns:xrds="xri://$xrds">
  <XRD>
    <Service>
      <Type>http://specs.openid.net/auth/2.0/signon</Type>
      <URI>http://www.myopenid.com/server</URI>
    </Service>
    <Service priority="20">
      <Type>http://specs.openid.net/auth/2.0/signon</Type>
      <URI>http://www.myopenid.com/server</URI>
    </Service>
  </XRD>
</xrds:XRDS>
XML;
        $this->assertXmlStringEqualsXmlString($expected, $actual);
    }