summaryrefslogtreecommitdiff
path: root/modules/node/node.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-03 10:11:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-03 10:11:35 +0000
commita8c30ed91ea00e24f809adc965b05f8292fbc236 (patch)
tree386db65fe5377df5373bf3e2a2b30bf1112a5fc7 /modules/node/node.test
parent3d951475eaebab990a78d07acdc344eb50239e18 (diff)
downloadbrdo-a8c30ed91ea00e24f809adc965b05f8292fbc236.tar.gz
brdo-a8c30ed91ea00e24f809adc965b05f8292fbc236.tar.bz2
- Patch #449718 by alienbrain: node_feed() is now using new node building API.
Diffstat (limited to 'modules/node/node.test')
-rw-r--r--modules/node/node.test25
1 files changed, 22 insertions, 3 deletions
diff --git a/modules/node/node.test b/modules/node/node.test
index 022b0cf78..cf2cb4802 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -658,10 +658,29 @@ class NodeRSSContentTestCase extends DrupalWebTestCase {
// 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.'));
+
+ // Check that content added in NODE_BUILD_RSS appear in RSS feed.
+ $rss_only_content = t('Extra data that should appear only in the RSS feed for node !nid.', array('!nid' => $node->nid));
+ $this->assertText($rss_only_content, t('Node content designated for RSS appear in RSS feed.'));
+
+ // Check that content added in build modes other than NODE_BUILD_RSS doesn't
+ // appear in RSS feed.
+ $non_rss_content = t('Extra data that should appear everywhere except the RSS feed for node !nid.', array('!nid' => $node->nid));
+ $this->assertNoText($non_rss_content, t('Node content not designed for RSS doesn\'t appear in RSS feed.'));
+
+ // Check that extra RSS elements and namespaces are added to RSS feed.
+ $test_element = array(
+ 'key' => 'testElement',
+ 'value' => t('Value of testElement RSS element for node !nid.', array('!nid' => $node->nid)),
+ );
+ $test_ns = 'xmlns:drupaltest="http://example.com/test-namespace"';
+ $this->assertRaw(format_xml_elements(array($test_element)), t('Extra RSS elements appear in RSS feed.'));
+ $this->assertRaw($test_ns, t('Extra namespaces appear in RSS feed.'));
+
+ // Check that content added in NODE_BUILD_RSS doesn't appear when viewing node.
+ $this->drupalGet("node/$node->nid");
+ $this->assertNoText($rss_only_content, t('Node content designed for RSS doesn\'t appear when viewing node.'));
}
}