diff options
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r-- | modules/simpletest/tests/database_test.test | 20 | ||||
-rw-r--r-- | modules/simpletest/tests/schema.test | 8 |
2 files changed, 18 insertions, 10 deletions
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 @@ -2391,19 +2391,27 @@ class DatabaseRegressionTestCase extends DatabaseTestCase { } /** + * 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.')); } } diff --git a/modules/simpletest/tests/schema.test b/modules/simpletest/tests/schema.test index 7f7571ef9..0ddead4dc 100644 --- a/modules/simpletest/tests/schema.test +++ b/modules/simpletest/tests/schema.test @@ -61,14 +61,14 @@ class SchemaTestCase extends DrupalWebTestCase { // The insert should fail again. $this->assertFalse($this->tryInsert(), t('Insert without a default failed.')); - // Test for fake index. + // Test for fake index and test for the boolean result of indexExists(). $index_exists = Database::getConnection()->schema()->indexExists('test_table', 'test_field'); - $this->assertFalse($index_exists, t('Fake index does not exists')); + $this->assertIdentical($index_exists, FALSE, t('Fake index does not exists')); // Add index. db_add_index('test_table', 'test_field', array('test_field')); - // Test for created index. + // Test for created index and test for the boolean result of indexExists(). $index_exists = Database::getConnection()->schema()->indexExists('test_table', 'test_field'); - $this->assertTrue($index_exists, t('Index created.')); + $this->assertIdentical($index_exists, TRUE, t('Index created.')); // Rename the table. db_rename_table('test_table', 'test_table2'); |