You are here

public function MigrateUpgradeAddToCartTest::testMigrateUpgrade in Commerce Migrate 3.1.x

Same name in this branch
  1. 3.1.x modules/ubercart/tests/src/Functional/uc6/MigrateUpgradeAddToCartTest.php \Drupal\Tests\commerce_migrate_ubercart\Functional\uc6\MigrateUpgradeAddToCartTest::testMigrateUpgrade()
  2. 3.1.x modules/commerce/tests/src/Functional/commerce1/MigrateUpgradeAddToCartTest.php \Drupal\Tests\commerce_migrate_commerce\Functional\commerce1\MigrateUpgradeAddToCartTest::testMigrateUpgrade()
Same name and namespace in other branches
  1. 8.2 modules/ubercart/tests/src/Functional/uc6/MigrateUpgradeAddToCartTest.php \Drupal\Tests\commerce_migrate_ubercart\Functional\uc6\MigrateUpgradeAddToCartTest::testMigrateUpgrade()
  2. 3.0.x modules/ubercart/tests/src/Functional/uc6/MigrateUpgradeAddToCartTest.php \Drupal\Tests\commerce_migrate_ubercart\Functional\uc6\MigrateUpgradeAddToCartTest::testMigrateUpgrade()

Executes all steps of migrations upgrade.

File

modules/ubercart/tests/src/Functional/uc6/MigrateUpgradeAddToCartTest.php, line 90

Class

MigrateUpgradeAddToCartTest
Tests adding a product to the cart after a full migration.

Namespace

Drupal\Tests\commerce_migrate_ubercart\Functional\uc6

Code

public function testMigrateUpgrade() {
  $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([], 'Perform upgrade');

  // Prevent error that the new field, field_order_admin_comments does not
  // exist on the entity type commerce_order.
  drupal_flush_all_caches();

  // Add to cart.
  \Drupal::service('commerce_cart.cart_provider')
    ->createCart('default');
  $this
    ->drupalGet('/product/2');
  $this
    ->submitForm([], 'Add to cart');
  $session
    ->pageTextContains('Beach Towel added to your cart.');
}