From e5ddb46d12c03967ec738db70dfce4fccb5128eb Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 24 Dec 2008 09:53:40 +0000 Subject: - Patch #314464 by Crell, Dave Reid et al: convert db_placeholders() to the new DB layer. --- modules/simpletest/tests/database_test.test | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'modules/simpletest') 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')); + } +} -- cgit v1.2.3