Provides a workaround for the inability to use the standard profile.
http://drupal.org/node/1708692
protected function mockStandardInstall() {
$type = array(
'type' => 'article',
);
$type = node_type_set_defaults($type);
node_type_save($type);
node_add_body_field($type);
// Create the vocabulary for the tag field.
$this->vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => 'Views testing tags',
'vid' => 'views_testing_tags',
));
$this->vocabulary
->save();
$field = array(
'field_name' => 'field_' . $this->vocabulary
->id(),
'type' => 'taxonomy_term_reference',
// Set cardinality to unlimited for tagging.
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
'settings' => array(
'allowed_values' => array(
array(
'vocabulary' => $this->vocabulary
->id(),
'parent' => 0,
),
),
),
);
field_create_field($field);
$instance = array(
'field_name' => 'field_' . $this->vocabulary
->id(),
'entity_type' => 'node',
'label' => 'Tags',
'bundle' => 'article',
);
field_create_instance($instance);
entity_get_form_display('node', 'article', 'default')
->setComponent($instance['field_name'], array(
'type' => 'taxonomy_autocomplete',
'weight' => -4,
))
->save();
entity_get_display('node', 'article', 'default')
->setComponent($instance['field_name'], array(
'type' => 'taxonomy_term_reference_link',
'weight' => 10,
))
->save();
entity_get_display('node', 'article', 'teaser')
->setComponent($instance['field_name'], array(
'type' => 'taxonomy_term_reference_link',
'weight' => 10,
))
->save();
}