1 schema.test SchemaTestCase::tryInsert($table = 'test_table')

File

core/modules/simpletest/tests/schema.test, line 112
Tests for the Database Schema API.

Class

SchemaTestCase
Unit tests for the Schema API.

Code

function tryInsert($table = 'test_table') {
  try {
    db_insert($table)
      ->fields(array('id' => mt_rand(10, 20)))
      ->execute();
    return TRUE;
  }
  catch (Exception $e) {
    return FALSE;
  }
}