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

Issue #1248648 by twistor, Dave Reid: Fixed bugs and inconsistencies in FeedsRSStoNodesTest.

parent b39b5477
No related branches found
No related tags found
No related merge requests found
...@@ -173,7 +173,16 @@ class FeedsRSStoNodesTest extends FeedsWebTestCase { ...@@ -173,7 +173,16 @@ class FeedsRSStoNodesTest extends FeedsWebTestCase {
// Set to update existing, remove authorship of above nodes and import again. // Set to update existing, remove authorship of above nodes and import again.
$this->setSettings('syndication', 'FeedsNodeProcessor', array('update_existing' => 2)); $this->setSettings('syndication', 'FeedsNodeProcessor', array('update_existing' => 2));
db_query("UPDATE {node} n JOIN {feeds_item} fi ON fi.entity_type = 'node' AND n.nid = fi.entity_id SET n.uid = 0, fi.hash=''"); $nids = db_query("SELECT nid FROM {node} n INNER JOIN {feeds_item} fi ON fi.entity_type = 'node' AND n.nid = fi.entity_id")->fetchCol();
db_update('node')
->fields(array('uid' => 0))
->condition('nid', $nids, 'IN')
->execute();
db_update('feeds_item')
->fields(array('hash' => ''))
->condition('entity_type', 'node')
->condition('entity_id', $nids, 'IN')
->execute();
$this->drupalPost("node/$nid/import", array(), 'Import'); $this->drupalPost("node/$nid/import", array(), 'Import');
$this->drupalGet('node'); $this->drupalGet('node');
$this->assertNoPattern('/<span class="username">' . check_plain($this->auth_user->name) . '<\/span>/'); $this->assertNoPattern('/<span class="username">' . check_plain($this->auth_user->name) . '<\/span>/');
...@@ -396,10 +405,10 @@ class FeedsRSStoNodesTest extends FeedsWebTestCase { ...@@ -396,10 +405,10 @@ class FeedsRSStoNodesTest extends FeedsWebTestCase {
// There should not be feed links on an article node. // There should not be feed links on an article node.
$non_feed_node = $this->drupalCreateNode(array('type' => 'article')); $non_feed_node = $this->drupalCreateNode(array('type' => 'article'));
$this->drupalGet('node/' . $non_feed_node->nid); $this->drupalGet('node/' . $non_feed_node->nid);
$this->assertNoLink('Import'); $this->assertNoLinkByHref('node/' . $non_feed_node->nid . '/import');
$this->assertNoLink('Delete items'); $this->assertNoLink('Delete items');
// Navigat to a non-feed node form, there should be no Feed field visible. // Navigate to a non-feed node form, there should be no Feed field visible.
$this->drupalGet('node/add/article'); $this->drupalGet('node/add/article');
$this->assertNoFieldByName('feeds[FeedsHTTPFetcher][source]'); $this->assertNoFieldByName('feeds[FeedsHTTPFetcher][source]');
} }
......
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