protected function ParagraphsTestBase::setAllowedParagraphsTypes

Sets the allowed Paragraphs types that can be added.

Parameters

string $content_type: Content type name that contains the paragraphs field.

array $paragraphs_types: Array of paragraphs types that will be modified.

bool $selected: Whether or not the paragraphs types will be enabled.

string $paragraphs_field: Paragraphs field name that does the reference.

4 calls to ParagraphsTestBase::setAllowedParagraphsTypes()
ParagraphsAddModesTest::testDropDownMode in paragraphs/tests/src/Functional/WidgetLegacy/ParagraphsAddModesTest.php
Tests the add drop down button.
ParagraphsAddModesTest::testDropDownMode in paragraphs/tests/src/Functional/WidgetStable/ParagraphsAddModesTest.php
Tests the add drop down button.
ParagraphsAddModesTest::testSelectMode in paragraphs/tests/src/Functional/WidgetLegacy/ParagraphsAddModesTest.php
Tests the add select mode.
ParagraphsAddModesTest::testSelectMode in paragraphs/tests/src/Functional/WidgetStable/ParagraphsAddModesTest.php
Tests the add select mode.

File

paragraphs/tests/src/Functional/WidgetLegacy/ParagraphsTestBase.php, line 128

Class

ParagraphsTestBase
Base class for tests.

Namespace

Drupal\Tests\paragraphs\Functional\WidgetLegacy

Code

protected function setAllowedParagraphsTypes($content_type, $paragraphs_types, $selected, $paragraphs_field) {
  $edit = [];
  $this
    ->drupalGet('admin/structure/types/manage/' . $content_type . '/fields/node.' . $content_type . '.' . $paragraphs_field);
  foreach ($paragraphs_types as $paragraphs_type) {
    $edit['settings[handler_settings][target_bundles_drag_drop][' . $paragraphs_type . '][enabled]'] = $selected;
  }
  $this
    ->submitForm($edit, 'Save settings');
}