You are here

public function MultilingualReviewPageTestBase::prepare in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MultilingualReviewPageTestBase::prepare()
  2. 10 core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MultilingualReviewPageTestBase::prepare()

Performs preparation for the form tests.

This is not done in setup because setup executes before the source database is loaded.

2 calls to MultilingualReviewPageTestBase::prepare()
MultilingualReviewPageTestBase::testMigrateUpgradeReviewPage in core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
Tests the migrate upgrade review form.
NoMultilingualReviewPageTestBase::testMigrateUpgradeReviewPage in core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
Tests the review page when content_translation is enabled.

File

core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php, line 81

Class

MultilingualReviewPageTestBase
Provides a base class for testing the review step of the Upgrade form.

Namespace

Drupal\Tests\migrate_drupal_ui\Functional

Code

public function prepare() {

  // Enable all modules in the source except test and example modules, but
  // include simpletest.

  /** @var \Drupal\Core\Database\Query\SelectInterface $update */
  $update = $this->sourceDatabase
    ->update('system')
    ->fields([
    'status' => 1,
  ])
    ->condition('type', 'module');
  $and = $update
    ->andConditionGroup()
    ->condition('name', '%test%', 'NOT LIKE')
    ->condition('name', '%example%', 'NOT LIKE');
  $conditions = $update
    ->orConditionGroup();
  $conditions
    ->condition($and);
  $conditions
    ->condition('name', 'simpletest');
  $update
    ->condition($conditions);
  $update
    ->execute();

  // Create entries for D8 test modules.
  $insert = $this->sourceDatabase
    ->insert('system')
    ->fields([
    'filename' => 'migrate_status_active_test',
    'name' => 'migrate_status_active_test',
    'type' => 'module',
    'status' => 1,
  ]);
  $insert
    ->execute();
}