protected function MigrateTestCase::createSchemaFromRow in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/MigrateTestCase.php \Drupal\Tests\migrate\Unit\MigrateTestCase::createSchemaFromRow()
- 9 core/modules/migrate/tests/src/Unit/MigrateTestCase.php \Drupal\Tests\migrate\Unit\MigrateTestCase::createSchemaFromRow()
Generates a table schema from a row.
Parameters
array $row: The reference row on which to base the schema.
Return value
array The Schema API-ready table schema.
File
- core/
modules/ migrate/ tests/ src/ Unit/ MigrateTestCase.php, line 149
Class
- MigrateTestCase
- Provides setup and helper methods for Migrate module tests.
Namespace
Drupal\Tests\migrate\UnitCode
protected function createSchemaFromRow(array $row) {
// SQLite uses loose ("affinity") typing, so it is OK for every column to be
// a text field.
$fields = array_map(function () {
return [
'type' => 'text',
];
}, $row);
return [
'fields' => $fields,
];
}