diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2011-12-10 23:29:21 -0600 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2011-12-10 23:29:21 -0600 |
commit | 06f31080c7281c8227d2556cd0807744e91c9fb5 (patch) | |
tree | 5c6571a83b94268389d977a3d6b3ff1c820e4d59 /modules | |
parent | e59e9d948fa31fbfbf36b08611e04a74aab4dd93 (diff) | |
download | brdo-06f31080c7281c8227d2556cd0807744e91c9fb5.tar.gz brdo-06f31080c7281c8227d2556cd0807744e91c9fb5.tar.bz2 |
Issue #813540 by jbrown, chx: Fixed Comparisons involving NULL must never return true.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/tests/database_test.test | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 87d386aa7..91a51f361 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -1454,13 +1454,27 @@ class DatabaseSelectTestCase extends DatabaseTestCase { } /** - * Test that we can find a record with a NULL value. + * Test that a comparison with NULL is always FALSE. */ function testNullCondition() { $this->ensureSampleDataNull(); $names = db_select('test_null', 'tn') ->fields('tn', array('name')) + ->condition('age', NULL) + ->execute()->fetchCol(); + + $this->assertEqual(count($names), 0, t('No records found when comparing to NULL.')); + } + + /** + * Test that we can find a record with a NULL value. + */ + function testIsNullCondition() { + $this->ensureSampleDataNull(); + + $names = db_select('test_null', 'tn') + ->fields('tn', array('name')) ->isNull('age') ->execute()->fetchCol(); @@ -1471,7 +1485,7 @@ class DatabaseSelectTestCase extends DatabaseTestCase { /** * Test that we can find a record without a NULL value. */ - function testNotNullCondition() { + function testIsNotNullCondition() { $this->ensureSampleDataNull(); $names = db_select('test_null', 'tn') |