function FilterTest::filterVisibleElements

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest::filterVisibleElements()
  2. 10 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FilterTest::filterVisibleElements()

Removes any non-visible elements from the passed array.

Parameters

\Behat\Mink\Element\NodeElement[] $elements: The elements to filter.

Return value

\Behat\Mink\Element\NodeElement[] The filtered elements.

2 calls to FilterTest::filterVisibleElements()
FilterTest::waitForOnlyContentRows in core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php
Waits for only content rows to be visible.
FilterTest::waitForVisibleElementCount in core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php
Waits for the specified number of items to be visible.

File

core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FilterTest.php, line 106

Class

FilterTest
Tests the add filter handler UI.

Namespace

Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler

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.