You are here

trait CronRunTrait in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php \Drupal\Tests\Traits\Core\CronRunTrait

Adds ability to run cron from tests.

Hierarchy

17 files declare their use of CronRunTrait
AggregatorCronTest.php in core/modules/aggregator/tests/src/Functional/AggregatorCronTest.php
BrowserTestBaseTest.php in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
CronRunTest.php in core/modules/system/tests/src/Functional/System/CronRunTest.php
FeedLanguageTest.php in core/modules/aggregator/tests/src/Functional/FeedLanguageTest.php
FieldUpdateTest.php in core/modules/field/tests/src/Functional/Update/FieldUpdateTest.php

... See full list

File

core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php, line 8

Namespace

Drupal\Tests\Traits\Core
View source
trait CronRunTrait {

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

}

Members

Namesort descending Modifiers Type Description Overrides
CronRunTrait::cronRun protected function Runs cron on the test site.