| 7 database_test.test | DatabaseSelectTestCase::testNullCondition() |
| 8 database.test | DatabaseSelectTestCase::testNullCondition() |
Test that we can find a record with a NULL value.
File
- modules/
simpletest/ tests/ database_test.test, line 1459
Code
function testNullCondition() {
$this->ensureSampleDataNull();
$names = db_select('test_null', 'tn')
->fields('tn', array('name'))
->isNull('age')
->execute()->fetchCol();
$this->assertEqual(count($names), 1, t('Correct number of records found with NULL age.'));
$this->assertEqual($names[0], 'Fozzie', t('Correct record returned for NULL age.'));
}
Login or register to post comments