function ViewsListingTest::filterVisibleElements

Removes any non-visible elements from the passed array.

Parameters

array $elements: The elements.

Return value

array

1 call to ViewsListingTest::filterVisibleElements()
ViewsListingTest::testFilterViewsListing in core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php
Tests the filtering on the Views listing page.

File

core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php, line 140

Class

ViewsListingTest
Tests the JavaScript filtering on the Views listing page.

Namespace

Drupal\Tests\views_ui\FunctionalJavascript

Code

protected function filterVisibleElements($elements) {
  $elements = array_filter($elements, function ($element) {
    return $element->isVisible();
  });
  return $elements;
}

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