You are here

public function EmailContext::iRunTheDigestCron in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  2. 8.3 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  3. 8.4 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  4. 8.5 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  5. 8.6 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  6. 8.8 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  7. 10.3.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  8. 10.0.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  9. 10.1.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()
  10. 10.2.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iRunTheDigestCron()

I run the digest cron.

@Then I run the :arg1 digest cron

File

tests/behat/features/bootstrap/EmailContext.php, line 169

Class

EmailContext

Namespace

Drupal\social\Behat

Code

public function iRunTheDigestCron($frequency) {

  // Update the timings in the digest table.
  $query = \Drupal::database()
    ->update('user_activity_digest');
  $query
    ->fields([
    'timestamp' => 1,
  ]);
  $query
    ->condition('frequency', $frequency);
  $query
    ->execute();

  // Update last run time to make sure we can run the digest cron.
  \Drupal::state()
    ->set('digest.' . $frequency . '.last_run', 1);
  \Drupal::service('cron')
    ->run();
}