You are here

protected function ScaldLocalizeTestCase::setUp in Scald: Media Management made easy 7

Sets up a Drupal site for running functional and integration tests.

Overrides ScaldWebTestCase::setUp

File

tests/scald.test, line 599
Tests for scald.module.

Class

ScaldLocalizeTestCase
Test the Scald localization.

Code

protected function setUp() {
  parent::setUp(array(
    'scald_image',
    'locale',
    'i18n',
    'i18n_string',
  ));
  $this->web_user = $this
    ->drupalCreateUser(array(
    'administer scald',
    'create atom of image type',
    'view any atom',
    'fetch any atom',
    'delete any atom',
    'edit own atom',
    'administer languages',
    'access administration pages',
    'translate interface',
    'translate user-defined strings',
  ));
  $this
    ->drupalLogin($this->web_user);

  // Add predefined language.
  $this->langcode = 'fr';
  $this
    ->drupalPost('admin/config/regional/language/add', array(
    'langcode' => $this->langcode,
  ), t('Add language'));

  // Enable URL language detection and selection.
  $edit = array(
    'language[enabled][locale-url]' => '1',
  );
  $this
    ->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
}