Permalink
Browse files

Added tests to ticket #959

  • Loading branch information...
jrbasso committed Aug 5, 2010
1 parent 22b7d82 commit aee6458028d8a62ab72cf735582f7cbb86fc0a4d
Showing with 34 additions and 0 deletions.
  1. +34 −0 cake/tests/cases/libs/view/helpers/rss.test.php
@@ -514,6 +514,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);
}
/**
* testTime method

0 comments on commit aee6458

Please sign in to comment.