Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPENEUROPA-1898: Adjust behat tests for allowing use media standalone url only in tests. #59

Merged
merged 2 commits into from
May 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/Behat/WebtoolsCookieConsentContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@
*/
class WebtoolsCookieConsentContext extends RawDrupalContext {

/**
* The config context.
*
* @var \Drupal\DrupalExtension\Context\ConfigContext
*/
protected $configContext;

/**
* Gathers some other contexts.
*
* @param \Behat\Behat\Hook\Scope\BeforeScenarioScope $scope
* The before scenario scope.
*
* @BeforeScenario
*/
public function gatherContexts(BeforeScenarioScope $scope) {
$environment = $scope->getEnvironment();
$this->configContext = $environment->getContext('Drupal\DrupalExtension\Context\ConfigContext');
}

/**
* Enables the Media module.
*
Expand All @@ -25,6 +45,9 @@ class WebtoolsCookieConsentContext extends RawDrupalContext {
*/
public function enableModule(BeforeScenarioScope $scope): void {
\Drupal::service('module_installer')->install(['oe_media']);

$this->configContext->setConfig('media.settings', 'standalone_url', TRUE);
\Drupal::service('router.builder')->rebuild();
}

/**
Expand Down