You are here

public function MediaBrowserContext::setUp in Lightning Media 8.2

Same name and namespace in other branches
  1. 8.3 tests/contexts/MediaBrowserContext.behat.inc \Acquia\LightningExtension\Context\MediaBrowserContext::setUp()

Performs pre-scenario tasks.

@BeforeScenario

File

tests/contexts/MediaBrowserContext.behat.inc, line 33

Class

MediaBrowserContext
Contains step definitions for interacting with Lightning's media browser.

Namespace

Acquia\LightningExtension\Context

Code

public function setUp(ScenarioScope $scope) {

  /** @var MinkContext $mink_context */
  $mink_context = $this
    ->getContext(MinkContext::class);
  $path = $mink_context
    ->getMinkParameter('files_path');
  if (empty($path)) {
    $mink_context
      ->setMinkParameter('files_path', __DIR__ . '/../files');
  }

  // Check if the feature or scenario has the 'javascript' tag.
  $tags = array_merge($scope
    ->getScenario()
    ->getTags(), $scope
    ->getFeature()
    ->getTags());
  $this->isJS = in_array('javascript', $tags, TRUE);
}