function EntityTranslationTranslationTestCase::testFieldTranslation in Entity Translation 7
Test if field based translation works.
Enable field based translation for basic pages. Add a field with a cardinality higher than 1, to test if field_default_extract_form_values() is invoked. Create a basic page and translate it.
File
- tests/
entity_translation.test, line 330 - Tests for Entity translation module.
Class
- EntityTranslationTranslationTestCase
- Basic tests for the translation creation/editing workflow.
Code
function testFieldTranslation() {
// Create Basic page in English.
$node_title = $this
->randomName();
$node_body = $this
->randomName();
$node = $this
->createPage($node_title, $node_body, 'en');
// Submit translation in Spanish.
$node_translation_title = $this
->randomName();
$node_translation_body = $this
->randomName();
$node_translation = $this
->createTranslation($node, $node_translation_title, $node_translation_body, 'es');
}