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

Issue #2178563 by twistor | alibama: Entityform does not seem to work.

parent bf490636
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ files[] = tests/feeds_mapper_profile.test ...@@ -41,6 +41,7 @@ files[] = tests/feeds_mapper_profile.test
files[] = tests/feeds_mapper.test files[] = tests/feeds_mapper.test
files[] = tests/feeds_mapper_config.test files[] = tests/feeds_mapper_config.test
files[] = tests/feeds_fetcher_file.test files[] = tests/feeds_fetcher_file.test
files[] = tests/feeds_processor_entity.test
files[] = tests/feeds_processor_node.test files[] = tests/feeds_processor_node.test
files[] = tests/feeds_processor_term.test files[] = tests/feeds_processor_term.test
files[] = tests/feeds_processor_user.test files[] = tests/feeds_processor_user.test
......
...@@ -60,8 +60,8 @@ class FeedsEntityProcessor extends FeedsProcessor { ...@@ -60,8 +60,8 @@ class FeedsEntityProcessor extends FeedsProcessor {
$info = $this->entityInfo(); $info = $this->entityInfo();
$values = $this->config['values']; $values = $this->config['values'];
if (isset($info['entity keys']['bundle']) && isset($config['bundle'])) { if (isset($info['entity keys']['bundle']) && isset($this->config['bundle'])) {
$values[$info['entity keys']['bundle']] = $config['bundle']; $values[$info['entity keys']['bundle']] = $this->config['bundle'];
} }
return entity_create($this->entityType(), $values); return entity_create($this->entityType(), $values);
......
<?php
/**
* @file
* Tests for plugins/FeedsEntityProcessor.inc.
*/
/**
* Test aggregating a feed as node items.
*/
class FeedsEntityProcessorTest extends FeedsWebTestCase {
public static function getInfo() {
return array(
'name' => 'Processor: Entity',
'description' => 'Tests importing entities using the generic processor.',
'group' => 'Feeds',
'dependencies' => array('entity_test'),
);
}
/**
* Set up test.
*/
public function setUp() {
parent::setUp(array('entity_test'));
// Create an importer configuration.
$this->createImporterConfiguration('Syndication', 'syndication');
$this->setPlugin('syndication', 'FeedsEntityProcessorEntity_test');
}
/**
* Test basic entity creation.
*/
public function test() {
$bundle = drupal_strtolower($this->randomName());
// Create bundle entity.
entity_create('entity_test_type', array(
'id' => drupal_strtolower($this->randomName()),
'name' => $bundle,
))->save();
$this->setSettings('syndication', 'FeedsEntityProcessorEntity_test', array(
'bundle' => $bundle,
));
// Run import.
$this->createFeedNode();
// Assert 10 items aggregated after creation of the node.
$this->assertText('Created 10 test entity');
$this->assertEqual(10, db_query("SELECT COUNT(*) FROM {entity_test}")->fetchField());
}
}
...@@ -3,5 +3,5 @@ description = "Support module for Feeds related testing." ...@@ -3,5 +3,5 @@ description = "Support module for Feeds related testing."
package = Testing package = Testing
version = VERSION version = VERSION
core = 7.x core = 7.x
files[] = feeds_test.module test_dependencies[] = entity
hidden = TRUE hidden = TRUE
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