createMigrationConnection example


  protected $logger;

  protected static $modules = ['migrate'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->createMigrationConnection();
    $this->sourceDatabase = Database::getConnection('default', 'migrate');
    // Attach the original test prefix as a database, for SQLite to attach its     // database file.     $this->sourceDatabase->attachDatabase(substr($this->sourceDatabase->getConnectionOptions()['prefix'], 0, -1));
  }

  /** * Changes the database connection to the prefixed one. * * @todo Remove when we don't use global. https://www.drupal.org/node/2552791 */
  

  protected $edits;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->createMigrationConnection();
    $this->sourceDatabase = Database::getConnection('default', 'migrate_drupal_ui');

    // Get the current major version.     [$this->destinationSiteVersion] = explode('.', \Drupal::VERSION, 2);

    // Log in as user 1. Migrations in the UI can only be performed as user 1.     $this->drupalLogin($this->rootUser);
  }

  /** * Navigates to the credential form and submits valid credentials. */
Home | Imprint | This part of the site doesn't use cookies.