You are here

protected function BlockFilterTest::filterVisibleElements in Drupal 8

Same name in this branch
  1. 8 core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php \Drupal\Tests\block\FunctionalJavascript\BlockFilterTest::filterVisibleElements()
  2. 8 core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\BlockFilterTest::filterVisibleElements()
Same name and namespace in other branches
  1. 9 core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php \Drupal\Tests\block\FunctionalJavascript\BlockFilterTest::filterVisibleElements()
  2. 10 core/modules/block/tests/src/FunctionalJavascript/BlockFilterTest.php \Drupal\Tests\block\FunctionalJavascript\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;
}