Skip to content
Snippets Groups Projects
Commit 8c58a319 authored by Dave Reid's avatar Dave Reid
Browse files

Issue #1066286: Added test to ensure 'Feed items' doesn't display on non-feed nodes.

parent 9232a314
No related branches found
No related tags found
No related merge requests found
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
* Test Feed configuration. * Test Feed configuration.
*/ */
class FeedsExamplesFeedTestCase extends FeedsWebTestCase { class FeedsExamplesFeedTestCase extends FeedsWebTestCase {
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Feature: Feed', 'name' => 'Feature: Feed',
'description' => 'Test "Feed" default configuration.', 'description' => 'Test "Feed" default configuration.',
'group' => 'Feeds', 'group' => 'Feeds',
'dependencies' => array('features', 'views'),
); );
} }
...@@ -22,7 +22,7 @@ class FeedsExamplesFeedTestCase extends FeedsWebTestCase { ...@@ -22,7 +22,7 @@ class FeedsExamplesFeedTestCase extends FeedsWebTestCase {
* Enable feeds_news feature. * Enable feeds_news feature.
*/ */
public function setUp() { public function setUp() {
parent::setUp(array('feeds_news')); parent::setUp(array('features', 'views', 'feeds_news'));
} }
/** /**
...@@ -31,6 +31,13 @@ class FeedsExamplesFeedTestCase extends FeedsWebTestCase { ...@@ -31,6 +31,13 @@ class FeedsExamplesFeedTestCase extends FeedsWebTestCase {
public function test() { public function test() {
$nid = $this->createFeedNode('feed', NULL, '', 'feed'); $nid = $this->createFeedNode('feed', NULL, '', 'feed');
// Assert menu tabs for feed nodes does not show up on non-feed nodes.
$this->drupalGet("node/{$nid}/feed-items");
$this->assertResponse(200);
$not_feed_node = $this->drupalCreateNode();
$this->drupalGet("node/{$not_feed_node->nid}/feed-items");
$this->assertResponse(404);
// Assert results. // Assert results.
$count = db_query("SELECT COUNT(*) FROM {node} WHERE type = 'feed_item'")->fetchField(); $count = db_query("SELECT COUNT(*) FROM {node} WHERE type = 'feed_item'")->fetchField();
$this->assertEqual($count, 10, 'Found the correct number of feed item nodes in database.'); $this->assertEqual($count, 10, 'Found the correct number of feed item nodes in database.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment