You are here

public function ThunderParagraphsTestTrait::addVideoParagraph in Thunder 6.1.x

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

Add Video paragraph.

Parameters

string $fieldName: Field name.

array $media: List of media identifiers.

int $position: Position of the paragraph.

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

File

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

Class

ThunderParagraphsTestTrait
Trait for handling of Paragraph related test actions.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function addVideoParagraph($fieldName, array $media, $position = NULL) {
  $paragraphIndex = $this
    ->addParagraph($fieldName, 'video', $position);
  $this
    ->selectMedia("{$fieldName}_{$paragraphIndex}_subform_field_video", 'video_browser', $media);
}