public function ThunderMediaTestTrait::createGallery in Thunder 8.3
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.4 tests/src/FunctionalJavascript/ThunderMediaTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderMediaTestTrait::createGallery()
- 6.2.x 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.
File
- tests/
src/ FunctionalJavascript/ ThunderMediaTestTrait.php, line 78
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);
}