From f16eccbe9d0199385e0334b1692d6a1ec7225917 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Wed, 28 Jan 2009 07:34:30 +0000 Subject: #365183 by Eaton: Fix for node_feed() silently discards ->content (with tests). --- modules/node/node.test | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'modules/node/node.test') diff --git a/modules/node/node.test b/modules/node/node.test index 420499c7f..531c22fe5 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -598,4 +598,40 @@ class NodePostSettingsTestCase extends DrupalWebTestCase { $node = $this->drupalGetNodeByTitle($edit['title']); $this->assertNoRaw(theme('node_submitted', $node), t('Post information is not displayed.')); } -} \ No newline at end of file +} + +/** + * Ensure that data added to nodes by other modules appears in RSS feeds. + * + * Create a node, enable the node_test module to ensure that extra data is + * added to the node->content array, then verify that the data appears on the + * sitewide RSS feed at rss.xml. + */ +class NodeRSSContentTestCase extends DrupalWebTestCase { + function getInfo() { + return array( + 'name' => t('Node RSS Content'), + 'description' => t('Ensure that data added to nodes by other modules appears in RSS feeds.'), + 'group' => t('Node'), + ); + } + + function setUp() { + // Enable dummy module that implements hook_nodeapi_view. + parent::setUp('node_test'); + } + + /** + * Create a new node and ensure that it includes the custom data when added + * to an RSS feed. + */ + function testNodeRSSContent() { + // Create a node. + $node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1)); + + $test_text = t('Extra test data added to node !nid.', array('!nid' => $node->nid)); + + $this->drupalGet('rss.xml'); + $this->assertText($test_text, t('Extra node content appears in RSS feed.')); + } +} -- cgit v1.2.3