function ExposedFormTest::assertNodesExist

Same name in other branches
  1. 9 core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::assertNodesExist()
  2. 10 core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php \Drupal\Tests\views\Functional\Plugin\ExposedFormTest::assertNodesExist()

Asserts that nodes of only given bundles exist.

@internal

Parameters

array $bundles: Bundles of nodes.

1 call to ExposedFormTest::assertNodesExist()
ExposedFormTest::testExposedBlock in core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
Tests the exposed block functionality.

File

core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php, line 545

Class

ExposedFormTest
Tests exposed forms functionality.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

protected function assertNodesExist(array $bundles) : void {
    foreach ($this->nodes as $node) {
        if (in_array($node->bundle(), $bundles)) {
            $this->assertSession()
                ->pageTextContains($node->label());
        }
        else {
            $this->assertSession()
                ->pageTextNotContains($node->label());
        }
    }
}

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