You are here

class DropzoneContext in Lightning Media 8

Same name and namespace in other branches
  1. 8.2 tests/contexts/DropzoneContext.behat.inc \Acquia\LightningExtension\Context\DropzoneContext
  2. 8.3 tests/contexts/DropzoneContext.behat.inc \Acquia\LightningExtension\Context\DropzoneContext

Contains step definitions for interacting with DropzoneJS widgets.

Hierarchy

  • class \Acquia\LightningExtension\Context\DropzoneContext extends \Drupal\DrupalExtension\Context\DrupalSubContextBase

Expanded class hierarchy of DropzoneContext

File

tests/contexts/DropzoneContext.behat.inc, line 11

Namespace

Acquia\LightningExtension\Context
View source
class DropzoneContext extends DrupalSubContextBase {

  /**
   * Attaches a file to a dropzone.
   *
   * @param string $file
   *   The file to attach, relative to the file directory configured for Mink.
   *
   * @When I attach the file :file to the dropzone
   */
  public function attachFileToDropzone($file) {
    $this
      ->getSession()
      ->executeScript('Dropzone.instances[0].hiddenFileInput.name = "file"');
    $this
      ->getContext(MinkContext::class)
      ->attachFileToField('file', $file);

    // @todo: React when the upload actually completes.
    sleep(3);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DropzoneContext::attachFileToDropzone public function Attaches a file to a dropzone.