You are here

public function WatchdogContext::setUp in Lightning Core 8.2

Same name and namespace in other branches
  1. 8.5 tests/contexts/WatchdogContext.behat.inc \WatchdogContext::setUp()
  2. 8.3 tests/contexts/WatchdogContext.behat.inc \WatchdogContext::setUp()
  3. 8.4 tests/contexts/WatchdogContext.behat.inc \WatchdogContext::setUp()

Install dblog and store the time the scenario began.

@BeforeScenario ~@errors

Parameters

\Behat\Behat\Hook\Scope\ScenarioScope $scope: The scenario scope.

File

tests/contexts/WatchdogContext.behat.inc, line 46

Class

WatchdogContext
Tracks errors logged to the database during the scenario.

Code

public function setUp(ScenarioScope $scope) {
  if ($this
    ->isDiabled($scope)) {
    return;
  }
  if (!\Drupal::moduleHandler()
    ->moduleExists('dblog')) {
    $this->uninstall = \Drupal::service('module_installer')
      ->install([
      'dblog',
    ]);
  }
  $this->startTime = time();
}