function EntityTranslationTaxonomyAutocompleteTestCase::configureContentType in Entity Translation 7
Configure the "Basic page" content type for entity translation tests.
Overrides EntityTranslationTestCase::configureContentType
1 call to EntityTranslationTaxonomyAutocompleteTestCase::configureContentType()
- EntityTranslationTaxonomyAutocompleteTestCase::setUp in tests/
entity_translation.test - Sets up a Drupal site for running functional and integration tests.
File
- tests/
entity_translation.test, line 1255 - Tests for Entity translation module.
Class
- EntityTranslationTaxonomyAutocompleteTestCase
- Tests for the taxonomy autocomplete translation modes.
Code
function configureContentType() {
parent::configureContentType();
// Create an untranslatable term reference field with unlimited cardinality.
$edit = array(
'fields[_add_new_field][label]' => 'Test tags',
'fields[_add_new_field][field_name]' => 'test_tags',
'fields[_add_new_field][type]' => 'taxonomy_term_reference',
'fields[_add_new_field][widget_type]' => 'taxonomy_autocomplete',
);
$this
->drupalPost('admin/structure/types/manage/page/fields', $edit, t('Save'));
$edit = array(
'field[settings][allowed_values][0][vocabulary]' => 'tags',
);
$this
->drupalPost('admin/structure/types/manage/page/fields/field_test_tags/field-settings', $edit, t('Save field settings'));
// Verify the in-place translation option is available.
$this
->drupalGet('admin/structure/types/manage/page/fields/field_test_tags');
$this
->assertRaw(t('Enable in-place translation of terms'));
$edit = array(
'field[cardinality]' => FIELD_CARDINALITY_UNLIMITED,
);
$this
->drupalPost(NULL, $edit, t('Save settings'));
// Ensure entity info is up-to-date.
drupal_flush_all_caches();
}