Permalink
Browse files

Added tests to ticket #959

  • Loading branch information...
1 parent f2f2987 commit 72bb229a9cabd739a04f3ab0c6ed038854b87f9a @jrbasso jrbasso committed Aug 5, 2010
Showing with 34 additions and 0 deletions.
  1. +34 −0 cake/tests/cases/libs/view/helpers/rss.test.php
@@ -517,6 +517,40 @@ function testItem() {
'/item'
);
$this->assertTags($result, $expected);
+
+ $item = array(
+ 'title' => 'Foo bar',
+ 'link' => array(
+ 'url' => 'http://example.com/foo?a=1&b=2',
+ 'convertEntities' => false
+ ),
+ 'description' => array(
+ 'value' => 'descriptive words',
+ 'cdata' => true,
+ ),
+ 'pubDate' => '2008-05-31 12:00:00'
+ );
+ $result = $this->Rss->item(null, $item);
+ $expected = array(
+ '<item',
+ '<title',
+ 'Foo bar',
+ '/title',
+ '<link',
+ 'http://example.com/foo?a=1&amp;b=2',
+ '/link',
+ '<description',
+ '<![CDATA[descriptive words]]',
+ '/description',
+ '<pubDate',
+ date('r', strtotime('2008-05-31 12:00:00')),
+ '/pubDate',
+ '<guid',
+ 'http://example.com/foo?a=1&amp;b=2',
+ '/guid',
+ '/item'
+ );
+ $this->assertTags($result, $expected);
}
/**

0 comments on commit 72bb229

Please sign in to comment.