You are here

protected function RearrangeFieldsTest::assertFieldOrder in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views_ui/tests/src/Functional/RearrangeFieldsTest.php \Drupal\Tests\views_ui\Functional\RearrangeFieldsTest::assertFieldOrder()
  2. 9 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.

@internal

Parameters

string $view_name: The name of the view.

array $fields: Array of field names.

File

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

Class

RearrangeFieldsTest
Tests the reordering of fields via AJAX.

Namespace

Drupal\Tests\views_ui\Functional

Code

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