| 7 system.test | ModuleTestCase::assertTableCount($base_table, $count = TRUE) |
| 8 system.test | ModuleTestCase::assertTableCount($base_table, $count = TRUE) |
Assert there are tables that begin with the specified base table name.
Parameters
$base_table: Beginning of table name to look for.
$count: (optional) Whether or not to assert that there are tables that match the specified base table. Defaults to TRUE.
File
- modules/
system/ system.test, line 30 - Tests for system.module.
Code
function assertTableCount($base_table, $count = TRUE) {
$tables = db_find_tables(Database::getConnection()->prefixTables('{' . $base_table . '}') . '%');
if ($count) {
return $this->assertTrue($tables, t('Tables matching "@base_table" found.', array('@base_table' => $base_table)));
}
return $this->assertFalse($tables, t('Tables matching "@base_table" not found.', array('@base_table' => $base_table)));
}
Login or register to post comments