class SqlIdMapTest

Same name and namespace in other branches
  1. 11.x core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php \Drupal\Tests\migrate\Kernel\Plugin\id_map\SqlIdMapTest

Defines a test SQL ID map for use in tests.

Hierarchy

Expanded class hierarchy of SqlIdMapTest

File

core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php, line 179

Namespace

Drupal\Tests\migrate\Kernel\Plugin\id_map
View source
class SqlIdMapTest extends TestSqlIdMap implements \Iterator {
  
  /**
   * {@inheritdoc}
   */
  protected function getFieldSchema(array $id_definition) {
    if (!isset($id_definition['type'])) {
      return [];
    }
    switch ($id_definition['type']) {
      case 'integer':
        return [
          'type' => 'int',
          'not null' => TRUE,
        ];
      case 'string':
        return [
          'type' => 'varchar',
          'length' => 65536,
          'not null' => FALSE,
        ];
      default:
        throw new MigrateException($id_definition['type'] . ' not supported');
    }
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.