public function Feedsi18nNodeTestCase::testWithLanguageMappingTarget in Feeds 7.2
Tests processor language setting in combination with language mapping target.
File
- tests/
feeds_i18n_node.test, line 81 - Contains Feedsi18nNodeTestCase.
Class
- Feedsi18nNodeTestCase
- Tests importing nodes in a language.
Code
public function testWithLanguageMappingTarget() {
$this
->addMappings('i18n', array(
2 => array(
'source' => 'language',
'target' => 'language',
),
));
// Import csv file. The first item has a language specified (Dutch), the second
// one has no language specified and should be imported in the processor's language (German).
$this
->importFile('i18n', $this
->absolutePath() . '/tests/feeds/content_i18n.csv');
// The first node should be Dutch.
$node = node_load(1);
$this
->assertEqual('nl', entity_language('node', $node), 'Item 1 has the Dutch language assigned.');
// The second node should be German.
$node = node_load(2);
$this
->assertEqual('de', entity_language('node', $node), 'Item 2 has the German language assigned.');
}