You are here

protected static function NodeCreationTest::getWatchdogIdsForFailedExplicitRollback in Drupal 8

Gets the log records with the explicit rollback failed exception message.

Return value

\Drupal\Core\Database\StatementInterface A prepared statement object (already executed), which contains the log records with the explicit rollback failed exception message.

1 call to NodeCreationTest::getWatchdogIdsForFailedExplicitRollback()
NodeCreationTest::testFailedPageCreation in core/modules/node/tests/src/Functional/NodeCreationTest.php
Verifies that a transaction rolls back the failed creation.

File

core/modules/node/tests/src/Functional/NodeCreationTest.php, line 316

Class

NodeCreationTest
Create a node and test saving it.

Namespace

Drupal\Tests\node\Functional

Code

protected static function getWatchdogIdsForFailedExplicitRollback() {
  return Database::getConnection()
    ->query("SELECT wid FROM {watchdog} WHERE message LIKE 'Explicit rollback failed%'")
    ->fetchAll();
}