You are here

protected function ExposedFormTest::assertNodesExist in Drupal 9

Asserts that nodes of only given bundles exist.

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 496

Class

ExposedFormTest
Tests exposed forms functionality.

Namespace

Drupal\Tests\views\Functional\Plugin

Code

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