Esempio n. 1
0
 public function testLink()
 {
     $link = new AtomLink();
     $link->setHref('http://www.example.com')->setLength(45)->setHreflang('en')->setRel('self')->setType('application/xml')->setTitle('My Title')->setTitle('Our Title');
     $this->assertSame('http://www.example.com', $link->getHref());
     $this->assertSame(45, $link->getLength());
     $this->assertSame('en', $link->getHreflang());
     $this->assertSame('self', $link->getRel());
     $this->assertSame('application/xml', $link->getType());
     $this->assertSame('Our Title', $link->getTitle());
 }
Esempio n. 2
0
    public function test()
    {
        $writer = new AtomWriter();
        $rssWriter = new RssWriter();
        $link = new AtomLink();
        $link->setHref('http://www.example.com')->setHreflang('en')->setLength(45)->setRel('self')->setType('application/xml')->setTitle('Our Title');
        $writer->writeLink($rssWriter, $link);
        $expected = <<<EOF
<atom:link href="http://www.example.com" length="45" hreflang="en" rel="self" type="application/xml" title="Our Title"/>
EOF;
        $this->assertSame($expected, $rssWriter->getXmlWriter()->flush());
    }