function FieldUITest::testHandlerUIAggregation

Same name in other branches
  1. 9 core/modules/field/tests/src/Functional/Views/FieldUITest.php \Drupal\Tests\field\Functional\Views\FieldUITest::testHandlerUIAggregation()
  2. 8.9.x core/modules/field/tests/src/Functional/Views/FieldUITest.php \Drupal\Tests\field\Functional\Views\FieldUITest::testHandlerUIAggregation()
  3. 10 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 handler.

Namespace

Drupal\Tests\field\Functional\Views

Code

public function testHandlerUIAggregation() : void {
    // 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.