Skip to content
Snippets Groups Projects
Commit e21af4c2 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Issue #1711648 by twistor: Fixes for tests.

parent f54cac1d
No related branches found
No related tags found
No related merge requests found
......@@ -25,10 +25,7 @@ class FeedsFileFetcherTestCase extends FeedsWebTestCase {
// Set up an importer.
$this->createImporterConfiguration('Node import', 'node');
// Set and configure plugins and mappings.
$edit = array(
'content_type' => '',
);
$this->drupalPost('admin/structure/feeds/node/settings', $edit, 'Save');
$this->setSettings('node', NULL, array('content_type' => ''));
$this->setPlugin('node', 'FeedsFileFetcher');
$this->setPlugin('node', 'FeedsCSVParser');
$mappings = array(
......
......@@ -43,8 +43,7 @@ class FeedsMapperDateTestCase extends FeedsMapperTestCase {
$this->createImporterConfiguration('Date RSS', 'daterss');
$this->setSettings('daterss', NULL, array('content_type' => '', 'import_period' => FEEDS_SCHEDULE_NEVER));
$this->setPlugin('daterss', 'FeedsFileFetcher');
$this->setPlugin('daterss', 'FeedsSyndicationParser');
$this->setSettings('daterss', 'FeedsNodeProcessor', array('content_type' => $typename));
$this->setSettings('daterss', 'FeedsNodeProcessor', array('bundle' => $typename));
$this->addMappings('daterss', array(
0 => array(
'source' => 'title',
......@@ -81,7 +80,7 @@ class FeedsMapperDateTestCase extends FeedsMapperTestCase {
'01/06/2010 - 06:05',
'01/06/2010 - 11:26',
'01/07/2010 - 00:26',
);
);
for ($i = 1; $i <= 6; $i++) {
$this->drupalGet("node/$i/edit");
$this->assertNodeFieldValue('date', $values[$i-1]);
......
......@@ -38,7 +38,7 @@ class FeedsMapperFieldTestCase extends FeedsMapperTestCase {
$this->setSettings('csv', NULL, array('content_type' => '', 'import_period' => FEEDS_SCHEDULE_NEVER));
$this->setPlugin('csv', 'FeedsFileFetcher');
$this->setPlugin('csv', 'FeedsCSVParser');
$this->setSettings('csv', 'FeedsNodeProcessor', array('content_type' => $typename));
$this->setSettings('csv', 'FeedsNodeProcessor', array('bundle' => $typename));
$this->addMappings('csv', array(
0 => array(
'source' => 'title',
......
......@@ -47,7 +47,7 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
// Create importer configuration.
$this->createImporterConfiguration();
$this->setPlugin('syndication', 'FeedsSimplePieParser');
$this->setSettings('syndication', 'FeedsNodeProcessor', array('content_type' => $typename));
$this->setSettings('syndication', 'FeedsNodeProcessor', array('bundle' => $typename));
$this->addMappings('syndication', array(
0 => array(
'source' => 'title',
......@@ -90,7 +90,8 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
// Create a CSV importer configuration.
$this->createImporterConfiguration('Node import from CSV', 'node');
$this->setPlugin('node', 'FeedsCSVParser');
$this->setSettings('node', 'FeedsNodeProcessor', array('content_type' => $typename));
$this->setSettings('node', 'FeedsNodeProcessor', array('bundle' => $typename));
$this->setSettings('node', NULL, array('content_type' => ''));
$this->addMappings('node', array(
0 => array(
'source' => 'title',
......@@ -101,10 +102,6 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
'target' => 'field_files'
),
));
$edit = array(
'content_type' => '',
);
$this->drupalPost('admin/structure/feeds/node/settings', $edit, 'Save');
// Import.
$edit = array(
......
......@@ -59,7 +59,7 @@ class FeedsMapperLinkTestCase extends FeedsMapperTestCase {
// Create importer configuration.
$this->createImporterConfiguration(); //Create a default importer configuration
$this->setSettings('syndication', 'FeedsNodeProcessor', array('content_type' => $typename)); //Processor settings
$this->setSettings('syndication', 'FeedsNodeProcessor', array('bundle' => $typename)); //Processor settings
$this->addMappings('syndication', array(
0 => array(
'source' => 'title',
......
......@@ -94,10 +94,7 @@ class FeedsMapperPathTestCase extends FeedsMapperTestCase {
);
$this->drupalPost('admin/structure/taxonomy/add', $edit, t('Save'));
$this->setSettings('path_test', 'FeedsTermProcessor', array('vocabulary' => 'addams'));
// Turn on update existing.
$this->setSettings('path_test', 'FeedsTermProcessor', array('update_existing' => 2));
$this->setSettings('path_test', 'FeedsTermProcessor', array('bundle' => 'addams', 'update_existing' => 2));
// Add mappings.
$this->addMappings('path_test', array(
......@@ -208,7 +205,7 @@ class FeedsMapperPathPathautoTestCase extends FeedsMapperTestCase {
$aliases = array();
for ($i = 1; $i <= 9; $i++) {
$aliases[] = "path$i";
$aliases[] = "content/pathauto$i";
}
$this->assertAliasCount($aliases);
......@@ -229,12 +226,7 @@ class FeedsMapperPathPathautoTestCase extends FeedsMapperTestCase {
}
public function assertAliasCount($aliases) {
$in_db = db_select('url_alias', 'a')
->fields('a')
->condition('a.alias', $aliases)
->execute()
->fetchAll();
$in_db = db_query("SELECT * FROM {url_alias} WHERE alias IN (:aliases)", array(':aliases' => $aliases))->fetchAll();
$this->assertEqual(count($in_db), count($aliases), 'Correct number of aliases in db.');
}
}
......@@ -408,13 +408,13 @@ class FeedsRSStoNodesTest extends FeedsWebTestCase {
}
/**
* Test that nodes will not be created if the user is unauthorized to create
* Test that nodes will not be created if the user is unauthorized to create
* them.
*/
public function testAuthorize() {
// Create a user with limited permissions. We can't use
// $this->drupalCreateUser here because we need to to set a specific user
// Create a user with limited permissions. We can't use
// $this->drupalCreateUser here because we need to to set a specific user
// name.
$edit = array(
'name' => 'Development Seed',
......
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