1.20.x database_test.test DatabaseTransactionTestCase::assertRowAbsent($name, $message = NULL)

Assert that a given row is absent from the test table.

Parameters

$name: The name of the row.

$message: The message to log for the assertion.

File

modules/simpletest/tests/database_test.test, line 3633
Database tests.

Class

DatabaseTransactionTestCase
Test transaction support, particularly nesting.

Code

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