Skip to content
Snippets Groups Projects
Commit 8937be36 authored by Alex Barth's avatar Alex Barth
Browse files

Fix OPML tests.

parent 242d0284
No related branches found
No related tags found
No related merge requests found
...@@ -115,7 +115,7 @@ class FeedsExamplesOPMLTestCase extends FeedsWebTestCase { ...@@ -115,7 +115,7 @@ class FeedsExamplesOPMLTestCase extends FeedsWebTestCase {
// Import OPML and assert. // Import OPML and assert.
$file = $this->generateOPML(); $file = $this->generateOPML();
$this->importFile('opml', $file); $this->importFile('opml', $file);
$this->assertText('Created 3 feed nodes.'); $this->assertText('Created 3 Feed nodes.');
$count = db_query("SELECT COUNT(*) FROM {feeds_source}")->fetchField(); $count = db_query("SELECT COUNT(*) FROM {feeds_source}")->fetchField();
$this->assertEqual($count, 4, 'Found correct number of items.'); $this->assertEqual($count, 4, 'Found correct number of items.');
......
...@@ -357,7 +357,7 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -357,7 +357,7 @@ class FeedsNodeProcessor extends FeedsProcessor {
$nid = db_query("SELECT nid FROM {node} WHERE nid = :nid", array(':nid' => $value))->fetchField(); $nid = db_query("SELECT nid FROM {node} WHERE nid = :nid", array(':nid' => $value))->fetchField();
break; break;
case 'feeds_source': case 'feeds_source':
if ($id = feeds_get_importer_id($this->importer->config['content_type'])) { if ($id = feeds_get_importer_id($this->config['content_type'])) {
$nid = db_query("SELECT fs.feed_nid FROM {node} n JOIN {feeds_source} fs ON n.nid = fs.feed_nid WHERE fs.id = :id AND fs.source = :source", array(':id' => $id, ':source' => $value))->fetchField(); $nid = db_query("SELECT fs.feed_nid FROM {node} n JOIN {feeds_source} fs ON n.nid = fs.feed_nid WHERE fs.id = :id AND fs.source = :source", array(':id' => $id, ':source' => $value))->fetchField();
} }
break; break;
......
...@@ -130,20 +130,19 @@ class FeedsWebTestCase extends DrupalWebTestCase { ...@@ -130,20 +130,19 @@ class FeedsWebTestCase extends DrupalWebTestCase {
</head> </head>
<body> <body>
<outline text="Feeds test group" > <outline text="Feeds test group" >
<outline title="Development Seed - Technological Solutions for Progressive Organizations" text="" xmlUrl="'. $path .'developmentseed.rss2" type="rss" /> <outline title="Development Seed - Technological Solutions for Progressive Organizations" text="" xmlUrl="'. $path .'developmentseed.rss2" type="rss" />
<outline title="Magyar Nemzet Online - H’rek" text="" xmlUrl="'. $path .'feed_without_guid.rss2" type="rss" /> <outline title="Magyar Nemzet Online - H’rek" text="" xmlUrl="'. $path .'feed_without_guid.rss2" type="rss" />
<outline title="Drupal planet" text="" type="rss" xmlUrl="'. $path .'drupalplanet.rss2" /> <outline title="Drupal planet" text="" type="rss" xmlUrl="'. $path .'drupalplanet.rss2" />
</outline> </outline>
</body> </body>
</opml>'; </opml>';
// UTF 8 encode output string and write it to disk // UTF 8 encode output string and write it to disk
$output = utf8_encode($output); $output = utf8_encode($output);
$file = $this->absolute() .'/'. file_directory_path() .'/test-opml-'. $this->randomName() .'.opml'; $filename = file_default_scheme() . '://test-opml-'. $this->randomName() . '.opml';
$handle = fopen($file, 'w');
fwrite($handle, $output); $filename = file_unmanaged_save_data($output, $filename);
fclose($handle); return $filename;
return $file;
} }
/** /**
......
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