diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/tests/database_test.test | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index 07efca610..15802ed1b 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -2067,3 +2067,29 @@ class DatabaseInvalidDataTestCase extends DatabaseTestCase { } } } + +/** + * Drupal-specific SQL syntax tests. + */ +class DatabaseQueryTestCase extends DatabaseTestCase { + function getInfo() { + return array( + 'name' => t('Custom query syntax tests'), + 'description' => t('Test Drupal\'s extended prepared statement syntax..'), + 'group' => t('Database'), + ); + } + + function setUp() { + parent::setUp('database_test'); + } + + /** + * Confirm that temporary tables work and are limited to one request. + */ + function testArraySubstitution() { + $names = db_query("SELECT name FROM {test} WHERE age IN (@ages) ORDER BY age", array('@ages' => array(25, 26, 27)))->fetchAll(); + + $this->assertEqual(count($names), 3, t('Correct number of names returned')); + } +} |