public function ThunderMediaTestTrait::createGallery in Thunder 6.2.x
Same name and namespace in other branches
- 8.5 tests/src/FunctionalJavascript/ThunderMediaTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMediaTestTrait::createGallery()
- 8.2 tests/src/FunctionalJavascript/ThunderMediaTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMediaTestTrait::createGallery()
- 8.3 tests/src/FunctionalJavascript/ThunderMediaTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMediaTestTrait::createGallery()
- 8.4 tests/src/FunctionalJavascript/ThunderMediaTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMediaTestTrait::createGallery()
- 6.0.x tests/src/FunctionalJavascript/ThunderMediaTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMediaTestTrait::createGallery()
- 6.1.x tests/src/FunctionalJavascript/ThunderMediaTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMediaTestTrait::createGallery()
Create gallery with selected medias.
Parameters
string $name: Name of gallery.
string $fieldName: Field name.
array $medias: List of media identifiers.
1 call to ThunderMediaTestTrait::createGallery()
- ThunderParagraphsTestTrait::addGalleryParagraph in tests/
src/ FunctionalJavascript/ ThunderParagraphsTestTrait.php - Add Gallery paragraph.
File
- tests/
src/ FunctionalJavascript/ ThunderMediaTestTrait.php, line 75
Class
- ThunderMediaTestTrait
- Trait for handling of Media related test actions.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
public function createGallery($name, $fieldName, array $medias) {
$page = $this
->getSession()
->getPage();
$selector = "input[data-drupal-selector='edit-" . str_replace('_', '-', $fieldName) . "-0-inline-entity-form-name-0-value']";
$this
->assertSession()
->elementExists('css', $selector);
$nameField = $page
->find('css', $selector);
$nameField
->setValue($name);
$this
->selectMedia("{$fieldName}_0_inline_entity_form_field_media_images", 'multiple_image_browser', $medias);
}