You are here

public function MigrateUpgradeExecuteTestBase::testMigrateUpgradeExecute in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 modules/ubercart/tests/src/Functional/MigrateUpgradeExecuteTestBase.php \Drupal\Tests\commerce_migrate_ubercart\Functional\MigrateUpgradeExecuteTestBase::testMigrateUpgradeExecute()
  2. 3.0.x modules/ubercart/tests/src/Functional/MigrateUpgradeExecuteTestBase.php \Drupal\Tests\commerce_migrate_ubercart\Functional\MigrateUpgradeExecuteTestBase::testMigrateUpgradeExecute()

Executes all steps of migrations upgrade.

File

modules/ubercart/tests/src/Functional/MigrateUpgradeExecuteTestBase.php, line 30

Class

MigrateUpgradeExecuteTestBase
Base class for testing a migration run with the UI.

Namespace

Drupal\Tests\commerce_migrate_ubercart\Functional

Code

public function testMigrateUpgradeExecute() {
  $this
    ->drupalGet('/upgrade');
  $session = $this
    ->assertSession();
  $session
    ->responseContains("Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal {$this->destinationSiteVersion}.");
  $this
    ->submitForm([], 'Continue');
  $session
    ->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');

  // Get valid credentials.
  $edits = $this
    ->translatePostValues($this
    ->getCredentials());
  $this
    ->submitForm($edits, 'Review upgrade');
  $session
    ->statusCodeEquals(200);
  $this
    ->submitForm([], 'I acknowledge I may lose data. Continue anyway.');
  $session
    ->statusCodeEquals(200);
  $this
    ->submitForm([], 'Perform upgrade');
  $this
    ->assertUpgrade($this
    ->getEntityCounts());
}