function ViewsListingTest::filterVisibleElements

Same name and namespace in other branches
  1. 8.9.x core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php \Drupal\Tests\views_ui\FunctionalJavascript\ViewsListingTest::filterVisibleElements()
  2. 10 core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php \Drupal\Tests\views_ui\FunctionalJavascript\ViewsListingTest::filterVisibleElements()
  3. 11.x core/modules/views_ui/tests/src/FunctionalJavascript/ViewsListingTest.php \Drupal\Tests\views_ui\FunctionalJavascript\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.