You are here

CronRunTrait.php in Drupal 8

Same filename and directory in other branches
  1. 9 core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php

File

core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php
View source
<?php

namespace Drupal\Tests\Traits\Core;


/**
 * Adds ability to run cron from tests.
 */
trait CronRunTrait {

  /**
   * Runs cron on the test site.
   */
  protected function cronRun() {
    $this
      ->drupalGet('cron/' . \Drupal::state()
      ->get('system.cron_key'));
  }

}

Traits

Namesort descending Description
CronRunTrait Adds ability to run cron from tests.