You are here

function TMGMTEntitySourceUITestCase::setUp in Translation Management Tool 7

Overrides DrupalWebTestCase::setUp()

Overrides TMGMTBaseTestCase::setUp

File

sources/entity/ui/tmgmt_entity_ui.test, line 18

Class

TMGMTEntitySourceUITestCase
Basic Node Source tests.

Code

function setUp() {
  parent::setUp(array(
    'tmgmt_entity_ui',
    'block',
    'comment',
  ));
  variable_set('language_content_type_page', ENTITY_TRANSLATION_ENABLED);
  variable_set('language_content_type_article', ENTITY_TRANSLATION_ENABLED);
  $this
    ->loginAsAdmin(array(
    'create translation jobs',
    'submit translation jobs',
    'accept translation jobs',
    'administer blocks',
    'administer entity translation',
    'toggle field translatability',
  ));
  $this
    ->setEnvironment('de');
  $this
    ->setEnvironment('fr');
  $this
    ->setEnvironment('es');
  $this
    ->setEnvironment('el');
  $this
    ->createNodeType('page', st('Page'), ENTITY_TRANSLATION_ENABLED);
  $this
    ->createNodeType('article', st('Article'), ENTITY_TRANSLATION_ENABLED);

  // Enable path locale detection.
  $edit = array(
    'language[enabled][locale-url]' => TRUE,
    'language_content[enabled][locale-interface]' => TRUE,
  );
  $this
    ->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));

  // @todo Re-enable this when switching to testing profile.
  // Enable the main page content block for hook_page_alter() to work.
  $edit = array(
    'blocks[system_main][region]' => 'content',
  );
  $this
    ->drupalPost('admin/structure/block', $edit, t('Save blocks'));
}