function MigrateMessageControllerTest::createSourceTables

Same name and namespace in other branches
  1. 11.x core/modules/migrate_drupal_ui/tests/src/Functional/MigrateMessageControllerTest.php \Drupal\Tests\migrate_drupal_ui\Functional\MigrateMessageControllerTest::createSourceTables()

Create source tables.

2 calls to MigrateMessageControllerTest::createSourceTables()
MigrateMessageControllerTest::testDetail in core/modules/migrate_drupal_ui/tests/src/Functional/MigrateMessageControllerTest.php
Tests the detail pages for migrate messages.
MigrateMessageControllerTest::testOverview in core/modules/migrate_drupal_ui/tests/src/Functional/MigrateMessageControllerTest.php
Tests the overview page for migrate messages.

File

core/modules/migrate_drupal_ui/tests/src/Functional/MigrateMessageControllerTest.php, line 392

Class

MigrateMessageControllerTest
Tests for the MigrateController class.

Namespace

Drupal\Tests\migrate_drupal_ui\Functional

Code

protected function createSourceTables() : void {
  $this->sourceDatabase
    ->schema()
    ->createTable('menu_custom', [
    'fields' => [
      'menu_name' => [
        'type' => 'varchar',
        'not null' => TRUE,
        'length' => '32',
        'default' => '',
      ],
      'title' => [
        'type' => 'varchar',
        'not null' => TRUE,
        'length' => '255',
        'default' => '',
      ],
      'description' => [
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'normal',
      ],
    ],
    'primary key' => [
      'menu_name',
    ],
    'mysql_character_set' => 'utf8',
  ]);
  $this->sourceDatabase
    ->schema()
    ->createTable('profile_values', [
    'fields' => [
      'fid' => [
        'type' => 'int',
        'not null' => TRUE,
        'size' => 'normal',
        'default' => '0',
        'unsigned' => TRUE,
      ],
      'uid' => [
        'type' => 'int',
        'not null' => TRUE,
        'size' => 'normal',
        'default' => '0',
        'unsigned' => TRUE,
      ],
      'value' => [
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'normal',
      ],
    ],
    'primary key' => [
      'fid',
      'uid',
    ],
    'mysql_character_set' => 'utf8',
  ]);
  $this->sourceDatabase
    ->schema()
    ->createTable('profile_fields', [
    'fields' => [
      'fid' => [
        'type' => 'serial',
        'not null' => TRUE,
        'size' => 'normal',
      ],
      'title' => [
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
      ],
      'name' => [
        'type' => 'varchar',
        'not null' => TRUE,
        'length' => '128',
        'default' => '',
      ],
      'explanation' => [
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'normal',
      ],
      'category' => [
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
      ],
      'page' => [
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
      ],
      'type' => [
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
      ],
      'weight' => [
        'type' => 'int',
        'not null' => TRUE,
        'size' => 'normal',
        'default' => '0',
      ],
      'required' => [
        'type' => 'int',
        'not null' => TRUE,
        'size' => 'normal',
        'default' => '0',
      ],
      'register' => [
        'type' => 'int',
        'not null' => TRUE,
        'size' => 'normal',
        'default' => '0',
      ],
      'visibility' => [
        'type' => 'int',
        'not null' => TRUE,
        'size' => 'normal',
        'default' => '0',
      ],
      'autocomplete' => [
        'type' => 'int',
        'not null' => TRUE,
        'size' => 'normal',
        'default' => '0',
      ],
      'options' => [
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'normal',
      ],
    ],
    'primary key' => [
      'fid',
    ],
    'mysql_character_set' => 'utf8',
  ]);
}

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