You are here

function DatabaseTestCase::ensureSampleDataNull in SimpleTest 7

Set up tables for NULL handling.

2 calls to DatabaseTestCase::ensureSampleDataNull()
DatabaseSelectTestCase::testNotNullCondition in tests/database_test.test
Test that we can find a record without a NULL value.
DatabaseSelectTestCase::testNullCondition in tests/database_test.test
Test that we can find a record with a NULL value.

File

tests/database_test.test, line 57

Class

DatabaseTestCase
Base test class for databases.

Code

function ensureSampleDataNull() {
  $schema['test_null'] = drupal_get_schema('test_null');
  $this
    ->installTables($schema);
  db_insert('test_null')
    ->fields(array(
    'name',
    'age',
  ))
    ->values(array(
    'name' => 'Kermit',
    'age' => 25,
  ))
    ->values(array(
    'name' => 'Fozzie',
    'age' => NULL,
  ))
    ->values(array(
    'name' => 'Gonzo',
    'age' => 27,
  ))
    ->execute();
}