function CronRunTrait::cronRun

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php \Drupal\Tests\Traits\Core\CronRunTrait::cronRun()

Runs cron on the test site.

2 calls to CronRunTrait::cronRun()
LocaleUpdateCronTest::testUpdateCron in core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
Tests interface translation update using cron.
ReEnableModuleFieldTest::testReEnabledField in core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
Tests the behavior of a field module after being disabled and re-enabled.

File

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

Class

CronRunTrait
Adds ability to run cron from tests.

Namespace

Drupal\Tests\Traits\Core

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.