You are here

public function ThunderParagraphsTestTrait::addGalleryParagraph in Thunder 6.0.x

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addGalleryParagraph()
  2. 8.2 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addGalleryParagraph()
  3. 8.3 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addGalleryParagraph()
  4. 8.4 tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addGalleryParagraph()
  5. 6.2.x tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addGalleryParagraph()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderParagraphsTestTrait::addGalleryParagraph()

Add Gallery paragraph.

Parameters

string $fieldName: Field name.

string $name: Name of the gallery.

array $media: List of media identifiers.

int $position: Position of the paragraph.

1 call to ThunderParagraphsTestTrait::addGalleryParagraph()
ArticleCreationTest::testCreateArticle in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article.

File

tests/src/FunctionalJavascript/ThunderParagraphsTestTrait.php, line 168

Class

ThunderParagraphsTestTrait
Trait for handling of Paragraph related test actions.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function addGalleryParagraph($fieldName, $name, array $media, $position = NULL) {
  $paragraphIndex = $this
    ->addParagraph($fieldName, 'gallery', $position);
  $this
    ->createGallery($name, "{$fieldName}_{$paragraphIndex}_subform_field_media", $media);
}