From 13704b8f628af43c5bd1c404cb4eb2ef4d550401 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 1 Mar 2010 11:30:37 +0000 Subject: - Patch #722912 by andypost: db_index_exists() must conform schemaAPI indexExists(). --- modules/simpletest/tests/database_test.test | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'modules/simpletest/tests/database_test.test') diff --git a/modules/simpletest/tests/database_test.test b/modules/simpletest/tests/database_test.test index cf569f7cc..3f3f80008 100644 --- a/modules/simpletest/tests/database_test.test +++ b/modules/simpletest/tests/database_test.test @@ -2390,20 +2390,28 @@ class DatabaseRegressionTestCase extends DatabaseTestCase { $this->assertIdentical($name, $from_database, t("The database handles UTF-8 characters cleanly.")); } + /** + * Test the db_table_exists() function. + */ + function testDBTableExists() { + $this->assertIdentical(TRUE, db_table_exists('node'), t('Returns true for existent table.')); + $this->assertIdentical(FALSE, db_table_exists('nosuchtable'), t('Returns false for nonexistent table.')); + } + /** * Test the db_column_exists() function. */ function testDBColumnExists() { - $this->assertTrue(db_column_exists('node', 'nid'), t('Returns true for existent column.')); - $this->assertFalse(db_column_exists('node', 'nosuchcolumn'), t('Returns false for nonexistent column.')); + $this->assertIdentical(TRUE, db_column_exists('node', 'nid'), t('Returns true for existent column.')); + $this->assertIdentical(FALSE, db_column_exists('node', 'nosuchcolumn'), t('Returns false for nonexistent column.')); } /** - * Test the db_table_exists() function. + * Test the db_index_exists() function. */ - function testDBTableExists() { - $this->assertTrue(db_table_exists('node'), t('Returns true for existent table.')); - $this->assertFalse(db_table_exists('nosuchtable'), t('Returns false for nonexistent table.')); + function testDBIndexExists() { + $this->assertIdentical(TRUE, db_index_exists('node', 'node_created'), t('Returns true for existent index.')); + $this->assertIdentical(FALSE, db_index_exists('node', 'nosuchindex'), t('Returns false for nonexistent index.')); } } -- cgit v1.2.3