You are here

public function FieldUITest::testHandlerUIAggregation in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Functional/Views/FieldUITest.php \Drupal\Tests\field\Functional\Views\FieldUITest::testHandlerUIAggregation()

Tests the basic field handler form when aggregation is enabled.

File

core/modules/field/tests/src/Functional/Views/FieldUITest.php, line 108

Class

FieldUITest
Tests the UI of the field field handler.

Namespace

Drupal\Tests\field\Functional\Views

Code

public function testHandlerUIAggregation() {

  // Enable aggregation.
  $edit = [
    'group_by' => '1',
  ];
  $this
    ->drupalGet('admin/structure/views/nojs/display/test_view_fieldapi/default/group_by');
  $this
    ->submitForm($edit, 'Apply');
  $url = "admin/structure/views/nojs/handler/test_view_fieldapi/default/field/field_name_0";
  $this
    ->drupalGet($url);
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Test the click sort column options.
  // Tests the available formatter options.
  $options = $this
    ->assertSession()
    ->selectExists('edit-options-click-sort-column')
    ->findAll('css', 'option');
  $options = array_map(function ($item) {
    return $item
      ->getValue();
  }, $options);
  $this
    ->assertEqualsCanonicalizing([
    'format',
    'value',
  ], $options);
}