You are here

protected function FieldConfiguration::createConfigToExport in Configuration Management 7.2

This function creates the configurations that will be exported by configuration management.

Overrides ConfigurationHandlerBaseTestCase::createConfigToExport

File

tests/handlers/TestFieldConfiguration.test, line 121
Tests for Configuration Management: Fields.

Class

FieldConfiguration
@file Tests for Configuration Management: Fields.

Code

protected function createConfigToExport() {
  $web_user = $this
    ->drupalCreateUser(array(
    'administer content types',
  ));
  $this
    ->drupalLogin($web_user);
  $type = $this
    ->drupalCreateContentType();
  $edit = array();
  $edit['fields[_add_new_field][label]'] = 'my_field';
  $edit['fields[_add_new_field][field_name]'] = 'my_field';
  $edit['fields[_add_new_field][type]'] = 'text';
  $edit['fields[_add_new_field][widget_type]'] = 'text_textfield';
  $this
    ->drupalPost('admin/structure/types/manage/' . $type->type . '/fields', $edit, t('Save'));
  $this
    ->drupalPost(NULL, array(), t('Save field settings'));
  $this
    ->drupalPost(NULL, array(), t('Save settings'));
  $this->field_name = $type->type;
}