Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
b0108a65
Commit
b0108a65
authored
11 years ago
by
Chris Leppanen
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
feeds.info
+1
-0
1 addition, 0 deletions
feeds.info
plugins/FeedsEntityProcessor.inc
+2
-2
2 additions, 2 deletions
plugins/FeedsEntityProcessor.inc
tests/feeds_processor_entity.test
+56
-0
56 additions, 0 deletions
tests/feeds_processor_entity.test
tests/feeds_tests.info
+1
-1
1 addition, 1 deletion
tests/feeds_tests.info
with
60 additions
and
3 deletions
feeds.info
+
1
−
0
View file @
b0108a65
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
plugins/FeedsEntityProcessor.inc
+
2
−
2
View file @
b0108a65
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
tests/feeds_processor_entity.test
0 → 100644
+
56
−
0
View file @
b0108a65
<?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
());
}
}
This diff is collapsed.
Click to expand it.
tests/feeds_tests.info
+
1
−
1
View file @
b0108a65
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment