protected function MultipleCartMultipleVariationTypesTest::createProductAndVariationType in Commerce Core 8.2
Same name in this branch
- 8.2 modules/cart/tests/src/Functional/MultipleCartMultipleVariationTypesTest.php \Drupal\Tests\commerce_cart\Functional\MultipleCartMultipleVariationTypesTest::createProductAndVariationType()
- 8.2 modules/cart/tests/src/FunctionalJavascript/MultipleCartMultipleVariationTypesTest.php \Drupal\Tests\commerce_cart\FunctionalJavascript\MultipleCartMultipleVariationTypesTest::createProductAndVariationType()
Creates a product and product variation type.
Parameters
string $id: The ID.
string $label: The label.
1 call to MultipleCartMultipleVariationTypesTest::createProductAndVariationType()
- MultipleCartMultipleVariationTypesTest::setUp in modules/
cart/ tests/ src/ FunctionalJavascript/ MultipleCartMultipleVariationTypesTest.php
File
- modules/
cart/ tests/ src/ FunctionalJavascript/ MultipleCartMultipleVariationTypesTest.php, line 200
Class
- MultipleCartMultipleVariationTypesTest
- Tests multiple cart page with different variation types.
Namespace
Drupal\Tests\commerce_cart\FunctionalJavascriptCode
protected function createProductAndVariationType($id, $label) {
$variation_type = ProductVariationType::create([
'id' => $id,
'label' => $label,
'orderItemType' => 'default',
'generateTitle' => TRUE,
]);
$variation_type
->save();
$product_type = ProductType::create([
'id' => $id,
'label' => $label,
'variationType' => $variation_type
->id(),
]);
$product_type
->save();
}