function DatabaseTestBase::ensureSampleDataNull

Sets up tables for NULL handling.

4 calls to DatabaseTestBase::ensureSampleDataNull()
SelectTest::testIsNotNullCondition in drupal/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
Tests that we can find a record without a NULL value.
SelectTest::testIsNullCondition in drupal/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
Tests that we can find a record with a NULL value.
SelectTest::testNullCondition in drupal/core/modules/system/lib/Drupal/system/Tests/Database/SelectTest.php
Tests that a comparison with NULL is always FALSE.
UpdateTest::testSimpleNullUpdate in drupal/core/modules/system/lib/Drupal/system/Tests/Database/UpdateTest.php
Confirms updating to NULL.

File

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

Class

DatabaseTestBase
Tests for databases.

Namespace

Drupal\system\Tests\Database

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();
}