You are here

protected function ParagraphsFeaturesSingleActionTest::setupParagraphSettings in Paragraphs Features 8

Same name and namespace in other branches
  1. 2.x tests/src/FunctionalJavascript/ParagraphsFeaturesSingleActionTest.php \Drupal\Tests\paragraphs_features\FunctionalJavascript\ParagraphsFeaturesSingleActionTest::setupParagraphSettings()

Setup paragraphs field for a content type.

Parameters

string $content_type: The content type containing a paragraphs field.

2 calls to ParagraphsFeaturesSingleActionTest::setupParagraphSettings()
ParagraphsFeaturesSingleActionTest::testAddAboveSupport in tests/src/FunctionalJavascript/ParagraphsFeaturesSingleActionTest.php
Test "add above" feature in combination with single action to button.
ParagraphsFeaturesSingleActionTest::testSingleActionOption in tests/src/FunctionalJavascript/ParagraphsFeaturesSingleActionTest.php
Test display of action.

File

tests/src/FunctionalJavascript/ParagraphsFeaturesSingleActionTest.php, line 134

Class

ParagraphsFeaturesSingleActionTest
Test display of single actions according to the dropdown_to_button setting.

Namespace

Drupal\Tests\paragraphs_features\FunctionalJavascript

Code

protected function setupParagraphSettings($content_type) {
  $currentUrl = $this
    ->getSession()
    ->getCurrentUrl();

  // Have a default paragraph, it simplifies the clicking on the edit page.
  $this
    ->config('core.entity_form_display.node.' . $content_type . '.default')
    ->set('content.field_paragraphs.settings.default_paragraph_type', 'test_1')
    ->set('content.field_paragraphs.third_party_settings.paragraphs_features.show_drag_and_drop', FALSE)
    ->save();

  // Disable duplicate and add_above actions.
  $this
    ->setParagraphFeature($content_type, 'duplicate', '0');
  $this
    ->setParagraphFeature($content_type, 'add_above', '0');
  $this
    ->drupalGet($currentUrl);
}