public function executeFeed($request)
 {
     $feed = new sfRssDomFeed();
     $link = '@homepage';
     if ($request->hasParameter('slug') && $request->hasParameter('podcast_slug')) {
         $podcast = CommonBehavior::retrieveBySlug('PodcastPeer', $request->getParameter('podcast_slug'));
         $c = new Criteria();
         if (!$podcast) {
             $this->forward404();
         }
         $link = $podcast->getLink() ? $podcast->getLink() : $podcast->getUri();
         $podcast_feed = CommonBehavior::retrieveBySlug('FeedPeer', $request->getParameter('slug'), $c);
     }
     $format = $request->getParameter('format');
     // not "content format" but "delivery method enclosure format"
     $feed->initialize(array('title' => $podcast->getTitle(), 'link' => $link, 'generator' => sfConfig::get('app_version_url'), 'authorEmail' => $podcast->getEmail(), 'authorName' => $podcast->getAuthor(), 'description' => $podcast->getDescription(), 'image' => new sfFeedImage(array("image" => $podcast->getImageUrl()))));
     $pager = $this->getPager($podcast_feed->getId());
     $pager->init();
     $result_set = $pager->getResults();
     $objects = array();
     // temporary until we port convertObjectsToItems into sfDomFeed
     foreach ($result_set as $torrent) {
         $torrent->setFeedEnclosure($format);
         $objects[] = new sfDomFeedItem($torrent, array('enclosure' => new sfDomFeedEnclosure($torrent)));
     }
     $feed->addItems($objects);
     $this->feed = $feed;
 }
<?php

require_once dirname(__FILE__) . '/../bootstrap/unit.php';
require_once dirname(__FILE__) . '/../../lib/sfDomFeed.class.php';
require_once dirname(__FILE__) . '/../../lib/sfRssDomFeed.class.php';
$t = new lime_test(2, new lime_output_color());
$feed_params = array('title' => 'foo', 'link' => 'http://bar', 'description' => 'foobar baz', 'language' => 'fr', 'authorName' => 'francois', 'authorEmail' => '*****@*****.**', 'authorLink' => 'http://francois.toto.com', 'subtitle' => 'this is foo bar', 'categories' => array('apples', 'oranges'), 'feedUrl' => 'http://www.example.com', 'encoding' => 'UTF-16', 'feed_items' => array(new sfDomFeedItem(null, array('link' => 'http://wowthisworks.example.com/')), new sfDomFeedItem(null, array('title' => 'Do titles work?', 'link' => 'http://dotwowork.example.com/', 'enclosure' => new sfDomFeedEnclosure(null, array('url' => 'http://assets.example.com/foobar.wma'))))));
$feed = new sfRssDomFeed();
$t->isa_ok($feed->initialize($feed_params), 'sfRssDomFeed', 'initialize() returns the current feed object');
$t->isa_ok($feed->asXml(), 'string', 'asXml() outputs a string');
echo $feed->asXml();
<?php

require_once dirname(__FILE__) . '/../bootstrap/unit.php';
require_once dirname(__FILE__) . '/../../lib/sfDomFeed.class.php';
require_once dirname(__FILE__) . '/../../lib/sfRssDomFeed.class.php';
$t = new lime_test(0, new lime_output_color());
$feed_params = array('title' => 'foo', 'link' => 'http://bar', 'description' => 'foobar baz', 'language' => 'fr', 'authorName' => 'francois', 'authorEmail' => '*****@*****.**', 'authorLink' => 'http://francois.toto.com', 'subtitle' => 'this is foo bar', 'categories' => array('apples', 'oranges'), 'feedUrl' => 'http://www.example.com', 'encoding' => 'UTF-16', 'feed_items' => array(new sfDomFeedItem(null, array('link' => 'http://wowthisworks.example.com/')), new sfDomFeedItem(null, array('link' => 'http://dotwowork.example.com/'))));
$feed = new sfRssDomFeed($feed_params, array('dummy'));
echo $feed->asXml();