protected function ParagraphsTestBase::setParagraphsWidgetMode

Sets the Paragraphs widget display mode.

Parameters

string $content_type: Content type name where to set the widget mode.

string $paragraphs_field: Paragraphs field to change the mode.

string $mode: Mode to be set. ('closed', 'preview' or 'open'). 'preview' is only allowed in the legacy widget. Use setParagraphsWidgetSettings for the stable widget, instead.

12 calls to ParagraphsTestBase::setParagraphsWidgetMode()
ParagraphsAnchorPluginTest::testAnchorPlugin in paragraphs_collection/modules/paragraphs_collection_demo/tests/src/Functional/ParagraphsAnchorPluginTest.php
Tests the anchor plugin functionality.
ParagraphsBehaviorsTest::testCollapsedSummary in paragraphs/tests/src/Functional/WidgetStable/ParagraphsBehaviorsTest.php
Tests the behavior plugins summary for paragraphs closed mode.
ParagraphsDuplicateFeatureTest::testDuplicateButtonWithNesting in paragraphs/tests/src/Functional/WidgetStable/ParagraphsDuplicateFeatureTest.php
Tests duplicate paragraph feature with nested paragraphs.
ParagraphsGridLayoutPluginTest::testGridSettingsSummary in paragraphs_collection/tests/src/Functional/ParagraphsGridLayoutPluginTest.php
Tests Grid plugin summary for paragraphs closed mode.
ParagraphsInlineEntityFormTest::testParagraphsIEFChangeOrder in paragraphs/tests/src/Functional/WidgetLegacy/ParagraphsInlineEntityFormTest.php
Tests the reordering of previewed paragraphs.

... See full list

File

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

Class

ParagraphsTestBase
Base class for tests.

Namespace

Drupal\Tests\paragraphs\Functional\WidgetLegacy

Code

protected function setParagraphsWidgetMode($content_type, $paragraphs_field, $mode) {
  $this
    ->drupalGet('admin/structure/types/manage/' . $content_type . '/form-display');
  $this
    ->submitForm([], $paragraphs_field . '_settings_edit');
  $this
    ->submitForm([
    'fields[' . $paragraphs_field . '][settings_edit_form][settings][edit_mode]' => $mode,
  ], 'Update');
  $this
    ->submitForm([], 'Save');
}