function DriverSpecificTransactionTestBase::assertRowPresent
Same name in other branches
- 10 core/tests/Drupal/KernelTests/Core/Database/DriverSpecificTransactionTestBase.php \Drupal\KernelTests\Core\Database\DriverSpecificTransactionTestBase::assertRowPresent()
Asserts that a given row is present in the test table.
@internal
Parameters
string $name: The name of the row.
string $message: The message to log for the assertion.
13 calls to DriverSpecificTransactionTestBase::assertRowPresent()
- DriverSpecificTransactionTestBase::createFirstSavepointTransaction in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificTransactionTestBase.php - Create a Drupal savepoint transaction after root.
- DriverSpecificTransactionTestBase::createRootTransaction in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificTransactionTestBase.php - Create a root Drupal transaction.
- DriverSpecificTransactionTestBase::testCommitWithActiveSavepoint in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificTransactionTestBase.php - Tests committing a transaction while savepoints are active.
- DriverSpecificTransactionTestBase::testReleaseIntermediateSavepoint in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificTransactionTestBase.php - Tests releasing a savepoint before last is safe.
- DriverSpecificTransactionTestBase::testRollbackRootAfterSavepointRollback in core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificTransactionTestBase.php - Tests root transaction rollback after savepoint rollback.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ DriverSpecificTransactionTestBase.php, line 495
Class
- DriverSpecificTransactionTestBase
- Tests the transaction abstraction system.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function assertRowPresent(string $name, ?string $message = NULL) : void {
$present = (bool) $this->connection
->query('SELECT 1 FROM {test} WHERE [name] = :name', [
':name' => $name,
])
->fetchField();
$this->assertTrue($present, $message ?? "Row '{$name}' should be present, but it actually does not exist.");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.