You are here

protected function ProductLayoutBuilderIntegrationTest::enableLayoutsForBundle in Commerce Core 8.2

Enable layouts.

Parameters

string $bundle: The product bundle.

bool $allow_custom: Whether to allow custom layouts.

6 calls to ProductLayoutBuilderIntegrationTest::enableLayoutsForBundle()
ProductLayoutBuilderIntegrationTest::testConfiguringDefaultLayout in modules/product/tests/src/FunctionalJavascript/ProductLayoutBuilderIntegrationTest.php
Tests configuring the default layout for a product type.
ProductLayoutBuilderIntegrationTest::testConfiguringOverrideLayout in modules/product/tests/src/FunctionalJavascript/ProductLayoutBuilderIntegrationTest.php
Tests configuring a layout override for a product.
ProductLayoutBuilderIntegrationTest::testFieldInjectionDisabled in modules/product/tests/src/FunctionalJavascript/ProductLayoutBuilderIntegrationTest.php
Tests that enabling Layout Builder for a display disables field injection.
ProductLayoutBuilderIntegrationTest::testFieldInjectionOverAjax in modules/product/tests/src/FunctionalJavascript/ProductLayoutBuilderIntegrationTest.php
Test field injection on a Layout Builder enabled product.
ProductLayoutBuilderIntegrationTest::testProductWithoutVariationsDoesNotCrash in modules/product/tests/src/FunctionalJavascript/ProductLayoutBuilderIntegrationTest.php
Make sure products without a variation do not crash.

... See full list

File

modules/product/tests/src/FunctionalJavascript/ProductLayoutBuilderIntegrationTest.php, line 281

Class

ProductLayoutBuilderIntegrationTest
@group commerce

Namespace

Drupal\Tests\commerce_product\FunctionalJavascript

Code

protected function enableLayoutsForBundle($bundle, $allow_custom = FALSE) {
  $this
    ->drupalGet(Url::fromRoute('entity.entity_view_display.commerce_product.default', [
    'commerce_product_type' => $bundle,
  ]));
  $this
    ->getSession()
    ->getPage()
    ->checkField('layout[enabled]');
  if ($allow_custom) {
    $this
      ->getSession()
      ->getPage()
      ->checkField('layout[allow_custom]');
  }
  $this
    ->getSession()
    ->getPage()
    ->pressButton('Save');
  $this
    ->assertNotEmpty($this
    ->assertSession()
    ->waitForElementVisible('css', '#edit-manage-layout'));
  $this
    ->assertSession()
    ->linkExists('Manage layout');
}