protected function HighWaterTest::nodeExists in Drupal 9
Same name and namespace in other branches
- 8 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
2 calls to HighWaterTest::nodeExists()
- HighWaterTest::assertNodeDoesNotExist in core/
modules/ migrate/ tests/ src/ Kernel/ HighWaterTest.php - Assert that node with given title does not exist.
- HighWaterTest::assertNodeExists in core/
modules/ migrate/ tests/ src/ Kernel/ HighWaterTest.php - Assert that node with given title exists.
File
- core/
modules/ migrate/ tests/ src/ Kernel/ HighWaterTest.php, line 291
Class
- HighWaterTest
- Tests migration high water property.
Namespace
Drupal\Tests\migrate\KernelCode
protected function nodeExists($title) {
$query = \Drupal::entityQuery('node')
->accessCheck(FALSE);
$result = $query
->condition('title', $title)
->range(0, 1)
->execute();
return !empty($result);
}