function ManageDisplayTest::testNoFieldsDisplayOverview

Tests that a message is shown when there are no fields.

File

drupal/core/modules/field_ui/lib/Drupal/field_ui/Tests/ManageDisplayTest.php, line 205
Definition of Drupal\field_ui\Tests\ManageDisplayTest.

Class

ManageDisplayTest
Tests the functionality of the 'Manage display' screens.

Namespace

Drupal\field_ui\Tests

Code

function testNoFieldsDisplayOverview() {

  // Create a fresh content type without any fields.
  $this
    ->drupalCreateContentType(array(
    'type' => 'no_fields',
    'name' => 'No fields',
  ));

  // Remove the 'body' field.
  field_delete_instance(field_info_instance('node', 'body', 'no_fields'));
  $this
    ->drupalGet('admin/structure/types/manage/no_fields/display');
  $this
    ->assertRaw(t('There are no fields yet added. You can add new fields on the <a href="@link">Manage fields</a> page.', array(
    '@link' => url('admin/structure/types/manage/no_fields/fields'),
  )));
}