function HighWaterTest::nodeExists
Same name in other branches
- 8.9.x core/modules/migrate/tests/src/Kernel/HighWaterTest.php \Drupal\Tests\migrate\Kernel\HighWaterTest::nodeExists()
- 10 core/modules/migrate/tests/src/Kernel/HighWaterTest.php \Drupal\Tests\migrate\Kernel\HighWaterTest::nodeExists()
- 11.x 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 297
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.