You are here

public function ThunderParagraphsTestTrait::addImageParagraph in Thunder 8.5

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

Add Image paragraph.

Parameters

string $fieldName: Field name.

array $media: List of media identifiers.

int $position: Position of the paragraph.

3 calls to ThunderParagraphsTestTrait::addImageParagraph()
ArticleCreationTest::testCreateArticle in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article.
ChannelsTagsTest::testChannelsCreation in tests/src/FunctionalJavascript/ChannelsTagsTest.php
Test channel creation, tagging of articles and channel page with articles.
ModuleIntegrationTest::testDiffModule in tests/src/FunctionalJavascript/ModuleIntegrationTest.php
Testing integration of "diff" module.

File

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

Class

ThunderParagraphsTestTrait
Trait for handling of Paragraph related test actions.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function addImageParagraph($fieldName, array $media, $position = NULL) {
  $paragraphIndex = $this
    ->addParagraph($fieldName, 'image', $position);
  $this
    ->selectMedia("{$fieldName}_{$paragraphIndex}_subform_field_image", 'image_browser', $media);
}