function ListFieldUITestCase::setUp in Drupal 7
Set the default field storage backend for fields created during tests.
Overrides FieldTestCase::setUp
File
- modules/
field/ modules/ list/ tests/ list.test, line 211 - Tests for list.module.
Class
- ListFieldUITestCase
- List module UI tests.
Code
function setUp() {
parent::setUp('field_test', 'field_ui');
// Create test user.
$admin_user = $this
->drupalCreateUser(array(
'access content',
'administer content types',
'administer taxonomy',
'administer fields',
));
$this
->drupalLogin($admin_user);
// Create content type, with underscores.
$type_name = 'test_' . strtolower($this
->randomName());
$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);
}