protected function DbDumpTest::getTableSchema in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/src/Tests/Update/DbDumpTest.php \Drupal\system\Tests\Update\DbDumpTest::getTableSchema()
Helper function to get a simplified schema for a given table.
Parameters
string $table:
Return value
array Array keyed by field name, with the values being the field type.
1 call to DbDumpTest::getTableSchema()
- DbDumpTest::testScriptLoad in core/
modules/ system/ src/ Tests/ Update/ DbDumpTest.php - Test loading the script back into the database.
File
- core/
modules/ system/ src/ Tests/ Update/ DbDumpTest.php, line 232 - Contains \Drupal\system\Tests\Update\DbDumpTest.
Class
- DbDumpTest
- Tests for the database dump commands.
Namespace
Drupal\system\Tests\UpdateCode
protected function getTableSchema($table) {
// Verify the field type on the data column in the cache table.
// @todo this is MySQL specific.
$query = db_query("SHOW COLUMNS FROM {" . $table . "}");
$definition = [];
while ($row = $query
->fetchAssoc()) {
$definition[$row['Field']] = $row['Type'];
}
return $definition;
}