You are here

public function VarbaseContext::__construct in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.7

Same name and namespace in other branches
  1. 8.8 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::__construct()
  2. 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::__construct()
  3. 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::__construct()
  4. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::__construct()
  5. 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::__construct()

Initializes context.

Parameters

array $parameters .: Context parameters (set them up through behat.yml or behat.local.yml).

File

tests/features/bootstrap/VarbaseContext.php, line 35

Class

VarbaseContext
Defines application features from the specific context.

Code

public function __construct(array $parameters) {

  // Set the list of parameters.
  $this->parameters = $parameters;
  if (isset($parameters['varbase_users'])) {
    $this->varbase_users = $parameters['varbase_users'];
    foreach ($parameters['varbase_users'] as $varbase_username => $varbase_user) {
      $this->users[$varbase_username] = $varbase_user['password'];
    }
  }
  else {
    throw new Exception('behat.yml config files should include "varbase_users" property.');
  }
}