Tests that field instances with no explicit display settings do not break.
function testNonInitializedFields() {
// Create a test field.
$edit = array(
'fields[_add_new_field][label]' => 'Test',
'fields[_add_new_field][field_name]' => 'test',
);
$this
->fieldUIAddNewField('admin/structure/types/manage/' . $this->type, $edit);
// Check that no settings have been set for the 'teaser' mode.
$instance = field_info_instance('node', 'field_test', $this->type);
$this
->assertFalse(isset($instance['display']['teaser']));
// Check that the field appears as 'hidden' on the 'Manage display' page
// for the 'teaser' mode.
$this
->drupalGet('admin/structure/types/manage/' . $this->type . '/display/teaser');
$this
->assertFieldByName('fields[field_test][type]', 'hidden', 'The field is displayed as \'hidden \'.');
}