function TransactionTest::assertRowPresent

Asserts that a given row is present in the test table.

Parameters

$name: The name of the row.

$message: The message to log for the assertion.

2 calls to TransactionTest::assertRowPresent()
TransactionTest::testTransactionStacking in drupal/core/modules/system/lib/Drupal/system/Tests/Database/TransactionTest.php
Tests transaction stacking, commit, and rollback.
TransactionTest::testTransactionWithDdlStatement in drupal/core/modules/system/lib/Drupal/system/Tests/Database/TransactionTest.php
Tests the compatibility of transactions with DDL statements.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Database/TransactionTest.php, line 367
Definition of Drupal\system\Tests\Database\TransactionTest.

Class

TransactionTest
Tests transaction support, particularly nesting.

Namespace

Drupal\system\Tests\Database

Code

function assertRowPresent($name, $message = NULL) {
  if (!isset($message)) {
    $message = format_string('Row %name is present.', array(
      '%name' => $name,
    ));
  }
  $present = (bool) db_query('SELECT 1 FROM {test} WHERE name = :name', array(
    ':name' => $name,
  ))
    ->fetchField();
  return $this
    ->assertTrue($present, $message);
}