You are here

public function TestSubContext::configurePrivateFiles in Panopoly 7

Same name and namespace in other branches
  1. 8.2 modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc \TestSubContext::configurePrivateFiles()

Configure a private files path if one isn't already configured.

@BeforeScenario @api&&@drupal_private_files

File

modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc, line 277
Provide Behat step-definitions for generic Panopoly tests.

Class

TestSubContext

Code

public function configurePrivateFiles($event) {
  $this->configVariables['file_private_path'] = variable_get('file_private_path', 'not set');
  if ($this->configVariables['file_private_path'] !== 'not set') {
    $file_public_path = variable_get('file_public_path', conf_path() . '/files');
    if (empty($file_public_path)) {
      throw new \Exception('Files must be configured for @drupal_private_files tests to work!');
    }

    // Create and setup the private path.
    $file_private_path = $file_public_path . '/' . 'private';
    variable_set('file_private_path', $file_private_path);
  }
}