Esempio n. 1
0
 public function test()
 {
     $item = new ItunesItem();
     $item->setDuration('3:43:23')->setIsClosedCaptionned(false)->setOrder(3)->setIsClosedCaptionned(true);
     $this->assertSame(3, $item->getOrder());
     $this->assertSame('3:43:23', $item->getDuration());
     $this->assertTrue($item->getIsClosedCaptionned());
 }
Esempio n. 2
0
 public function testWriteItem()
 {
     $rssWriter = new RssWriter();
     $writer = new ItunesWriter();
     $item = new ItunesItem();
     $item->setAuthor('John Doe')->setBlock(true)->setImage('https://link.to/my_image.jpg')->setExplicit(true)->setSubtitle('The Subtitle')->setSummary('The Summary')->setDuration('03:04:34')->setIsClosedCaptionned(true)->setOrder(4);
     $writer->writeItem($rssWriter, $item);
     $xml = $rssWriter->getXmlWriter()->flush();
     $expected = '<itunes:author><![CDATA[John Doe]]></itunes:author><itunes:summary><![CDATA[The Summary]]></itunes:summary><itunes:block>Yes</itunes:block><itunes:image href="https://link.to/my_image.jpg"/><itunes:explicit>Yes</itunes:explicit><itunes:subtitle><![CDATA[The Subtitle]]></itunes:subtitle><itunes:duration>03:04:34</itunes:duration><itunes:isClosedCaption>Yes</itunes:isClosedCaption><itunes:order>4</itunes:order>';
     $this->assertEquals($expected, $xml);
 }