You are here

function EntityTranslationTestCase::configureContentType in Entity Translation 7

Configure the "Basic page" content type for entity translation tests.

6 calls to EntityTranslationTestCase::configureContentType()
EntityTranslationCommentTestCase::setUp in tests/entity_translation.test
Sets up a Drupal site for running functional and integration tests.
EntityTranslationHookTestCase::setUp in tests/entity_translation.test
Sets up a Drupal site for running functional and integration tests.
EntityTranslationIntegrationTestCase::setUp in tests/entity_translation.test
Sets up a Drupal site for running functional and integration tests.
EntityTranslationMenuTranslationTestCase::setUp in entity_translation_i18n_menu/entity_translation_i18n_menu.test
Sets up a Drupal site for running functional and integration tests.
EntityTranslationTaxonomyAutocompleteTestCase::configureContentType in tests/entity_translation.test
Configure the "Basic page" content type for entity translation tests.

... See full list

2 methods override EntityTranslationTestCase::configureContentType()
EntityTranslationContentTranslationTestCase::configureContentType in tests/entity_translation.test
Configure the "Basic page" content type for entity translation tests.
EntityTranslationTaxonomyAutocompleteTestCase::configureContentType in tests/entity_translation.test
Configure the "Basic page" content type for entity translation tests.

File

tests/entity_translation.test, line 192
Tests for Entity translation module.

Class

EntityTranslationTestCase
Base class for entity translation module tests.

Code

function configureContentType() {

  // Configure the "Basic page" content type to use multilingual support with
  // translation.
  $edit = array();
  $edit['language_content_type'] = ENTITY_TRANSLATION_ENABLED;
  $this
    ->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
  $this
    ->assertRaw(t('The content type %type has been updated.', array(
    '%type' => 'Basic page',
  )), t('Basic page content type has been updated.'));

  // Set body field's cardinality to unlimited and toggle translatability.
  $edit = array();
  $edit['field[cardinality]'] = FIELD_CARDINALITY_UNLIMITED;
  $edit['field[translatable]'] = 1;
  $this
    ->drupalPost('admin/structure/types/manage/page/fields/body', $edit, t('Save settings'));
  $this
    ->assertRaw(t('Saved %field configuration.', array(
    '%field' => 'Body',
  )), t('Body field settings have been updated.'));

  // Check if the setting works.
  $this
    ->drupalGet('node/add/page');
  $this
    ->assertFieldById('edit-body-en-add-more', t('Add another item'), t('Add another item button found.'));

  // Settings defaults for new page nodes.
  variable_set('entity_translation_settings_node__page', array(
    'default_language' => ENTITY_TRANSLATION_LANGUAGE_CURRENT,
    'hide_language_selector' => 0,
    'exclude_language_none' => 1,
    'lock_language' => 1,
    'shared_fields_original_only' => 0,
    'locale_field_language_fallback' => 0,
  ));
}