You are here

function SimpleNewsI18nTestCase::setUpLanguages in Simplenews 7

Same name and namespace in other branches
  1. 7.2 tests/simplenews.test \SimpleNewsI18nTestCase::setUpLanguages()

Set up configuration for multiple languages.

Copied from Drupali18nTestCase::setUpLanguages().

1 call to SimpleNewsI18nTestCase::setUpLanguages()
SimpleNewsI18nTestCase::setUp in tests/simplenews.test
Sets up a Drupal site for running functional and integration tests.

File

tests/simplenews.test, line 1847
Simplenews test functions.

Class

SimpleNewsI18nTestCase
Tests for I18N integration.

Code

function setUpLanguages($admin_permissions = array()) {

  // 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');
  drupal_static_reset('locale_url_outbound_alter');
  drupal_static_reset('language_list');
}