function BlockFilterTest::filterVisibleElements

Removes any non-visible elements from the passed array.

Parameters

\Behat\Mink\Element\NodeElement[] $elements: An array of node elements.

Return value

\Behat\Mink\Element\NodeElement[]

1 call to BlockFilterTest::filterVisibleElements()
BlockFilterTest::testBlockFilter in core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php
Tests block filter.

File

core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php, line 91

Class

BlockFilterTest
Tests the JavaScript functionality of the block add filter.

Namespace

Drupal\Tests\block\FunctionalJavascript

Code

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

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