function ModuleTestCase::assertModuleTablesDoNotExist in Drupal 7
Assert that none of the tables defined in a module's hook_schema() exist.
Parameters
$module: The name of the module.
2 calls to ModuleTestCase::assertModuleTablesDoNotExist()
- EnableDisableTestCase::assertSuccessfulDisableAndUninstall in modules/
system/ system.test - Disables and uninstalls a module and asserts that it was done correctly.
- EnableDisableTestCase::testEnableDisable in modules/
system/ system.test - Test that all core modules can be enabled, disabled and uninstalled.
File
- modules/
system/ system.test, line 62 - Tests for system.module.
Class
- ModuleTestCase
- Helper class for module test cases.
Code
function assertModuleTablesDoNotExist($module) {
$tables = array_keys(drupal_get_schema_unprocessed($module));
$tables_exist = FALSE;
foreach ($tables as $table) {
if (db_table_exists($table)) {
$tables_exist = TRUE;
}
}
return $this
->assertFalse($tables_exist, format_string('None of the database tables defined by the @module module exist.', array(
'@module' => $module,
)));
}