function i18nVariableTestCase::setUpContentTranslation in Internationalization 7
Set up translation for content type (page)
Overrides Drupali18nTestCase::setUpContentTranslation
1 call to i18nVariableTestCase::setUpContentTranslation()
- i18nVariableTestCase::testVariableLocalize in i18n_variable/
i18n_variable.test
File
- i18n_variable/
i18n_variable.test, line 26 - Test case for multilingual variables
Class
- i18nVariableTestCase
- @file Test case for multilingual variables
Code
function setUpContentTranslation($settings = array()) {
$this->translator = $this
->drupalCreateUser(array(
'create page content',
'edit own page content',
'translate content',
));
$this
->drupalLogin($this->admin_user);
// Set "Basic page" content type to use multilingual support with
// translation.
$this
->drupalGet('admin/structure/types/manage/page');
$edit = array();
$edit['language_content_type'] = 2;
// Mark status and promoted
$edit['node_options[status]'] = 1;
$this
->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
$this
->assertRaw(t('The content type %type has been updated.', array(
'%type' => 'Basic page',
)), t('Basic page content type has been updated.'));
// Enable the language switcher block.
$language_type = LANGUAGE_TYPE_INTERFACE;
$edit = array(
"blocks[locale_{$language_type}][region]" => 'sidebar_first',
);
$this
->drupalPost('admin/structure/block', $edit, t('Save blocks'));
}