function NodeMigrationTypePluginAlterTest::setupDb

Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php \Drupal\Tests\migrate_drupal\Kernel\NodeMigrationTypePluginAlterTest::setupDb()
  2. 10 core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php \Drupal\Tests\migrate_drupal\Kernel\NodeMigrationTypePluginAlterTest::setupDb()
  3. 11.x core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php \Drupal\Tests\migrate_drupal\Kernel\NodeMigrationTypePluginAlterTest::setupDb()

Creates data in the source database.

1 call to NodeMigrationTypePluginAlterTest::setupDb()
NodeMigrationTypePluginAlterTest::setUp in core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php

File

core/modules/migrate_drupal/tests/src/Kernel/NodeMigrationTypePluginAlterTest.php, line 124

Class

NodeMigrationTypePluginAlterTest
Tests the assignment of the node migration type in migrations_plugin_alter.

Namespace

Drupal\Tests\migrate_drupal\Kernel

Code

protected function setupDb() {
    $this->sourceDatabase
        ->schema()
        ->createTable('system', [
        'fields' => [
            'name' => [
                'type' => 'varchar',
                'not null' => TRUE,
                'length' => '255',
                'default' => '',
            ],
            'type' => [
                'type' => 'varchar',
                'not null' => TRUE,
                'length' => '255',
                'default' => '',
            ],
            'status' => [
                'type' => 'int',
                'not null' => TRUE,
                'size' => 'normal',
                'default' => '0',
            ],
            'schema_version' => [
                'type' => 'int',
                'not null' => TRUE,
                'size' => 'normal',
                'default' => '-1',
            ],
        ],
    ]);
    $this->sourceDatabase
        ->insert('system')
        ->fields([
        'name',
        'type',
        'status',
        'schema_version',
    ])
        ->values([
        'name' => 'system',
        'type' => 'module',
        'status' => '1',
        'schema_version' => '7001',
    ])
        ->execute();
}

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