protected function MediaGalleryModifyTest::sortableUpdate in Thunder 8.5
Same name and namespace in other branches
- 8.4 tests/src/FunctionalJavascript/MediaGalleryModifyTest.php \Drupal\Tests\thunder\FunctionalJavascript\MediaGalleryModifyTest::sortableUpdate()
- 6.2.x tests/src/FunctionalJavascript/MediaGalleryModifyTest.php \Drupal\Tests\thunder\FunctionalJavascript\MediaGalleryModifyTest::sortableUpdate()
- 6.0.x tests/src/FunctionalJavascript/MediaGalleryModifyTest.php \Drupal\Tests\thunder\FunctionalJavascript\MediaGalleryModifyTest::sortableUpdate()
- 6.1.x tests/src/FunctionalJavascript/MediaGalleryModifyTest.php \Drupal\Tests\thunder\FunctionalJavascript\MediaGalleryModifyTest::sortableUpdate()
Define to provide any necessary callback following layout change.
Parameters
string $item: The HTML selector for the element to be moved.
string $from: The HTML selector for the previous container element.
null|string $to: The HTML selector for the target container.
Overrides SortableTestTrait::sortableUpdate
File
- tests/
src/ FunctionalJavascript/ MediaGalleryModifyTest.php, line 21
Class
- MediaGalleryModifyTest
- Tests the Gallery media modification.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
protected function sortableUpdate($item, $from, $to = NULL) {
list($container) = explode(' ', $item, 2);
$js = <<<END
if (typeof Drupal.entityBrowserEntityReference === 'object') {
Drupal.entityBrowserEntityReference.entitiesReordered(document.querySelector("{<span class="php-variable">$container</span>}"));
}
if (typeof Drupal.entityBrowserMultiStepDisplay === 'object') {
Drupal.entityBrowserMultiStepDisplay.entitiesReordered(document.querySelector("{<span class="php-variable">$container</span>}"));
}
END;
$this
->getSession()
->executeScript($js);
}