function MultilingualReviewPageTestBase::prepare

Same name in other branches
  1. 9 core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MultilingualReviewPageTestBase::prepare()
  2. 8.9.x core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MultilingualReviewPageTestBase::prepare()
  3. 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.

9 calls to MultilingualReviewPageTestBase::prepare()
MultilingualReviewPageTestBase::testMigrateUpgradeReviewPage in core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
Tests the migrate upgrade review form.
NoMultilingualReviewPageTest::testMigrateUpgradeReviewPage in core/modules/forum/tests/src/Functional/migrate_drupal/d6/NoMultilingualReviewPageTest.php
Tests that Forum is displayed in the will be upgraded list.
NoMultilingualReviewPageTest::testMigrateUpgradeReviewPage in core/modules/forum/tests/src/Functional/migrate_drupal/d7/NoMultilingualReviewPageTest.php
Tests that Forum is displayed in the will be upgraded list.
NoMultilingualReviewPageTest::testMigrateUpgradeReviewPage in core/modules/statistics/tests/src/Functional/migrate_drupal/d6/NoMultilingualReviewPageTest.php
Tests that Statistics is displayed in the will be upgraded list.
NoMultilingualReviewPageTest::testMigrateUpgradeReviewPage in core/modules/statistics/tests/src/Functional/migrate_drupal/d7/NoMultilingualReviewPageTest.php
Tests that Statistics is displayed in the will be upgraded list.

... See full list

File

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

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();
}

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