You are here

protected function HighWaterTest::nodeExists in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Kernel/HighWaterTest.php \Drupal\Tests\migrate\Kernel\HighWaterTest::nodeExists()
  2. 9 core/modules/migrate/tests/src/Kernel/HighWaterTest.php \Drupal\Tests\migrate\Kernel\HighWaterTest::nodeExists()

Checks if node with given title exists.

Parameters

string $title: Title of the node.

Return value

bool

File

core/modules/migrate/tests/src/Kernel/HighWaterTest.php, line 297

Class

HighWaterTest
Tests migration high water property.

Namespace

Drupal\Tests\migrate\Kernel

Code

protected function nodeExists($title) {
  $query = \Drupal::entityQuery('node')
    ->accessCheck(FALSE);
  $result = $query
    ->condition('title', $title)
    ->range(0, 1)
    ->execute();
  return !empty($result);
}