public function MigrateUpgradeAddToCartTest::testMigrateUpgrade in Commerce Migrate 3.1.x
Same name in this branch
- 3.1.x modules/ubercart/tests/src/Functional/uc6/MigrateUpgradeAddToCartTest.php \Drupal\Tests\commerce_migrate_ubercart\Functional\uc6\MigrateUpgradeAddToCartTest::testMigrateUpgrade()
- 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
- 8.2 modules/commerce/tests/src/Functional/commerce1/MigrateUpgradeAddToCartTest.php \Drupal\Tests\commerce_migrate_commerce\Functional\commerce1\MigrateUpgradeAddToCartTest::testMigrateUpgrade()
- 3.0.x modules/commerce/tests/src/Functional/commerce1/MigrateUpgradeAddToCartTest.php \Drupal\Tests\commerce_migrate_commerce\Functional\commerce1\MigrateUpgradeAddToCartTest::testMigrateUpgrade()
Executes all steps of migrations upgrade.
File
- modules/
commerce/ tests/ src/ Functional/ commerce1/ MigrateUpgradeAddToCartTest.php, line 90
Class
- MigrateUpgradeAddToCartTest
- Tests adding a product to the cart after a full migration.
Namespace
Drupal\Tests\commerce_migrate_commerce\Functional\commerce1Code
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/15');
$this
->drupalPostForm(NULL, [], 'Add to cart');
$session
->pageTextContains('Tote Bag 1 added to your cart.');
}