function RearrangeFieldsTest::assertFieldOrder

Same name in other branches
  1. 9 core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php \Drupal\Tests\views_ui\Functional\RearrangeFieldsTest::assertFieldOrder()
  2. 10 core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php \Drupal\Tests\views_ui\Functional\RearrangeFieldsTest::assertFieldOrder()
  3. 11.x core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php \Drupal\Tests\views_ui\Functional\RearrangeFieldsTest::assertFieldOrder()

Check if the fields are in the correct order.

Parameters

$view_name: The name of the view.

$fields: Array of field names.

1 call to RearrangeFieldsTest::assertFieldOrder()
RearrangeFieldsTest::testRearrangeFields in core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php
Tests field sorting.

File

core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php, line 48

Class

RearrangeFieldsTest
Tests the reordering of fields via AJAX.

Namespace

Drupal\Tests\views_ui\Functional

Code

protected function assertFieldOrder($view_name, $fields) {
    $this->drupalGet('admin/structure/views/nojs/rearrange/' . $view_name . '/default/field');
    foreach ($fields as $idx => $field) {
        $this->assertFieldById('edit-fields-' . $field . '-weight', $idx + 1);
    }
}

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