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
d66f3130
Commit
d66f3130
authored
11 years ago
by
Chris Leppanen
Browse files
Options
Downloads
Patches
Plain Diff
Issue #1305698 by dman: Additional validation when creating terms - assert the Vocabulary is valid.
parent
8407bd06
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/feeds_processor_term.test
+29
-1
29 additions, 1 deletion
tests/feeds_processor_term.test
with
29 additions
and
1 deletion
tests/feeds_processor_term.test
+
29
−
1
View file @
d66f3130
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
class
FeedsCSVtoTermsTest
extends
FeedsWebTestCase
{
class
FeedsCSVtoTermsTest
extends
FeedsWebTestCase
{
public
static
function
getInfo
()
{
public
static
function
getInfo
()
{
return
array
(
return
array
(
'name'
=>
'
CSV import to t
axonomy'
,
'name'
=>
'
Processor: T
axonomy'
,
'description'
=>
'Tests a standalone import configuration that uses file fetcher and CSV parser to import taxonomy terms from a CSV file.'
,
'description'
=>
'Tests a standalone import configuration that uses file fetcher and CSV parser to import taxonomy terms from a CSV file.'
,
'group'
=>
'Feeds'
,
'group'
=>
'Feeds'
,
);
);
...
@@ -92,4 +92,32 @@ class FeedsCSVtoTermsTest extends FeedsWebTestCase {
...
@@ -92,4 +92,32 @@ class FeedsCSVtoTermsTest extends FeedsWebTestCase {
$this
->
assertNoText
(
'Gomez'
);
$this
->
assertNoText
(
'Gomez'
);
$this
->
assertNoText
(
'Pugsley'
);
$this
->
assertNoText
(
'Pugsley'
);
}
}
/**
* Test that saving an invalid vocabulary throws an exception.
*/
public
function
testInvalidVocabulary
()
{
$mappings
=
array
(
0
=>
array
(
'source'
=>
'name'
,
'target'
=>
'name'
,
'unique'
=>
1
,
),
);
$this
->
addMappings
(
'term_import'
,
$mappings
);
// Force configuration to be invalid.
$config
=
unserialize
(
db_query
(
"SELECT config FROM
{
feeds_importer
}
WHERE id = :id"
,
array
(
':id'
=>
'term_import'
))
->
fetchField
());
$config
[
'processor'
][
'config'
][
'bundle'
]
=
'does_not_exist'
;
db_update
(
'feeds_importer'
)
->
fields
(
array
(
'config'
=>
serialize
(
$config
)))
->
condition
(
'id'
,
'term_import'
)
->
execute
();
// Import and assert.
$this
->
importFile
(
'term_import'
,
$this
->
absolutePath
()
.
'/tests/feeds/users.csv'
);
$this
->
assertText
(
t
(
'No vocabulary defined for Taxonomy Term processor.'
));
}
}
}
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