View source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Functional\commerce1;
use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase;
class MigrateUpgradeAddToCartTest extends MigrateUpgradeTestBase {
protected static $modules = [
'address',
'address',
'block',
'block_content',
'comment',
'commerce',
'commerce_cart',
'commerce_log',
'commerce_migrate',
'commerce_migrate_commerce',
'commerce_order',
'commerce_payment',
'commerce_price',
'commerce_product',
'commerce_promotion',
'commerce_shipping',
'commerce_store',
'datetime',
'dblog',
'entity',
'entity_reference_revisions',
'field',
'file',
'filter',
'image',
'inline_entity_form',
'link',
'migrate',
'migrate_drupal',
'migrate_drupal_ui',
'migrate_plus',
'node',
'options',
'path',
'path_alias',
'profile',
'search',
'shortcut',
'state_machine',
'system',
'taxonomy',
'telephone',
'text',
'user',
'views',
];
protected function setUp() : void {
parent::setUp();
$this
->writeSettings([
'settings' => [
'migrate_node_migrate_type_classic' => (object) [
'value' => TRUE,
'required' => TRUE,
],
],
]);
$this
->loadFixture(drupal_get_path('module', 'commerce_migrate_commerce') . '/tests/fixtures/ck2.php');
}
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.');
$edits = $this
->translatePostValues($this
->getCredentials());
$this
->submitForm($edits, 'Review upgrade');
$session
->statusCodeEquals(200);
$this
->submitForm([], 'Perform upgrade');
drupal_flush_all_caches();
\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.');
}
protected function getSourceBasePath() {
return __DIR__ . '/files';
}
protected function getEntityCounts() {
return [];
}
protected function getAvailablePaths() {
return [];
}
protected function getMissingPaths() {
return [];
}
protected function getEntityCountsIncremental() {
}
}