| 7 system.test | ModuleTestCase::assertModuleTablesExist($module) |
| 8 system.test | ModuleTestCase::assertModuleTablesExist($module) |
Assert that all tables defined in a module's hook_schema() exist.
Parameters
$module: The name of the module.
File
- modules/
system/ system.test, line 45 - Tests for system.module.
Code
function assertModuleTablesExist($module) {
$tables = array_keys(drupal_get_schema_unprocessed($module));
$tables_exist = TRUE;
foreach ($tables as $table) {
if (!db_table_exists($table)) {
$tables_exist = FALSE;
}
}
return $this->assertTrue($tables_exist, t('All database tables defined by the @module module exist.', array('@module' => $module)));
}
Login or register to post comments