You are here

protected function RearrangeFieldsTest::getViewFields in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views_ui/src/Tests/RearrangeFieldsTest.php \Drupal\views_ui\Tests\RearrangeFieldsTest::getViewFields()

Gets the fields from the View.

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

File

core/modules/views_ui/src/Tests/RearrangeFieldsTest.php, line 30
Contains \Drupal\views_ui\Tests\RearrangeFieldsTest.

Class

RearrangeFieldsTest
Tests the reordering of fields via AJAX.

Namespace

Drupal\views_ui\Tests

Code

protected function getViewFields($view_name = 'test_view', $display_id = 'default') {
  $view = Views::getView($view_name);
  $view
    ->setDisplay($display_id);
  $fields = array();
  foreach ($view->displayHandlers
    ->get('default')
    ->getHandlers('field') as $field => $handler) {
    $fields[] = $field;
  }
  return $fields;
}