File
- core/modules/locale/tests/locale.test, line 2602
- Tests for locale.module.
Class
- LocaleMultilingualFieldsFunctionalTest
- Functional test for multilingual fields.
Code
function testMultilingualDisplaySettings() {
$langcode = LANGUAGE_NONE;
$title_key = "title";
$title_value = $this->randomName(8);
$body_key = "body[$langcode][0][value]";
$body_value = $this->randomName(16);
$edit = array();
$edit[$title_key] = $title_value;
$edit[$body_key] = $body_value;
$edit['langcode'] = 'en';
$this->backdropPost('node/add/page', $edit, t('Save'));
$node = $this->backdropGetNodeByTitle($edit[$title_key]);
$this->assertTrue($node, 'Node found in database.');
$this->backdropGet("node/$node->nid");
$body = $this->xpath('//article[@id=:id]//p', array(':id' => 'node-' . $node->nid));
$this->assertEqual(current($body), $node->body['en'][0]['value'], 'Node body is correctly shown.');
}