You are here

public function HandlerTest::testNoDuplicateFields in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views_ui/tests/src/Functional/HandlerTest.php \Drupal\Tests\views_ui\Functional\HandlerTest::testNoDuplicateFields()
  2. 10 core/modules/views_ui/tests/src/Functional/HandlerTest.php \Drupal\Tests\views_ui\Functional\HandlerTest::testNoDuplicateFields()

Ensures that neither node type or node ID appears multiple times.

See also

\Drupal\views\EntityViewsData

File

core/modules/views_ui/tests/src/Functional/HandlerTest.php, line 243

Class

HandlerTest
Tests handler UI for views.

Namespace

Drupal\Tests\views_ui\Functional

Code

public function testNoDuplicateFields() {
  $handler_types = [
    'field',
    'filter',
    'sort',
    'argument',
  ];
  foreach ($handler_types as $handler_type) {
    $add_handler_url = 'admin/structure/views/nojs/add-handler/test_node_view/default/' . $handler_type;
    $this
      ->drupalGet($add_handler_url);
    $this
      ->assertNoDuplicateField('ID', 'Content');
    $this
      ->assertNoDuplicateField('ID', 'Content revision');
    $this
      ->assertNoDuplicateField('Content type', 'Content');
    $this
      ->assertNoDuplicateField('UUID', 'Content');
    $this
      ->assertNoDuplicateField('Revision ID', 'Content');
    $this
      ->assertNoDuplicateField('Revision ID', 'Content revision');
  }
}