protected function FeedsMapperMultilingualFieldsTestCase::getEnglishValues in Feeds 7.2
Returns expected and actual values of given node for the English language.
Parameters
object $node: The multilingual node.
string $langcode: The used language code.
Return value
array The expected and actual English values.
1 call to FeedsMapperMultilingualFieldsTestCase::getEnglishValues()
- FeedsMapperMultilingualFieldsTestCase::testMultilingualFieldMappings in tests/
feeds_mapper_multilingual_fields.test - Tests multilingual mappings to translatable fields (entity translation).
File
- tests/
feeds_mapper_multilingual_fields.test, line 940 - Contains FeedsMapperMultilingualFieldsTestCase.
Class
- FeedsMapperMultilingualFieldsTestCase
- Tests field mapping with multiple languages.
Code
protected function getEnglishValues($node, $langcode = 'en') {
return array(
'body' => array(
'expected' => 'This is the body',
'actual' => $node->body[$langcode][0]['value'],
),
'field_date' => array(
'expected' => '2015-10-21T00:00:00',
'actual' => $node->field_date[$langcode][0]['value'],
),
'field_datestamp' => array(
'expected' => '1445470140',
'actual' => $node->field_datestamp[$langcode][0]['value'],
),
'field_datetime' => array(
'expected' => '2015-10-21 23:29:00',
'actual' => $node->field_datetime[$langcode][0]['value'],
),
'field_image' => array(
'expected' => 'foosball.jpeg',
'actual' => $node->field_image[$langcode][0]['filename'],
),
'field_image:alt' => array(
'expected' => 'Foosball',
'actual' => $node->field_image[$langcode][0]['alt'],
),
'field_image:title' => array(
'expected' => 'Foosball played by two guys',
'actual' => $node->field_image[$langcode][0]['title'],
),
'field_link' => array(
'expected' => 'http://google.ca',
'actual' => $node->field_link[$langcode][0]['url'],
),
'field_list_boolean' => array(
'expected' => '0',
'actual' => $node->field_list_boolean[$langcode][0]['value'],
),
'field_number_decimal' => array(
'expected' => 4.2,
'actual' => $node->field_number_decimal[$langcode][0]['value'],
),
'field_number_float' => array(
'expected' => 3.1416,
'actual' => $node->field_number_float[$langcode][0]['value'],
),
'field_number_integer' => array(
'expected' => 1000,
'actual' => $node->field_number_integer[$langcode][0]['value'],
),
'field_text' => array(
'expected' => 'Carrots',
'actual' => $node->field_text[$langcode][0]['value'],
),
);
}