1 database_test.test DatabaseTransactionTestCase::assertRowPresent($name, $message = NULL)

Assert 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.

File

core/modules/simpletest/tests/database_test.test, line 3620
Database tests.

Class

DatabaseTransactionTestCase
Test transaction support, particularly nesting.

Code

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