You are here

function I18nFieldPlaceholderTestCase::setUp in Field placeholder 7.2

Same name and namespace in other branches
  1. 7 i18n_field_placeholder/i18n_field_placeholder.test \I18nFieldPlaceholderTestCase::setUp()

Prepares the testing environment.

Overrides DrupalWebTestCase::setUp

File

i18n_field_placeholder/i18n_field_placeholder.test, line 31

Class

I18nFieldPlaceholderTestCase

Code

function setUp() {
  parent::setUp('i18n_field_placeholder');
  parent::setUpLanguages();
  $this->translator = $this
    ->drupalCreateUser(array(
    'translate interface',
    'translate user-defined strings',
  ));

  // Create content type, with underscores.
  $type_name = strtolower($this
    ->randomName(8)) . '_test';
  $type = $this
    ->drupalCreateContentType(array(
    'name' => $type_name,
    'type' => $type_name,
  ));
  $this->type = $type->type;

  // Store a valid URL name, with hyphens instead of underscores.
  $this->hyphen_type = str_replace('_', '-', $this->type);
}