function Drupali18nTestCase::setUpLanguages in Internationalization 7
13 calls to Drupali18nTestCase::setUpLanguages()
- Drupali18nConfigTestCase::setUp in ./
i18n.test - Sets up a Drupal site for running functional and integration tests.
- i18nBlocksTestCase::setUp in i18n_block/
i18n_block.test - Sets up a Drupal site for running functional and integration tests.
- i18nFieldTestCase::setUp in i18n_field/
i18n_field.test - Sets up a Drupal site for running functional and integration tests.
- i18nForumTestCase::setUp in i18n_forum/
i18n_forum.test - Sets up a Drupal site for running functional and integration tests.
- i18nMenuTestCase::setUp in i18n_menu/
i18n_menu.test - Sets up a Drupal site for running functional and integration tests.
File
- ./
i18n.test, line 12 - Base class for Internationalization tests
Class
- Drupali18nTestCase
- @file Base class for Internationalization tests
Code
function setUpLanguages($admin_permissions = array()) {
// Setup admin user.
$this->admin_user = $this
->drupalCreateUser(array_merge(array(
'bypass node access',
'administer nodes',
'administer languages',
'administer content types',
'administer fields',
'administer blocks',
'access administration pages',
'translate interface',
), $admin_permissions));
$this
->drupalLogin($this->admin_user);
// Add languages.
$this->default_language = 'en';
$this->secondary_language = 'es';
$this
->addLanguage($this->default_language);
$this
->addLanguage($this->secondary_language);
// Enable URL language detection and selection to make the language switcher
// block appear.
$edit = array(
'language[enabled][locale-url]' => TRUE,
);
$this
->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
$this
->assertRaw(t('Language negotiation configuration saved.'), t('URL language detection enabled.'));
$this
->drupalGet('admin/config/regional/language/configure');
$this
->resetCaches();
}